You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirm this is a feature request for the Python library and not the underlying OpenAI API.
This is a feature request for the Python library
Describe the feature or improvement you're requesting
It would be nice to be able to be able to log the body of the requests.
I needed to see what was sent over the wire, so I checked how to log body requests.
Turns out, there's no way.
I'm not sure if this is the only place that has to change.
In fact, I just ended capturing network traffic just to be sure.
Having to resort to this kind of technique, is not nice.
I'm aware that you can log request/response using a custom httpx client with a custom transport: encode/httpx#3073
Thanks for the request, I agree this would be nice to provide! I don't expect we'll be able to get to it soon, but we do want to make logging & tracing comprehensively nicer to deal with in the coming months.
We invite anyone visiting this issue to add other use-cases they'd like to see supported with logging etc.
Thanks for the request, I agree this would be nice to provide! I don't expect we'll be able to get to it soon, but we do want to make logging & tracing comprehensively nicer to deal with in the coming months.
We invite anyone visiting this issue to add other use-cases they'd like to see supported with logging etc.
@rattrayalex - As mentioned by @lmolkova in the comment above, there is a CNCF open telemetry working group that is driving standardization of tracing across LLM vendors. We have a initial spec which we are currently iterating on and it would be great if this project adopts to the standard conventions.
@karthikscale3@lmolkova unfortunately we will not likely be able to prioritise this soon, however I would be interested in seeing a sample of what the changes we would have to make would look like if anyone is able to share?
@karthikscale3@lmolkova unfortunately we will not likely be able to prioritise this soon, however I would be interested in seeing a sample of what the changes we would have to make would look like if anyone is able to share?
I am happy to put something together and share it here. Give me a couple of days
Reacted by Robert Craigie, Alex Rattray, Krista Pratico and Liudmila Molkova
@karthikscale3 Awesome! I'll share in case it helps - awhile back I had experimented with instrumenting the library using a decorator approach: kristapratico#7
Thanks for raising this! We’ve since made SDK diagnostics metadata-only in #3685 to keep request and response content out of logs. We’re closing built-in body logging as not planned.
Activity
rattrayalex commentedon Jul 6, 2024
Thanks for the request, I agree this would be nice to provide! I don't expect we'll be able to get to it soon, but we do want to make logging & tracing comprehensively nicer to deal with in the coming months.
We invite anyone visiting this issue to add other use-cases they'd like to see supported with logging etc.
lmolkova commentedon Jul 10, 2024
@rattrayalex we're defining GenAI/LLM conventions for distributed tracing and metrics in OpenTelemetry - https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai and have a group of people working on otel and GenAI observability.
Would love to share more and collaborate, we're always available here:
karthikscale3 commentedon Jul 10, 2024
@rattrayalex - As mentioned by @lmolkova in the comment above, there is a CNCF open telemetry working group that is driving standardization of tracing across LLM vendors. We have a initial spec which we are currently iterating on and it would be great if this project adopts to the standard conventions.
RobertCraigie commentedon Jul 11, 2024
@karthikscale3 @lmolkova unfortunately we will not likely be able to prioritise this soon, however I would be interested in seeing a sample of what the changes we would have to make would look like if anyone is able to share?
karthikscale3 commentedon Jul 11, 2024
I am happy to put something together and share it here. Give me a couple of days
kristapratico commentedon Jul 12, 2024
@karthikscale3 Awesome! I'll share in case it helps - awhile back I had experimented with instrumenting the library using a decorator approach: kristapratico#7
Add Support for Logging Request Body in Debug Mode openai#1522
Merge pull request #57 from LuminaX-alt/LuminaX-alt-patch-57
marcuswood-oai commentedon Oct 23, 2026
Thanks for raising this! We’ve since made SDK diagnostics metadata-only in #3685 to keep request and response content out of logs. We’re closing built-in body logging as not planned.