-
Notifications
You must be signed in to change notification settings - Fork 660
Closed
Labels
aiarea-integrationsIssues pertaining to Aspire Integrations packagesIssues pertaining to Aspire Integrations packages
Milestone
Description
I have been fiddling with the playground sample for the playground OpenAI component trying to get it to emit telemetry. I think the following things are missing;
- Updating Directory.Packages.props to use beta3 for the Azure.AI.OpenAI package
<PackageVersion Include="Azure.AI.OpenAI" Version="2.0.0-beta.3" />
I also had to add a source to nuget as that version is pulling in a more recent OpenAI SDK version than is available internally at the moment
- In the Aspire.Azure.AI.OpenAI component:
- Update the activity source names to include OpenAI.*
protected virtual string[] ActivitySourceNames => new[] { $"{typeof(TClient).Namespace}.*", "OpenAI.*" };
- Set the app context switch for the OpenAI instrumentation
if (GetTracingEnabled(settings))
{
AppContext.SetSwitch("OpenAI.Experimental.EnableOpenTelemetry", true);
builder.Services.AddOpenTelemetry()
.WithTracing(traceBuilder => traceBuilder.AddSource(ActivitySourceNames));
}
When these are all in place, we get the metrics and telemetry that @lmolkova added to OpenAI recently.
I believe we should include the app context switch - its there because the semanic conventions are not stable, but IMHO for Aspire we should be showing what's available rather than hiding it.
lmolkova
Metadata
Metadata
Assignees
Labels
aiarea-integrationsIssues pertaining to Aspire Integrations packagesIssues pertaining to Aspire Integrations packages