dd-trace-py icon indicating copy to clipboard operation
dd-trace-py copied to clipboard

Send custom tags when sending metrics with openai patch

Open nikos-hj opened this issue 1 year ago • 6 comments

Summary of problem

We're trying to figure out what is the proper way of passing custom tags along with the metrics of the openai patch integration. Is there any guide for this?

Which version of dd-trace-py are you using?

ddtrace==2.10.1

nikos-hj avatar Aug 02 '24 06:08 nikos-hj

cc @Yun-Kim

emmettbutler avatar Aug 02 '24 15:08 emmettbutler

This issue has been automatically closed after a period of inactivity. If it's a feature request, it has been added to the maintainers' internal backlog and will be included in an upcoming round of feature prioritization. Please comment or reopen if you think this issue was closed in error.

github-actions[bot] avatar Dec 31 '24 00:12 github-actions[bot]

Hi @nikos-hj, apologies for the late response. Out of curiosity, what is the nature of the custom tags you are trying to attach with your OpenAI metrics? Could you provide any examples? Thank you!

Yun-Kim avatar Dec 31 '24 00:12 Yun-Kim

Hello @Yun-Kim We would like to add tags like feature name, feature version

nikos-hj avatar Dec 31 '24 15:12 nikos-hj

Hi @nikos-hj, the OpenAI integration metrics (which are deprecated in favor of LLM Observability metrics moving forward) nor LLM Observability currently support this use case. We'll add this feature request for work we'll be doing in the upcoming few months!

In the meantime, one partial workaround I would recommend is to use LLM Observability and add custom tags to your OpenAI spans using annotation_context() and you'll be able to see roughly which spans correspond to your feature name/version.

Yun-Kim avatar Jan 07 '25 19:01 Yun-Kim

This issue has been automatically closed after a period of inactivity. If it's a feature request, it has been added to the maintainers' internal backlog and will be included in an upcoming round of feature prioritization. Please comment or reopen if you think this issue was closed in error.

github-actions[bot] avatar Sep 08 '25 00:09 github-actions[bot]