Add Cohere instrumentation package scaffolding#102
Conversation
89a48ed to
856791f
Compare
59dbfec to
a437ffe
Compare
|
@lzchen PR is rebased and all checks are passing now. Could you please merge it when you get a chance? Thanks! |
|
Hi @Nik-Reddy , will have to wait for a maintainer to merge. |
a437ffe to
9515baf
Compare
86218c5 to
8e48615
Compare
|
@lmolkova I am thinking we can use openinference for adding instrumentation coverage for cohere. wdyt? |
| logger_provider = kwargs.get("logger_provider") | ||
| meter_provider = kwargs.get("meter_provider") | ||
|
|
||
| # Initialize tracer |
There was a problem hiding this comment.
I don't tracer/meter/logger is needed with relying on util-genai, please create TelemetryHandler instead
| """An instrumentor for the Cohere Python SDK. | ||
|
|
||
| This instrumentor will automatically trace Cohere API calls and | ||
| optionally capture message content as events. |
There was a problem hiding this comment.
this does not seem to be correct
it doesn't seem like they have instrumentation for it |
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
be60e6a to
2d1208f
Compare
Description
Adds a scaffold-only Cohere V2 instrumentation package as PR 1 of 4 tracked in #56. The
CohereInstrumentorsets up tracer, logger, and meter providers but does not yet wrap any Cohere client methods.Ported from open-telemetry/opentelemetry-python-contrib#4418, adapted to the new-repo conventions:
opentelemetry-instrumentation-genai-cohereopentelemetry.instrumentation.genai.cohereCohereInstrumentorcohere >= 5.13.0(V2 GA floor; 5.0.0 lacksClientV2)opentelemetry-api ~= 1.40,opentelemetry-instrumentation ~= 0.61b0,opentelemetry-semantic-conventions ~= 0.61b0,opentelemetry-util-genai >= 1.0b0.devThis mirrors the
opentelemetry-instrumentation-genai-claude-agent-sdkscaffold shape.Scope
src/,tests/,examples/,pyproject.toml,README.rst,LICENSE)pyproject.toml,tox.ini,eachdist.ini,uv.lock, and regeneratedinstrumentation/README.mdexamples/manualandexamples/zero-code) with explicit scaffold disclaimers per Cohere V2 instrumentation: continuescaffold + chat completionsfrom my previous workopentelemetry-python-contrib#4418#56.changelog/102.added)Not in this PR (follow-ups per #56)
Validation
uv locksucceeds;coherev7.0.2 added with transitive depstox -e generateregeneratesinstrumentation/README.mdwith the cohere row alphabetically inserteduv run ruff check instrumentation/opentelemetry-instrumentation-genai-cohere/passespytestpasses 7/7 on both latest and oldest dep sets across the full Python 3.10-3.14 matrixCloses part of #56.