LogoLogo
  • 👋Welcome to Groclake
  • ⏩Jump right in
  • 🗣️Introduction to Groclake
  • 🧠High level Concepts
    • Agent Discovery
    • Agent Registry
    • Agent Communication
      • Agent Text Transfer Protocol - ATTP
    • Agent Security
      • Agent Private Cloud - APC
      • Authentication & Encryption
      • Zero Trust Policy
  • 💽Installation & Guide
  • 🏗️Groclake Use Cases
  • 📰Groclake Records
  • Example Codes
  • GrocAgent
    • What is GrocAgent?
    • Example Chat Agent
    • Reflections in GrocAgent
      • Workflow of Reflection Handler
  • Lakes
    • 💾Data & Model Management
      • Datalake
        • Create Datalake
        • Retrieve Document
        • Upload Documents
        • Datalake Connections
          • Snowflake integration
      • Vectorlake
        • Creating vector
        • Generating Vector
        • Pushing Vector
        • Retrieve Document
        • Searching Vector
      • Modellake
        • Create Modellake
        • Language Translation
        • Conversation AI
        • Text to Speech
        • Chat Completion
      • Knowledgelake
        • Create Knowledge Base
        • Push Documents from a URL
        • Push Documents from Local Storage
        • Searching for Information
    • ⚒️Tool Management & Gateway
      • Toollake
        • Tools
        • Salesforce CRM Integration
        • Slack Communication Module
        • New Relic Integration
        • Google Calendar Integration
          • Check Slot Availability
          • Get Available Slots
          • Delete Event
          • Create new event
          • Create new calendar event
    • 🤖Agent Management & Deployment
      • Agentlake
        • Register your agent
        • Fetch agent details & categories
        • Create Agent Private Cloud (APC)
        • Assign Agent Private Cloud (APC) to an Agent
      • Promptlake
        • Setting Connection & Initializing
        • Storing a Prompt
        • Fetching a Prompt
        • Example API Calls
      • Memorylake
        • Context Component Examples
        • Value Structure
        • Setup & Guide
        • Storing & Retrieving Memory
        • Wildcard Search
        • Updating Memory Quality
    • 🗃️Index Stores
      • Cataloglake
        • Create catalog
        • Generate Product Data
        • Fetch Catalog Data
        • Push Product Data
        • Optimize Data Retrieval with Catalog Caching
        • Search for Products
        • Filter Product Search
        • Update Product Data
        • Recommend Products Based on Product Name
        • Update Inventory in Catalog
        • Fetch Inventory Details from Catalog
        • Fetch Product Price
        • Update Product Price in Catalog
        • Cache Image in Catalog
        • Sync Your Catalog with external ecomm platforms
        • Deleting items
        • Address Parsing and Intent Extraction
        • Creating Mapper
        • Convert Mapper's Metadata
        • Fetching Mapper
        • Updating Mapper
        • Example use case of Cataloglake
      • Joblake
        • Joblake Mapping
        • Creating a Joblake
      • Resumelake
        • Resumelake Mapping
        • Creating a Resumelake
Powered by GitBook
On this page
  1. Lakes
  2. Tool Management & Gateway
  3. Toollake

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:

      SELECT percentage(count(*), WHERE httpResponseCode = '5%') AS 'http500_percentage', 
             percentage(count(*), WHERE httpResponseCode = '4%') AS 'http400_percentage', 
             count(*) AS 'total_requests' 
      FROM Transaction 
      SINCE 60 minutes ago

Returns

  • dict: A structured JSON response containing query results.


✅ Example Usage

from apm.newrelic import Newrelic

api_key = "NRAK-XXXXXXXXXXXXXX"  # Replace with your secure API key
account_id = "1234567"           # Replace with your account ID

nr = Newrelic(api_key, account_id)

nrql_query = """
SELECT percentage(count(*), WHERE httpResponseCode = '5%') AS 'http500_percentage', 
       percentage(count(*), WHERE httpResponseCode = '4%') AS 'http400_percentage', 
       count(*) AS 'total_requests' 
FROM Transaction 
SINCE 60 minutes ago
"""

print("Executing NRQL Query:")
print(nr.execute_nrql(nrql_query))

📈 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.

PreviousSlack Communication ModuleNextGoogle Calendar Integration

Last updated 1 month ago

⚒️