New Relic Integration
Toollake enables seamless connectivity between various business tools, allowing AI agents to interact with observability platforms like New Relic for performance monitoring and analytics.
This section outlines how to execute NRQL queries using the Newrelic
class from apm.newrelic
.
📦 Requirements
New Relic API Key
New Relic Account ID
apm.newrelic
module available in your environment
🔧 Class: Newrelic
Newrelic
A lightweight utility for querying New Relic via NRQL within Toollake.
Constructor
api_key (
str
): Your New Relic User API Key.Example:
"NRAK-XXXXXXXXXXXXXX"
account_id (
str
): Your New Relic account identifier.Example:
"1234567"
📡 Method: execute_nrql(nrql_query: str) → dict
execute_nrql(nrql_query: str) → dict
Executes a NRQL (New Relic Query Language) query to fetch custom telemetry metrics.
Parameters
nrql_query
(str
): A valid NRQL query string.Example:
Returns
dict
: A structured JSON response containing query results.
✅ Example Usage
📈 Use Case in Toollake
Toollake agents can leverage this method to:
Monitor API health and error rates in real time
Trigger alerts based on custom thresholds
Optimize routing or performance decisions dynamically
🔐 Security Tip
Never hard-code your API key in production. Use secure storage solutions like environment variables or secrets managers.
Last updated