-
Notifications
You must be signed in to change notification settings - Fork 0
New Gen-AI utils APIs creating semantic conventions compatible telemetry (POC) #2
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
base: main
Are you sure you want to change the base?
Conversation
…entelemetry-python-contrib into instrumentation-genai-langchain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing topics relating to eval/instrumentation functionality (not the Langchain instrumentor).
"opentelemetry-instrumentation ~= 0.51b0", | ||
"opentelemetry-semantic-conventions ~= 0.51b0", | ||
"opentelemetry-api>=1.31.0", | ||
"opentelemetry-sdk>=1.31.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this package independent of the SDK (as the other instrumentors are)? If there's SDK functionality that needs to be supplied as part of this effort, it could live in a separate package (maybe even in our distro).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about confusion around the use of the name exporter, which has a meaning in OTel that differs from this one. Should we think of another name? Maybe something like Handler, Recorder, Adaptor, Emitter...
) | ||
from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import OTLPMetricExporter | ||
|
||
from opentelemetry.sdk._events import EventLoggerProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the events api is going away. Can this be migrated to use the logs api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned about confusion around the names "sdk" and "api" here as they are fundamental to OTel and have well-established, specific meanings. If the meanings here are different, that might cause confusion. For example, in OTel, the API is independent and has no knowledge of the SDK.
Description
Created gen-AI APIs which can be used to produce semantic conventions compatible telemetry.
This POC demonstrates langchain instrumentation using the gen-AI API for llm invocation see callback_handler.py(on_chat_model_start and on_llm_end).
There are 2 different telemetry creations, SpanMetricExporter(no events instead content on Span) and SpanMetricEventExporter(can be selected using OTEL_INSTRUMENTATION_GENAI_EXPORTER).
Types can be defined in types.py for particular invocation which will be then created by the API(api.py) and passed to the exporter to produce semantic conventions compatible telemetry.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.