Skip to content
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

fix(openai): Add trace context to client requests #2321

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

ronensc
Copy link
Contributor

@ronensc ronensc commented Nov 20, 2024

This PR resolves #2291.

A new flag, enable_trace_context_propagation, has been introduced to control trace context propagation. By default, this flag is set to true, ensuring that the trace context is propagated.

  • I have added tests that cover my changes.
  • If adding a new instrumentation or changing an existing one, I've added screenshots from some observability platform showing the change.
  • PR name follows conventional commits format: feat(instrumentation): ... or fix(instrumentation): ....
  • (If applicable) I have updated the documentation accordingly.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. python Pull requests that update Python code testing labels Nov 20, 2024
Copy link
Member

@nirga nirga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ronensc! Great work :)
Left a small comment

):
super().__init__()
Config.enrich_assistant = enrich_assistant
Config.enrich_token_usage = enrich_token_usage
Config.exception_logger = exception_logger
Config.get_common_metrics_attributes = get_common_metrics_attributes
Config.upload_base64_image = upload_base64_image
Config.disable_trace_context_propagation = disable_trace_context_propagation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think it's better to have "positive flags" - so this should be "enable_trace_context_propagation" and default to True. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, no problem. done :)

Copy link
Member

@nirga nirga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ronensc!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 22, 2024
@nirga nirga merged commit 8e72219 into traceloop:main Nov 22, 2024
9 checks passed
@ronensc ronensc deleted the openai-trace-context branch November 22, 2024 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer python Pull requests that update Python code size:XL This PR changes 500-999 lines, ignoring generated files. testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Trace-ID Injection Missing Between OpenAI and vLLM Spans
2 participants