Skip to main content
The Agent Server emits metrics through an OpenTelemetry (OTel) client. Metrics use the lg_api_ name prefix by default (override with METRIC_PREFIX). On self-hosted deployments, use this page to choose a scrape or push backend, enable the metric sets you need, and look up Prometheus names when building dashboards or alerts.

Metric backends

Agent Server splits metrics into two sets:
  • Deployment UI metrics: Surfaced in the LangSmith Deployment UI and exposed on the Agent Server Prometheus scrape endpoint (GET /metrics, format=prometheus) by default.
  • Internal metrics: Operational and debugging metrics used by LangChain operators. Sent to Datadog when configured. On Prometheus, internal metrics appear only when you opt in.
Prometheus and Datadog can run at the same time. Datadog receives the internal complement so UI metrics are not duplicated in both backends.

Metric tiers

Each metric is assigned a tier that controls whether internal metrics are recorded: Set METRIC_MAX_EMITTING_TIER to the highest tier you want recorded for internal metrics. Deployment UI metrics ignore this setting and always emit.

Configure export

Prometheus

To scrape Deployment UI metrics:
  1. Point your Prometheus collector at the Agent Server /metrics endpoint (for example, https://<agent-server-host>/metrics).
  2. Use the default format=prometheus query parameter (or omit it).
To also expose internal metrics on the same endpoint, set:

Datadog

To push internal metrics to Datadog instead of (or alongside) Prometheus:
  1. Set LSD_DD_API_KEY to your Datadog API key. DATADOG_METRICS_ENABLED turns on automatically when the key is present.
  2. Optionally set LSD_DD_ENDPOINT (default: otlp.us5.datadoghq.com) or the legacy alias CUSTOM_LSD_DD_API_KEY / CUSTOM_LSD_DD_ENDPOINT.
Datadog receives only internal metrics. Continue scraping /metrics for Deployment UI metrics in Prometheus or Grafana.

Deployment UI metrics

These metrics have lsd_web_metric=true. They appear on the Prometheus /metrics scrape by default and power the LangSmith Deployment UI. Tier values are listed for reference; these metrics always emit regardless of METRIC_MAX_EMITTING_TIER.

Internal metrics

These metrics have lsd_web_metric=false. By default they are exported to Datadog when LSD_DD_API_KEY is set. Set EXPOSE_INTERNAL_METRICS_PROMETHEUS=true to include them on the Prometheus /metrics scrape. Internal metrics at or below METRIC_MAX_EMITTING_TIER are recorded; higher-tier metrics are omitted.

Run lifecycle

Streaming and protocol v2

Server and infrastructure

See also