openai: add OTEL_SDK_DISABLED tests - #107
Conversation
|
💚 CLA has been signed |
|
Hi, I signed the Elastic Contributor Agreement after opening this PR. Could you please re-trigger or refresh the CLA check when you get a chance? Thank you. |
There was a problem hiding this comment.
Thanks for the PR. We plan to deprecate this instrumenation in favor of the upstream openai one from https://github.com/open-telemetry/opentelemetry-python-genai/ that exports a newer semantic convention. Anyway if you update this PR I'll merge it gladly. Are you using this instrumentation?
| def otel_sdk_disabled_instrumentor(monkeypatch, instrument): | ||
| instrument.uninstrument() |
There was a problem hiding this comment.
With the other PR merged you don't need to do this anymore. Also I would add this in conftests.py with the others and name it otel_sdk_disabled_instrument.
| tracer_provider=trace.NoOpTracerProvider(), | ||
| meter_provider=metrics.NoOpMeterProvider(), |
| messages=[{"role": "user", "content": TEST_CHAT_INPUT}], | ||
| ) | ||
|
|
||
| assert response.choices[0].message.content == "Atlantic Ocean." |
There was a problem hiding this comment.
Will something like the following work (after you inject tracer_exporter)?
assert not trace_exporter.get_finished_spans()
Summary
Closes #57
Testing
Note