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? |
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
Pull request dashboard statusStatus last refreshed: 2026-07-25 12:51:45 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. If you believe this pull request is incorrectly routed as waiting on the author, comment |
2d1208f to
f3eebde
Compare
5b5dfd0 to
e7ce546
Compare
lmolkova
left a comment
There was a problem hiding this comment.
A few more comments.
The key question, @Nik-Reddy are you going to follow up with real instrumentation right away? We already have a couple of empty instrumentations in this repo and unless you'd like to work on actual cohere instrumentation, I would prefer to not add another one.
| OTEL_SERVICE_NAME=opentelemetry-python-cohere | ||
|
|
||
| # Change to 'false' to hide prompt and completion content | ||
| OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true |
There was a problem hiding this comment.
this is an old value which is no longer supported
| # OTEL_LOGS_EXPORTER=console | ||
|
|
||
| # Change to 'false' to hide prompt and completion content | ||
| OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true |
| # OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 | ||
| # OTEL_EXPORTER_OTLP_PROTOCOL=grpc | ||
|
|
||
| OTEL_SERVICE_NAME=opentelemetry-python-cohere |
There was a problem hiding this comment.
| OTEL_SERVICE_NAME=opentelemetry-python-cohere | |
| OTEL_SERVICE_NAME=cohere-zero-code |
| handler = TelemetryHandler( | ||
| tracer_provider=tracer_provider, | ||
| meter_provider=meter_provider, | ||
| logger_provider=logger_provider, |
There was a problem hiding this comment.
please pass completion_hook, check out openai as an example
| # Copyright The OpenTelemetry Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| __version__ = "1.0b0.dev" |
There was a problem hiding this comment.
| __version__ = "1.0b0.dev" | |
| __version__ = "1.1b0.dev" |
to match global version in this repo
| # Packages the release workflows may publish (eachdist.py list-release-packages). | ||
| packages= | ||
| opentelemetry-instrumentation-genai-anthropic | ||
| opentelemetry-instrumentation-genai-cohere |
There was a problem hiding this comment.
it should not be included into the list of releasable packages until there is some real instrumentation
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.