Skip to main content

Observability & Telemetry

MeetLoyd implements OpenTelemetry (OTel) for standardized observability of AI agent executions, providing distributed tracing and metrics following industry-standard semantic conventions.

Overview

The telemetry system provides:

  • Distributed Tracing: Track requests across agent executions, LLM calls, and tool invocations
  • Metrics Collection: Counters and histograms for executions, tokens, latency, and costs
  • Gen AI Semantic Conventions: Industry-standard gen_ai.* attributes for LLM observability
  • OTLP Export: Compatible with any OpenTelemetry-compatible backend

Architecture

The telemetry pipeline flows from the MeetLoyd platform (agent execution spans, LLM call spans, tool execution spans) through the OpenTelemetry SDK (BatchSpanProcessor, MetricReader) to the OTLP/HTTP Exporter, which delivers data to your observability backend (Grafana, Honeycomb, Datadog, Jaeger, etc.).

Traced Operations

Agent Execution Spans

Root spans created for each agent execution:

AttributeDescription
gen_ai.agent.idUnique agent identifier
gen_ai.agent.nameHuman-readable agent name
gen_ai.request.modelLLM model used
gen_ai.provider.nameProvider (anthropic, openai, etc.)
meetloyd.tenant.idTenant identifier
meetloyd.user.idUser who triggered execution

LLM Call Spans

Child spans for each LLM API call:

AttributeDescription
gen_ai.operation.nameOperation type (chat, completion)
gen_ai.request.modelModel requested
gen_ai.request.max_tokensMax tokens parameter
gen_ai.request.temperatureTemperature parameter
gen_ai.usage.input_tokensInput tokens consumed
gen_ai.usage.output_tokensOutput tokens generated
gen_ai.response.idProvider response ID
gen_ai.response.finish_reasonsWhy generation stopped

Tool Execution Spans

Child spans for each tool invocation:

AttributeDescription
gen_ai.tool.nameTool identifier
gen_ai.tool.call.idUnique call identifier
gen_ai.tool.typeTool type (builtin, custom)

Metrics

Counters

MetricDescription
gen_ai.agent.executionsTotal agent executions
gen_ai.llm.callsTotal LLM API calls
gen_ai.tool.callsTotal tool invocations
gen_ai.tokens.inputTotal input tokens
gen_ai.tokens.outputTotal output tokens
gen_ai.errorsTotal errors by type

Histograms

MetricDescription
gen_ai.agent.durationExecution duration (ms)
gen_ai.llm.latencyLLM call latency (ms)
gen_ai.tool.latencyTool execution latency (ms)
gen_ai.cost.usdExecution cost (USD)
gen_ai.tokens.per_executionTokens per execution

Supported Backends

MeetLoyd's OTLP export is compatible with:

BackendNotes
Grafana Cloud (Recommended)Fully managed, generous free tier, cloud-agnostic
HoneycombTrace-first observability
DatadogFull-stack monitoring
AxiomLog analytics
AWS X-RayVia OpenTelemetry Collector
Azure MonitorVia Azure Monitor Exporter
Google Cloud TraceVia GCP exporter
Any OTLP-compatible collectorUniversal

Configuration

OpenTelemetry is disabled by default. To enable, configure these environment variables:

VariableDescriptionRequired
OTEL_ENABLEDSet to "true" to enable telemetryYes
OTEL_EXPORTER_OTLP_ENDPOINTYour backend's OTLP endpoint URLYes (when enabled)
OTEL_EXPORTER_OTLP_HEADERSAuthentication headers (e.g., "Authorization=Basic ...")Depends on backend
OTEL_SERVICE_NAMEService name (default: "meetloyd")No
OTEL_SERVICE_VERSIONService versionNo
OTEL_SAMPLE_RATESampling rate 0.0-1.0 (default: 1.0, use 0.1 for high-volume production)No
OTEL_CONSOLE_EXPORTSet to "true" for console debugging (development only)No

Enterprise Cloud Deployment

  1. Create a Grafana Cloud account at grafana.com
  2. Navigate to Connections > Add new connection > OpenTelemetry (OTLP)
  3. Generate an API token with metrics:write and traces:write scopes
  4. Set OTEL_EXPORTER_OTLP_ENDPOINT to your Grafana OTLP gateway URL
  5. Set OTEL_EXPORTER_OTLP_HEADERS with your Base64-encoded credentials
  6. Features: Trace explorer with gen_ai attribute filtering, pre-built LLM dashboards, alerting, 50 GB free tier

AWS

Option 1: ADOT + X-Ray -- Deploy the AWS Distro for OpenTelemetry Collector as a sidecar or daemon. Point OTEL_EXPORTER_OTLP_ENDPOINT to the local collector. Traces go to X-Ray, metrics to CloudWatch.

Option 2: Direct to Grafana Cloud -- Point OTEL_EXPORTER_OTLP_ENDPOINT directly to Grafana Cloud from your AWS deployment.

Azure

Option 1: Azure Monitor Application Insights -- Azure Monitor supports OTLP ingestion directly. Use the Application Insights endpoint and instrumentation key.

Option 2: OpenTelemetry Collector -- Deploy the OTel Collector with Azure Monitor exporter in AKS or Container Apps.

Google Cloud Platform

Option 1: Cloud Trace Direct Export -- Point to Cloud Trace endpoint with service account credentials.

Option 2: OpenTelemetry Collector -- Deploy on GKE or Cloud Run with the Google Cloud exporter.

Multi-Cloud / Hybrid

For multi-cloud deployments, use Grafana Cloud as the centralized backend with OpenTelemetry Collectors deployed in each cloud. The same configuration works everywhere.

Security Considerations

What's Captured

Telemetry data includes agent and user identifiers, model names and parameters, token counts and costs, and execution timing.

What's NOT Captured

Telemetry does not contain prompt content or responses, user messages, tool input/output data, or PII/sensitive business data.

Network Security

All OTLP exports use HTTPS. Authentication headers are supported. No data is exported when telemetry is disabled.

Compliance

OpenTelemetry supports SOC 2 (audit trail of AI operations), ISO 27001 (monitoring and incident detection), and GDPR (no PII in telemetry data by design).

Graceful Degradation

When telemetry is disabled or misconfigured, all tracing functions return no-ops with zero performance overhead. The application continues normally. A warning is logged if telemetry is enabled without an endpoint.

Additional Observability

Beyond OpenTelemetry, MeetLoyd provides:

  • Structured Logging: Pino-based JSON logs with correlation IDs
  • Chain of Thought Logging: Full reasoning capture in database
  • Agent Run Tracking: Execution history in the agent runs table
  • Audit Logs: Security-relevant events for compliance

See Audit Logs and SIEM Integration for more.