fix: req changes

This commit is contained in:
Harshit Jain 2026-02-26 11:45:28 +05:30
parent e09a571a8b
commit 218383f739
No known key found for this signature in database
GPG key ID: 36C392CD4415B4CF
3 changed files with 14 additions and 3 deletions

View file

@ -150,6 +150,7 @@ class DatadogMetricsLogger(CustomBatchLogger):
"type": 1, # count
"points": [{"timestamp": timestamp, "value": 1.0}],
"tags": tags,
"interval": self.flush_interval,
}
self.log_queue.append(series_count)

View file

@ -285,8 +285,17 @@ async def health_services_endpoint( # noqa: PLR0915
from litellm.integrations.datadog.datadog_metrics import (
DatadogMetricsLogger,
)
from litellm.litellm_core_utils.litellm_logging import (
get_custom_logger_compatible_class,
)
datadog_metrics_logger = DatadogMetricsLogger(start_periodic_flush=False)
datadog_metrics_logger = get_custom_logger_compatible_class(
"datadog_metrics"
)
if datadog_metrics_logger is None:
datadog_metrics_logger = DatadogMetricsLogger(
start_periodic_flush=False
)
response = await datadog_metrics_logger.async_health_check()
return {
"status": response["status"],

View file

@ -1,4 +1,4 @@
from typing import List
from typing import List, Optional
from typing_extensions import TypedDict
@ -8,11 +8,12 @@ class DatadogMetricPoint(TypedDict):
value: float # The metric value
class DatadogMetricSeries(TypedDict):
class DatadogMetricSeries(TypedDict, total=False):
metric: str
type: int # 0=unspecified, 1=count, 2=rate, 3=gauge
points: List[DatadogMetricPoint]
tags: List[str]
interval: Optional[int] # Required for count (type=1) and rate (type=2) metrics
class DatadogMetricsPayload(TypedDict):