Embeddings\OpenTelemetryEmbeddingGenerator.cs (30)
58string name = string.IsNullOrEmpty(sourceName) ? OpenTelemetryConsts.DefaultSourceName : sourceName!;
63OpenTelemetryConsts.GenAI.Client.TokenUsage.Name,
64OpenTelemetryConsts.TokensUnit,
65OpenTelemetryConsts.GenAI.Client.TokenUsage.Description,
66advice: new() { HistogramBucketBoundaries = OpenTelemetryConsts.GenAI.Client.TokenUsage.ExplicitBucketBoundaries });
69OpenTelemetryConsts.GenAI.Client.OperationDuration.Name,
70OpenTelemetryConsts.SecondsUnit,
71OpenTelemetryConsts.GenAI.Client.OperationDuration.Description,
72advice: new() { HistogramBucketBoundaries = OpenTelemetryConsts.GenAI.Client.OperationDuration.ExplicitBucketBoundaries });
129string.IsNullOrWhiteSpace(modelId) ? OpenTelemetryConsts.GenAI.Embed : $"{OpenTelemetryConsts.GenAI.Embed} {modelId}",
133new(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.Embed),
134new(OpenTelemetryConsts.GenAI.Request.Model, modelId),
135new(OpenTelemetryConsts.GenAI.SystemName, _modelProvider),
143.AddTag(OpenTelemetryConsts.Server.Address, _endpointAddress)
144.AddTag(OpenTelemetryConsts.Server.Port, _endpointPort);
149_ = activity.AddTag(OpenTelemetryConsts.GenAI.Request.EmbeddingDimensions, dimensions);
182tags.Add(OpenTelemetryConsts.Error.Type, error.GetType().FullName);
191tags.Add(OpenTelemetryConsts.GenAI.Token.Type, "input");
202.AddTag(OpenTelemetryConsts.Error.Type, error.GetType().FullName)
208_ = activity.AddTag(OpenTelemetryConsts.GenAI.Response.InputTokens, inputTokens);
213_ = activity.AddTag(OpenTelemetryConsts.GenAI.Response.Model, responseModelId);
220tags.Add(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.Embed);
224tags.Add(OpenTelemetryConsts.GenAI.Request.Model, requestModelId);
227tags.Add(OpenTelemetryConsts.GenAI.SystemName, _modelProvider);
231tags.Add(OpenTelemetryConsts.Server.Address, endpointAddress);
232tags.Add(OpenTelemetryConsts.Server.Port, _endpointPort);
238tags.Add(OpenTelemetryConsts.GenAI.Response.Model, responseModelId);