-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
DataDog shows spend metrics #14555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataDog shows spend metrics #14555
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
can you fix this test? @mubashir1osmani |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import json | ||
from datetime import datetime, date | ||
|
||
def custom_json_encoder(obj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bad idea - we already have safe_dumps in the codebase
# Get response cost for litellm_spend_metric | ||
response_cost = standard_logging_payload.get("response_cost", 0.0) | ||
if response_cost > 0: | ||
spend_metrics["litellm_spend_metric"] = response_cost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is confusing to ready. response_cost should get sent as response_cost
metadata = standard_logging_payload.get("metadata", {}) | ||
|
||
# API key max budget | ||
user_api_key_max_budget = metadata.get("user_api_key_max_budget") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we must send user_api_key_spend too
thx @ishaan-jaff changes made ![]() ![]() ![]() |
Title
Added these metrics in datadog logging
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature