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:- Point your Prometheus collector at the Agent Server
/metricsendpoint (for example,https://<agent-server-host>/metrics). - Use the default
format=prometheusquery parameter (or omit it).
Datadog
To push internal metrics to Datadog instead of (or alongside) Prometheus:- Set
LSD_DD_API_KEYto your Datadog API key.DATADOG_METRICS_ENABLEDturns on automatically when the key is present. - Optionally set
LSD_DD_ENDPOINT(default:otlp.us5.datadoghq.com) or the legacy aliasCUSTOM_LSD_DD_API_KEY/CUSTOM_LSD_DD_ENDPOINT.
/metrics for Deployment UI metrics in Prometheus or Grafana.
Deployment UI metrics
These metrics havelsd_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 havelsd_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
- Self-hosted overview
- Configure Agent Server for scale
- Troubleshooting for self-hosted deployments
- Agent Server changelog
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

