Embeddings\OpenTelemetryEmbeddingGenerator.cs (32)
61string name = string.IsNullOrEmpty(sourceName) ? OpenTelemetryConsts.DefaultSourceName : sourceName!;
66OpenTelemetryConsts.GenAI.Client.TokenUsage.Name,
67OpenTelemetryConsts.TokensUnit,
68OpenTelemetryConsts.GenAI.Client.TokenUsage.Description,
69advice: new() { HistogramBucketBoundaries = OpenTelemetryConsts.GenAI.Client.TokenUsage.ExplicitBucketBoundaries });
72OpenTelemetryConsts.GenAI.Client.OperationDuration.Name,
73OpenTelemetryConsts.SecondsUnit,
74OpenTelemetryConsts.GenAI.Client.OperationDuration.Description,
75advice: new() { HistogramBucketBoundaries = OpenTelemetryConsts.GenAI.Client.OperationDuration.ExplicitBucketBoundaries });
132string.IsNullOrWhiteSpace(modelId) ? OpenTelemetryConsts.GenAI.Embeddings : $"{OpenTelemetryConsts.GenAI.Embeddings} {modelId}",
136new(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.Embeddings),
137new(OpenTelemetryConsts.GenAI.Request.Model, modelId),
138new(OpenTelemetryConsts.GenAI.SystemName, _modelProvider),
146.AddTag(OpenTelemetryConsts.Server.Address, _endpointAddress)
147.AddTag(OpenTelemetryConsts.Server.Port, _endpointPort);
152_ = activity.AddTag(OpenTelemetryConsts.GenAI.Request.EmbeddingDimensions, dimensions);
166OpenTelemetryConsts.GenAI.Request.PerProvider(_system, JsonNamingPolicy.SnakeCaseLower.ConvertName(prop.Key)),
202tags.Add(OpenTelemetryConsts.Error.Type, error.GetType().FullName);
211tags.Add(OpenTelemetryConsts.GenAI.Token.Type, "input");
222.AddTag(OpenTelemetryConsts.Error.Type, error.GetType().FullName)
228_ = activity.AddTag(OpenTelemetryConsts.GenAI.Response.InputTokens, inputTokens);
233_ = activity.AddTag(OpenTelemetryConsts.GenAI.Response.Model, responseModelId);
245OpenTelemetryConsts.GenAI.Response.PerProvider(_system, JsonNamingPolicy.SnakeCaseLower.ConvertName(prop.Key)),
254tags.Add(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.Embeddings);
258tags.Add(OpenTelemetryConsts.GenAI.Request.Model, requestModelId);
261tags.Add(OpenTelemetryConsts.GenAI.SystemName, _modelProvider);
265tags.Add(OpenTelemetryConsts.Server.Address, endpointAddress);
266tags.Add(OpenTelemetryConsts.Server.Port, _endpointPort);
272tags.Add(OpenTelemetryConsts.GenAI.Response.Model, responseModelId);