-
Notifications
You must be signed in to change notification settings - Fork 162
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
Telemetry: update enablement (experimental source instead of app context switch) and docs improvements #187
base: main
Are you sure you want to change the base?
Telemetry: update enablement (experimental source instead of app context switch) and docs improvements #187
Conversation
051a5ba
to
f54b752
Compare
var source = new OpenTelemetrySource(RequestModel, new Uri(Endpoint)); | ||
|
||
using var activityListener = new TestActivityListener("OpenAI.ChatClient"); | ||
using var meterListener = new TestMeterListener("OpenAI.ChatClient"); | ||
using var activityListener = new TestActivityListener("Experimental.OpenAI.ChatClient"); |
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 wish everyone uses OTel's InMemoryExporter rather than writing own listeners, but it is upto the owners of this project!
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 you explain why?
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.
Listeners are not extensively documented given its generally only used by small set of people like people authoring OpenTelemetry SDK etc.
OTOH, InMemoryExporter is documented, and is intended to be used by end-users to validate their own instrumentation. Changing from InMemoryExporter to anything else like Console/OTLP is often the one-line change. End-users, who are familiar with OTLP Exporter find it easy to use InMemoryExporter with OTel for testing, as opposed to learning ActivityListener/MeterListener etc.
Just a suggestion only.
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.
LGTM!
f54b752
to
97f7cd4
Compare
|
||
using MeterProvider meterProvider = OpenTelemetry.Sdk.CreateMeterProviderBuilder() | ||
.SetResourceBuilder(resourceBuilder) | ||
.AddView("gen_ai.client.operation.duration", new ExplicitBucketHistogramConfiguration { Boundaries = [0.01, 0.02, 0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56, 5.12, 10.24, 20.48, 40.96, 81.92] }) |
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.
https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry/CHANGELOG.md#1100-beta1 added support for Hints, so Views maybe replaced with the hint API itself.
(Assuming this can take a dependency on preview DS,OTel nugets)
Based on the discussion in dotnet/aspire#5451, suggesting a new way to onboard:
Experimental.*
which make their status obviousThis PR also adds docs on how to view telemetry