Skip to main content
Dome is OpenTelemetry-compliant and integrates with popular observability platforms. This guide covers tracing, metrics, and logging setup.

Quick Setup

Install the OpenTelemetry support version of Dome using pip or your package manager.

LLM Tracing Platforms

Weights & Biases Weave

Weave is W&B’s toolkit for tracing LLM applications. You can use it with Dome to trace all inputs and outputs by wrapping Dome with Weave. In your Weave dashboard, you’ll see:
  • All guard_input and guard_output calls
  • Individual guard execution within each guardrail
  • Detector-level details for each guard

AgentOps

AgentOps provides agent-focused observability. Initialize AgentOps and apply its tracking to the Dome instance.

OpenTelemetry Integration

Dome works with any OpenTelemetry-compliant platform (Jaeger, Uptrace, Signoz, etc.).

Basic Setup

You can instrument Dome with your tracer, meter, and handlers configuration via Dome’s instrument method.

Full Example with Jaeger

Specify your tracer provider and inject it into Dome’s instrument method. All guard calls will then create spans in Jaeger.

Tracing

When instrumented with a tracer, Dome creates spans for:
  • Guardrail execution: Top-level span for guard_input / guard_output
  • Guard execution: Nested span for each guard in the guardrail
  • Detector execution: Nested span for each detector in the guard
Each span includes:
  • Input and output data
  • Execution time
  • Error information (if any)
  • Whether content was flagged

Span Hierarchy

guard_input
├── security-guard
│   ├── prompt-injection-mbert
│   └── encoding-heuristics
└── moderation-guard
    └── moderation-flashtext

Metrics

When instrumented with a meter, Dome automatically tracks:
MetricDescription
requestsTotal requests to each component
flaggedRequests flagged by each component
errorsErrors encountered
latencyExecution time

Metric Naming

Metrics follow the pattern: [guardrail].[guard].[detector].[metric] Examples:
  • input_guardrail.security_guard.requests
  • input_guardrail.security_guard.prompt_injection_mbert.flagged
  • output_guardrail.latency

Example: Prometheus

You can export metrics from Dome to Prometheus by supplying a Prometheus metric reader and meter.

Logging

Dome logs to Python loggers under vijil.dome. You can add standard handlers to capture logs.

Log Levels

LevelWhat’s Logged
DEBUGInitialization details, parameters
INFOInputs and outputs from each component
WARNINGMissing config, context window exceeded, timeouts
ERRORHandled exceptions during execution
CRITICALInitialization failures, unhandled exceptions

Structured Logging

For JSON-structured logs, define a JSON formatter in your logging setup.

Custom Metrics

You can also add and merge your own custom metrics alongside Dome’s built-in metrics using the meter provider.

Dashboard Examples

Grafana Dashboard

You can track key metrics such as Blocked Request Rate, Average Latency, and Error Rates.

Alerts

You can set up alerts for anomalies like high block rates or high latency directly in your observability solutions (e.g., Prometheus AlertManager).

Best Practices

  1. Always instrument in production: Visibility is essential for security
  2. Set appropriate log levels: Use INFO for production, DEBUG for troubleshooting
  3. Monitor block rates: Sudden increases may indicate attacks
  4. Track latency: Ensure guards don’t impact user experience
  5. Alert on errors: Guard failures should be investigated immediately

Work in Progress

The programmatic observability capabilities and integrations are currently in private preview and subject to change.

Next Steps

Configure Guardrails

Guard configuration options

Use Guardrails

Runtime integration patterns

Custom Detectors

Build custom detection methods

Protection Overview

Dome architecture overview
Last modified on April 20, 2026