Skip to main content
Isthmus has built-in OpenTelemetry (OTel) support for distributed tracing and metrics. When enabled, every SQL query and MCP tool call emits traces and metrics to your OTel collector — Jaeger, Grafana Tempo, Datadog, Honeycomb, or any OTLP-compatible backend.

Enabling OpenTelemetry

Set the --otel CLI flag or OTEL_ENABLED environment variable:
At startup, Isthmus logs that OTel is active:

Configuring the exporter

Isthmus uses OTLP gRPC exporters for both traces and metrics. The OTel SDK reads standard environment variables to configure the exporter endpoint: These are standard OTel SDK environment variables — not Isthmus-specific. See the OTel SDK docs for the full list.

Example: local Jaeger

Then open http://localhost:16686 to see traces.

Example: Grafana Tempo + Prometheus

Example: MCP client config

Traces

Isthmus emits two types of spans:

Query spans

Every SQL query executed through the query tool creates a span: If the query fails (validation error, execution error), the error is recorded on the span.

Tool call spans

Every MCP tool call (discover, describe_table, query) creates a span: Tool call spans are parents of query spans — so a query tool call shows the full lifecycle: MCP dispatch, SQL validation, query execution, and masking.

Metrics

Isthmus exposes four metrics:

Useful queries

If your backend supports PromQL or a similar query language:

Service resource

Isthmus registers itself with the following OTel resource attributes: These appear in your tracing UI and can be used to filter traces.

Graceful shutdown

When Isthmus receives SIGTERM or SIGINT, it flushes all pending traces and metrics before exiting (with a 5-second timeout). This ensures no data is lost during graceful shutdown.

When OTel is disabled

When --otel is not set (the default), all tracing and metrics use no-op implementations. There is zero overhead — no goroutines, no allocations, no network calls. You can safely leave OTel disabled in development.

Semantic conventions

Isthmus follows the OpenTelemetry Semantic Conventions for database spans:
  • db.system = "postgresql" (database semconv)
  • db.operation.name for the operation type
  • db.statement for the SQL query
  • db.response.rows for the result size