Supported OS Linux Windows Mac OS

インテグレーションのバージョン2.6.0

To find out if this integration is available in your organization, see your Datadog Integrations page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email support@ddog-gov.com.

このページは日本語には対応しておりません。随時翻訳に取り組んでいます。
翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください。

Overview

Monitor, troubleshoot, and evaluate your LLM-powered applications built using LiteLLM: a lightweight, open-source proxy and analytics layer for large language model (LLM) APIs. It enables unified access, observability, and cost control across multiple LLM providers.

Use LLM Observability to investigate the root cause of issues, monitor operational performance, and evaluate the quality, privacy, and safety of your LLM applications.

See the LLM Observability tracing view video for an example of how you can investigate a trace.

Get cost estimation, prompt and completion sampling, error tracking, performance metrics, and more out of LiteLLM Python library requests using Datadog metrics and APM.

Key metrics such as request/response counts, latency, error rates, token usage, and spend per provider or deployment are monitored. This data enables customers to track usage patterns, detect anomalies, control costs, and troubleshoot issues quickly, ensuring efficient and reliable LLM operations through LiteLLM’s health check and Prometheus endpoints.

Minimum Agent version: 7.68.0

Setup

You can configure this integration either as a standalone integration with LLM Observability, or as an agent check.

Use it as an integration with LLM Observability to:

  • Monitor LLM agents and applications that use LiteLLM
  • Debug and troubleshoot every single operation, including calls to LiteLLM
  • See contextual visibility across prompt, model or provider selection, latency, error, token usage and cost, and more

Use it as an agent check to:

  • Monitor the LiteLLM proxy service itself directly at the infrastructure level
  • Capture metrics like request volume, latency, error and fallback rates, token usage, and costs for the LiteLLM service
  • Support platform and SREs to ensure overall reliability of LiteLLM deployment

Get end-to-end visibility into your LLM application using LiteLLM.

When you run your LLM application with the LLM Observability SDK, LiteLLM and other integrations are enabled by default, so no further configuration is required. See Automatic Instrumentation for LLM Observability for details on automatic tracing provided by the LiteLLM integration.

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the Autodiscovery Integration Templates for guidance on applying these instructions.

Installation

Starting from Agent 7.68.0, the LiteLLM check is included in the Datadog Agent package. No additional installation is needed on your server.

Configuration

This integration collects metrics through the Prometheus endpoint exposed by the LiteLLM Proxy. By default, the metrics are exposed on the /metrics endpoint. If connecting locally, the default port is 4000. For more information, see the LiteLLM Prometheus documentation.

Note: The listed metrics can only be collected if they are available. Some metrics are generated only when certain actions are performed. For example, the litellm.auth.failed_requests.count metric might only be exposed after an authentication failed request has occurred.

Host-based

  1. Edit the litellm.d/conf.yaml file in the conf.d/ folder at the root of your Agent’s configuration directory to start collecting your LiteLLM performance data. See the sample litellm.d/conf.yaml for all available configuration options. Example config:

    init_config:
    
    instances:
      - openmetrics_endpoint: http://localhost:4000/metrics
        # If authorization is required to access the endpoint, use the settings below.
        # headers:
        #  Authorization: Bearer sk-1234
    
  2. Restart the Agent.

Kubernetes-based

For LiteLLM Proxy running on Kubernetes, choose one of the following Autodiscovery configurations:

Kubernetes annotations
apiVersion: v1
kind: Pod
# (...)
metadata:
  name: '<POD_NAME>'
  annotations:
    ad.datadoghq.com/<CONTAINER_NAME>.checks: | # <CONTAINER_NAME> must match the container name specified in the containers section below.
      {
        "litellm": {
          "init_config": {},
          "instances": [
            {
              "openmetrics_endpoint": "http://%%host%%:4000/metrics"
            }
          ]
        }
      }
    # (...)
spec:
  containers:
    - name: <CONTAINER_NAME>
# (...)
DatadogInstrumentation CRD
apiVersion: datadoghq.com/v1alpha1
kind: DatadogInstrumentation
metadata:
  name: <CR_NAME>
  namespace: <WORKLOAD_NAMESPACE>
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment # Or another target kind, if applicable.
    name: <LITELLM_WORKLOAD_NAME>
  config:
    checks:
      - integration: litellm
        containerName: litellm
        initConfig: {}
        instances:
          - openmetrics_endpoint: "http://%%host%%:4000/metrics"

For setup details, see Configure Autodiscovery with the DatadogInstrumentation CRD.

For more information and alternative ways to configure the check in Kubernetes-based environments, see the Kubernetes Integration Setup documentation.

Logs

LiteLLM can send logs to Datadog through its callback system. You can configure various logging settings in LiteLLM to customize log formatting and delivery to Datadog for ingestion. For detailed configuration options and setup instructions, refer to the LiteLLM Logging Documentation.

Validation

Run the Agent’s status subcommand (see documentation) and look for litellm under the Checks section.

Data Collected

Metrics

litellm.active_users
(gauge)
Number of billable users in LiteLLM (excludes SCIM-deactivated users)
Shown as user
litellm.api.key.budget.remaining_hours.metric
(gauge)
Remaining hours for api key budget to be reset
Shown as hour
litellm.api.key.max_budget.metric
(gauge)
Maximum budget set for api key
litellm.auth.failed_requests.count
(count)
Number of failed requests for auth service in the time period
Shown as error
litellm.auth.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for auth service
litellm.auth.latency.count
(count)
Number of latency observations for auth service in the time period
litellm.auth.latency.sum
(count)
Latency for auth service
Shown as millisecond
litellm.auth.total_requests.count
(count)
Number of requests for auth service in the time period
Shown as request
litellm.batch_write_to_db.failed_requests.count
(count)
Number of failed requests for batch_write_to_db service in the time period
Shown as error
litellm.batch_write_to_db.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for batch_write_to_db service
litellm.batch_write_to_db.latency.count
(count)
Number of latency observations for batch_write_to_db service in the time period
litellm.batch_write_to_db.latency.sum
(count)
Latency for batch_write_to_db service
Shown as millisecond
litellm.batch_write_to_db.total_requests.count
(count)
Number of requests for batch_write_to_db service in the time period
Shown as request
litellm.cache.hits.metric.count
(count)
Total number of LiteLLM cache hits
litellm.cache.misses.metric.count
(count)
Total number of LiteLLM cache misses
litellm.cached_tokens.metric.count
(count)
Total tokens served from LiteLLM cache
Shown as token
litellm.callback.logging_failures.metric.count
(count)
Total number of failures when emitting logs to callbacks (e.g. s3_v2, langfuse, etc)
litellm.check_batch_cost.errors.count
(count)
Total number of errors in CheckBatchCost by error type
litellm.check_batch_cost.jobs_polled
(gauge)
Number of unprocessed batches found by the last CheckBatchCost poll
litellm.check_batch_cost.jobs_processed.count
(count)
Total number of batches successfully cost-tracked by CheckBatchCost
litellm.check_batch_cost.last_run_timestamp
(gauge)
Unix timestamp of the last CheckBatchCost job run
Shown as second
litellm.deployment.cooled_down.count
(count)
Number of times a deployment has been cooled down by LiteLLM load balancing logic in the time period. exception_status is the status of the exception that caused the deployment to be cooled down
Shown as event
litellm.deployment.failed_fallbacks.count
(count)
Number of failed fallback requests from primary model -> fallback model in the time period
Shown as error
litellm.deployment.failure_by_tag_responses.count
(count)
Number of failed LLM API calls for a specific LLM deployment by custom metadata tags in the time period
Shown as error
litellm.deployment.failure_responses.count
(count)
Number of failed LLM API calls for a specific LLM deployment in the time period. exception_status is the status of the exception from the LLM API
Shown as error
litellm.deployment.latency_per_output_token.bucket
(count)
Number of observations that fall into each upper_bound latency per output token bucket for deployment
litellm.deployment.latency_per_output_token.count
(count)
Number of latency per output token observations for deployment in the time period
litellm.deployment.latency_per_output_token.sum
(count)
Latency per output token
Shown as millisecond
litellm.deployment.rpm_limit
(gauge)
Deployment RPM limit found in config
litellm.deployment.state
(gauge)
The state of the deployment: 0 = healthy,1 = partial outage,2 = complete outage
Shown as unit
litellm.deployment.success_responses.count
(count)
Number of successful LLM API calls via litellm in the time period
Shown as response
litellm.deployment.successful_fallbacks.count
(count)
Number of successful fallback requests from primary model -> fallback model in the time period
Shown as response
litellm.deployment.total_requests.count
(count)
Number of LLM API calls via litellm in the time period - success + failure
Shown as request
litellm.deployment.tpm_limit
(gauge)
Deployment TPM limit found in config
litellm.guardrail.errors.count
(count)
Total number of errors encountered during guardrail execution
litellm.guardrail.latency_seconds.bucket
(count)
Number of observations that fall into each upper_bound bucket for latency (seconds) for guardrail execution
litellm.guardrail.latency_seconds.count
(count)
Number of observations for latency (seconds) for guardrail execution in the time period
litellm.guardrail.latency_seconds.sum
(count)
Latency (seconds) for guardrail execution
Shown as second
litellm.guardrail.requests.count
(count)
Total number of guardrail invocations
litellm.images_generated.metric.count
(count)
Number of images generated, from the image generation response
litellm.in_flight_requests
(gauge)
Number of HTTP requests currently in-flight on this uvicorn worker
litellm.in_memory.daily_spend_update_queue.size
(gauge)
Gauge for in_memory_daily_spend_update_queue service
Shown as item
litellm.in_memory.spend_update_queue.size
(gauge)
Gauge for in_memory_spend_update_queue service
Shown as item
litellm.input.tokens.count
(count)
Number of input tokens from LLM requests in the time period
Shown as token
litellm.input_audio_tokens.metric.count
(count)
Audio input tokens reported in prompt_tokens_details.audio_tokens
Shown as token
litellm.input_cache_creation_tokens.metric.count
(count)
Provider-side input tokens written to prompt cache (e.g. Anthropic cache_creation_input_tokens)
Shown as token
litellm.input_cached_tokens.metric.count
(count)
Provider-side cached input tokens (e.g. OpenAI prompt_tokens_details.cached_tokens, Anthropic cache_read_input_tokens)
Shown as token
litellm.input_tokens.metric.count
(count)
Total number of input tokens from LLM requests
Shown as token
litellm.llm.api.failed_requests.metric.count
(count)
Deprecated - use litellm.proxy.failed_requests.metric. Number of failed responses from proxy in the time period - the client did not get a success response from litellm proxy
Shown as error
litellm.llm.api.latency.metric.bucket
(count)
Number of observations that fall into each upper_bound latency bucket (seconds) for a model’s LLM API call
litellm.llm.api.latency.metric.count
(count)
Number of latency observations (seconds) for a model’s LLM API call in the time period
litellm.llm.api.latency.metric.sum
(count)
Total latency (seconds) for a model’s LLM API call
Shown as second
litellm.llm.api.time_to_first_token.metric.bucket
(count)
Number of observations that fall into each upper_bound time to first token bucket for a model’s LLM API call
litellm.llm.api.time_to_first_token.metric.count
(count)
Number of time to first token observations for a model’s LLM API call in the time period
litellm.llm.api.time_to_first_token.metric.sum
(count)
Time to first token for a model’s LLM API call
Shown as second
litellm.managed.batch_created.count
(count)
Total number of managed batches created
litellm.managed.batch_duration_seconds.bucket
(count)
Number of observations that fall into each upper_bound bucket for duration of completed managed batches in seconds (completed_at - created_at)
litellm.managed.batch_duration_seconds.count
(count)
Number of observations for duration of completed managed batches in seconds (completed_at - created_at) in the time period
litellm.managed.batch_duration_seconds.sum
(count)
Duration of completed managed batches in seconds (completed_at - created_at)
Shown as second
litellm.managed.file_created.count
(count)
Total number of managed files created
litellm.managed.file_deleted.count
(count)
Total number of managed file deletions (success or blocked)
litellm.managed.file_size_bytes
(gauge)
Size of the most recent managed batch file in bytes (last-seen value per label combination)
Shown as byte
litellm.mcp.tool_call_spend.metric.count
(count)
Total spend on MCP tool calls, segmented by tool and server name
litellm.mcp.tool_calls.count
(count)
Total MCP tool calls, segmented by tool and server name
litellm.org.budget.remaining_hours.metric
(gauge)
Remaining hours for org budget to be reset
Shown as hour
litellm.org.max_budget.metric
(gauge)
Maximum budget set for org
litellm.output.tokens.count
(count)
Number of output tokens from LLM requests in the time period
Shown as token
litellm.output_audio_tokens.metric.count
(count)
Audio output tokens reported in completion_tokens_details.audio_tokens
Shown as token
litellm.output_reasoning_tokens.metric.count
(count)
Reasoning tokens reported in completion_tokens_details.reasoning_tokens
Shown as token
litellm.output_tokens.metric.count
(count)
Total number of output tokens from LLM requests
Shown as token
litellm.overhead_latency.metric.bucket
(count)
Number of observations that fall into each upper_bound overhead latency bucket (milliseconds) added by LiteLLM processing
litellm.overhead_latency.metric.count
(count)
Number of overhead latency observations (milliseconds) added by LiteLLM processing in the time period
litellm.overhead_latency.metric.sum
(count)
Latency overhead (milliseconds) added by LiteLLM processing
Shown as millisecond
litellm.overhead_with_guardrails_latency.metric.bucket
(count)
Number of observations that fall into each upper_bound bucket for total internal latency (seconds) added by LiteLLM, including pre/post-call guardrails (excludes the LLM API call)
litellm.overhead_with_guardrails_latency.metric.count
(count)
Number of observations for total internal latency (seconds) added by LiteLLM, including pre/post-call guardrails (excludes the LLM API call) in the time period
litellm.overhead_with_guardrails_latency.metric.sum
(count)
Total internal latency (seconds) added by LiteLLM, including pre/post-call guardrails (excludes the LLM API call)
Shown as second
litellm.pod_lock_manager.size
(gauge)
Gauge for pod_lock_manager service
Shown as item
litellm.postgres.failed_requests.count
(count)
Number of failed requests for Postgres service in the time period
Shown as error
litellm.postgres.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for Postgres service
litellm.postgres.latency.count
(count)
Number of latency observations for Postgres service in the time period
litellm.postgres.latency.sum
(count)
Latency for Postgres service
Shown as millisecond
litellm.postgres.total_requests.count
(count)
Number of requests for Postgres service in the time period
Shown as request
litellm.process.uptime.seconds
(gauge)
Start time of the process since unix epoch in seconds.
Shown as second
litellm.provider.remaining_budget.metric
(gauge)
Remaining budget for provider - used when you set provider budget limits
litellm.provider_cache.creation_input_tokens.metric.count
(count)
Total prompt/input tokens written to provider prompt cache (e.g. Anthropic/Bedrock)
Shown as token
litellm.provider_cache.read_input_tokens.metric.count
(count)
Total prompt/input tokens read from provider prompt cache (e.g. OpenAI/Anthropic/Gemini/Bedrock)
Shown as token
litellm.proxy.failed_requests.metric.count
(count)
Number of failed responses from proxy in the time period - the client did not get a success response from litellm proxy
Shown as error
litellm.proxy.pre_call.failed_requests.count
(count)
Number of failed requests for proxy_pre_call service in the time period
Shown as error
litellm.proxy.pre_call.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for proxy_pre_call service
litellm.proxy.pre_call.latency.count
(count)
Number of latency observations for proxy_pre_call service in the time period
litellm.proxy.pre_call.latency.sum
(count)
Latency for proxy_pre_call service
Shown as millisecond
litellm.proxy.pre_call.total_requests.count
(count)
Number of requests for proxy_pre_call service in the time period
Shown as request
litellm.proxy.total_requests.metric.count
(count)
Number of requests made to the proxy server in the time period - track number of client side requests
Shown as request
litellm.redis.daily_agent_spend_update_queue.size
(gauge)
Number of pending daily agent spend updates in the Redis queue waiting to be written to the database
Shown as item
litellm.redis.daily_end_user_spend_update_queue.size
(gauge)
Number of pending daily end user spend updates in the Redis queue waiting to be written to the database
Shown as item
litellm.redis.daily_spend_update_queue.size
(gauge)
Gauge for redis_daily_spend_update_queue service
Shown as item
litellm.redis.daily_tag_spend_update_queue.failed_requests.count
(count)
Number of failed requests for redis_daily_tag_spend_update_queue service in the time period
Shown as error
litellm.redis.daily_tag_spend_update_queue.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for redis_daily_tag_spend_update_queue service
litellm.redis.daily_tag_spend_update_queue.latency.count
(count)
Number of latency observations for redis_daily_tag_spend_update_queue service in the time period
litellm.redis.daily_tag_spend_update_queue.latency.sum
(count)
Latency for redis_daily_tag_spend_update_queue service
Shown as millisecond
litellm.redis.daily_tag_spend_update_queue.total_requests.count
(count)
Number of requests for redis_daily_tag_spend_update_queue service in the time period
Shown as request
litellm.redis.daily_team_spend_update_queue.failed_requests.count
(count)
Number of failed requests for redis_daily_team_spend_update_queue service in the time period
Shown as error
litellm.redis.daily_team_spend_update_queue.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for redis_daily_team_spend_update_queue service
litellm.redis.daily_team_spend_update_queue.latency.count
(count)
Number of latency observations for redis_daily_team_spend_update_queue service in the time period
litellm.redis.daily_team_spend_update_queue.latency.sum
(count)
Latency for redis_daily_team_spend_update_queue service
Shown as millisecond
litellm.redis.daily_team_spend_update_queue.total_requests.count
(count)
Number of requests for redis_daily_team_spend_update_queue service in the time period
Shown as request
litellm.redis.failed_requests.count
(count)
Number of failed requests for Redis service in the time period
Shown as error
litellm.redis.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for Redis service
litellm.redis.latency.count
(count)
Number of latency observations for Redis service in the time period
litellm.redis.latency.sum
(count)
Total latency (milliseconds) for Redis service
Shown as millisecond
litellm.redis.spend_update_queue.size
(gauge)
Gauge for redis_spend_update_queue service
Shown as item
litellm.redis.total_requests.count
(count)
Number of requests for Redis service in the time period
Shown as request
litellm.remaining.api_key.budget.metric
(gauge)
Remaining budget for api key
litellm.remaining.api_key.requests_for_model
(gauge)
Remaining requests API Key can make for model (model based rpm limit on key)
Shown as request
litellm.remaining.api_key.tokens_for_model
(gauge)
Remaining tokens API Key can make for model (model based tpm limit on key)
Shown as token
litellm.remaining.org_budget.metric
(gauge)
Remaining budget for org
litellm.remaining.requests
(gauge)
Remaining requests for model, returned from LLM API Provider
Shown as request
litellm.remaining.team_budget.metric
(gauge)
Remaining budget for team
litellm.remaining.user_budget.metric
(gauge)
Remaining budget for user
litellm.remaining_requests.metric
(gauge)
Track x-ratelimit-remaining-requests returned from LLM API Deployment
Shown as request
litellm.remaining_tokens
(gauge)
Remaining tokens for model, returned from LLM API Provider
Shown as token
litellm.remaining_tokens.metric
(gauge)
Remaining tokens for model, returned from LLM API Provider
Shown as token
litellm.request.queue_time_seconds.bucket
(count)
Number of observations that fall into each upper_bound bucket for time spent in request queue before processing starts (seconds)
litellm.request.queue_time_seconds.count
(count)
Number of observations for time spent in request queue before processing starts (seconds) in the time period
litellm.request.queue_time_seconds.sum
(count)
Time spent in request queue before processing starts (seconds)
Shown as second
litellm.request.total_latency.metric.bucket
(count)
Number of observations that fall into each upper_bound total latency bucket (seconds) for a request to LiteLLM
litellm.request.total_latency.metric.count
(count)
Number of total latency observations (seconds) for a request to LiteLLM in the time period
litellm.request.total_latency.metric.sum
(count)
Total latency (seconds) for a request to LiteLLM
Shown as second
litellm.requests.metric.count
(count)
Deprecated - use litellm.proxy.total_requests.metric.count. Number of LLM calls to litellm in the time period - track total per API Key, team, user
Shown as request
litellm.reset_budget_job.failed_requests.count
(count)
Number of failed requests for reset_budget_job service in the time period
Shown as error
litellm.reset_budget_job.latency.bucket
(count)
Latency for reset_budget_job service
litellm.reset_budget_job.total_requests.count
(count)
Number of requests for reset_budget_job service in the time period
Shown as request
litellm.router.failed_requests.count
(count)
Number of failed requests for router service in the time period
Shown as error
litellm.router.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for router service
litellm.router.latency.count
(count)
Number of latency observations for router service in the time period
litellm.router.latency.sum
(count)
Latency for router service
Shown as millisecond
litellm.router.total_requests.count
(count)
Number of requests for router service in the time period
Shown as request
litellm.self.failed_requests.count
(count)
Number of failed requests for self service in the time period
Shown as error
litellm.self.latency.bucket
(count)
Number of observations that fall into each upper_bound latency bucket for self service
litellm.self.latency.count
(count)
Number of latency observations for self service in the time period
litellm.self.latency.sum
(count)
Latency for self service
Shown as millisecond
litellm.self.total_requests.count
(count)
Number of requests for self service in the time period
Shown as request
litellm.spend.metric.count
(count)
Spend on LLM requests in the time period
litellm.team.budget.remaining_hours.metric
(gauge)
Remaining hours for team budget to be reset
Shown as hour
litellm.team.max_budget.metric
(gauge)
Maximum budget set for team
litellm.team.members.metric
(gauge)
Number of members in a team
litellm.teams_count
(gauge)
Total number of teams in LiteLLM
litellm.total.tokens.count
(count)
Number of input + output tokens from LLM requests in the time period
Shown as token
litellm.total_users
(gauge)
Total number of users in LiteLLM
Shown as user
litellm.user.budget.remaining_hours.metric
(gauge)
Remaining hours for user budget to be reset
Shown as hour
litellm.user.max_budget.metric
(gauge)
Maximum budget set for user
litellm.video_duration_seconds.metric.count
(count)
Seconds of video generated, from usage.duration_seconds on video generation calls
Shown as second

Events

The LiteLLM integration does not include any events.

Service Checks

litellm.openmetrics.health

Returns CRITICAL if the Agent is unable to connect to the LiteLLM OpenMetrics endpoint, otherwise returns OK.

Statuses: ok, critical

Troubleshooting

Need help? Contact Datadog support.