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

A lightweight utility for querying New Relic via NRQL within Toollake.

Constructor

Newrelic(api_key: str, account_id: str)
  • 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

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