109 references to AddTag
aspire (1)
Program.cs (1)
710
mainActivity.
AddTag
(TelemetryConstants.Tags.ProcessExecutableName, "aspire");
Aspire.RabbitMQ.Client (6)
src\Components\Aspire.RabbitMQ.Client\AspireRabbitMQExtensions.cs (6)
248
activity.
AddTag
("server.address", address.Host);
250
activity.
AddTag
("messaging.system", "rabbitmq");
253
activity.
AddTag
("messaging.operation", operation);
264
connectAttemptActivity.
AddTag
("exception.message", ex.Message);
268
connectAttemptActivity.
AddTag
("exception.stacktrace", ex.ToString());
269
connectAttemptActivity.
AddTag
("exception.type", ex.GetType().FullName);
dotnet (9)
CommandFactory\CommandResolution\CompositeCommandResolver.cs (4)
39
resolverActivity?.
AddTag
("lookup.type", commandResolver.GetType().Name);
44
resolverActivity?.
AddTag
("lookup.command", commandSpec.Path);
45
resolverActivity?.
AddTag
("lookup.status", "found");
56
resolverActivity?.
AddTag
("lookup.status", "notfound");
CommandFactory\CommandResolution\DotnetToolsCommandResolver.cs (1)
37
Activity.Current?.
AddTag
("lookup.root_path", _dotnetToolPath);
Program.cs (4)
48
?.
AddTag
("process.executable.name", "dotnet")
49
?.
AddTag
("cli.runtime", "managed");
65
s_mainActivity.
AddTag
("dotnet.globalJson", s_globalJsonState);
180
lookupActivity?.
AddTag
("command.name", commandName);
dotnet-aot (10)
NativeEntryPoint.cs (5)
143
mainActivity.
AddTag
("process.executable.name", "dotnet");
144
mainActivity.
AddTag
("cli.runtime", "aot");
154
mainActivity?.
AddTag
("dotnet.globalJson", globalJsonState);
313
lookupActivity?.
AddTag
("command.name", commandName);
314
lookupActivity?.
AddTag
("sdk.root", sdkDir);
src\sdk\src\Cli\dotnet\CommandFactory\CommandResolution\CompositeCommandResolver.cs (4)
39
resolverActivity?.
AddTag
("lookup.type", commandResolver.GetType().Name);
44
resolverActivity?.
AddTag
("lookup.command", commandSpec.Path);
45
resolverActivity?.
AddTag
("lookup.status", "found");
56
resolverActivity?.
AddTag
("lookup.status", "notfound");
src\sdk\src\Cli\dotnet\CommandFactory\CommandResolution\DotnetToolsCommandResolver.cs (1)
37
Activity.Current?.
AddTag
("lookup.root_path", _dotnetToolPath);
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
274
context.Features.Get<IHttpActivityFeature>()?.Activity.
AddTag
("http.long_running", "true");
Microsoft.Extensions.AI (72)
ChatCompletion\OpenTelemetryChatClient.cs (15)
293
.
AddTag
(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.ChatName)
294
.
AddTag
(OpenTelemetryConsts.GenAI.Request.Model, modelId)
295
.
AddTag
(OpenTelemetryConsts.GenAI.Provider.Name, _providerName);
305
.
AddTag
(OpenTelemetryConsts.Server.Address, _serverAddress)
313
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Conversation.Id, conversationId);
338
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Request.StopSequences, $"[{string.Join(", ", stopSequences.Select(s => $"\"{s}\""))}]");
361
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Output.Type, OpenTelemetryConsts.TypeText);
364
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Output.Type, OpenTelemetryConsts.TypeJson);
371
_ = activity.
AddTag
(
447
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.FinishReasons, $"[\"{finishReason.Value.ToLowerInvariant()}\"]");
453
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.Id, response.ResponseId);
458
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.Model, response.ModelId);
528
_ = activity.
AddTag
(
533
_ = activity.
AddTag
(
543
_ = activity.
AddTag
(
ChatCompletion\OpenTelemetryImageGenerator.cs (7)
146
.
AddTag
(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.GenerateContentName)
147
.
AddTag
(OpenTelemetryConsts.GenAI.Output.Type, OpenTelemetryConsts.TypeImage)
148
.
AddTag
(OpenTelemetryConsts.GenAI.Request.Model, modelId)
149
.
AddTag
(OpenTelemetryConsts.GenAI.Provider.Name, _providerName);
154
.
AddTag
(OpenTelemetryConsts.Server.Address, _serverAddress)
188
_ = activity.
AddTag
(
235
_ = activity.
AddTag
(
Common\OpenTelemetryLog.cs (1)
29
.
AddTag
(OpenTelemetryConsts.Error.Type, error.GetType().FullName)
Embeddings\OpenTelemetryEmbeddingGenerator.cs (2)
158
.
AddTag
(OpenTelemetryConsts.Server.Address, _endpointAddress)
233
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.Model, responseModelId);
Files\OpenTelemetryHostedFileClient.cs (17)
148
_ = activity.
AddTag
(FilesMediaTypeAttribute, mediaType);
153
_ = activity.
AddTag
(FilesPurposeAttribute, purpose);
158
_ = activity.
AddTag
(FilesScopeAttribute, scope);
163
_ = activity.
AddTag
(OpenTelemetryConsts.File.Name, fileName);
185
_ = activity.
AddTag
(FilesIdAttribute, result.FileId);
207
_ = activity.
AddTag
(FilesIdAttribute, fileId);
211
_ = activity.
AddTag
(FilesScopeAttribute, scope);
244
_ = activity.
AddTag
(FilesIdAttribute, fileId);
248
_ = activity.
AddTag
(FilesScopeAttribute, scope);
272
_ = activity.
AddTag
(OpenTelemetryConsts.File.Name, name);
297
_ = activity.
AddTag
(FilesScopeAttribute, scope);
302
_ = activity.
AddTag
(FilesPurposeAttribute, purpose);
371
_ = activity.
AddTag
(FilesIdAttribute, fileId);
375
_ = activity.
AddTag
(FilesScopeAttribute, scope);
424
.
AddTag
(FilesOperationNameAttribute, operationName)
425
.
AddTag
(FilesProviderNameAttribute, _providerName);
430
.
AddTag
(OpenTelemetryConsts.Server.Address, _serverAddress)
Realtime\OpenTelemetryRealtimeClientSession.cs (15)
187
_ = inputActivity.
AddTag
(OpenTelemetryConsts.GenAI.Input.Messages, SerializeMessage(otelMessage));
309
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Realtime.ReceivedModalities, $"[{string.Join(", ", outputModalities.Select(m => $"\"{m}\""))}]");
318
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Output.Messages, SerializeMessages(outputMessages));
676
.
AddTag
(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.ChatName)
677
.
AddTag
(OpenTelemetryConsts.GenAI.Request.Model, modelId)
678
.
AddTag
(OpenTelemetryConsts.GenAI.Provider.Name, _providerName);
688
.
AddTag
(OpenTelemetryConsts.Server.Address, _serverAddress)
701
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Realtime.SessionKind, options.SessionKind.ToString());
705
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Realtime.Voice, options.Voice);
710
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Realtime.OutputModalities, $"[{string.Join(", ", modalities.Select(m => $"\"{m}\""))}]");
717
_ = activity.
AddTag
(
726
_ = activity.
AddTag
(
825
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.Id, response.ResponseId);
835
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.FinishReasons, $"[\"{response.Status}\"]");
884
_ = activity.
AddTag
(OpenTelemetryConsts.Error.Type, responseError.ErrorCode ?? "RealtimeError");
SpeechToText\OpenTelemetrySpeechToTextClient.cs (8)
207
.
AddTag
(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.GenerateContentName)
208
.
AddTag
(OpenTelemetryConsts.GenAI.Request.Model, modelId)
209
.
AddTag
(OpenTelemetryConsts.GenAI.Provider.Name, _providerName)
210
.
AddTag
(OpenTelemetryConsts.GenAI.Output.Type, OpenTelemetryConsts.TypeText);
215
.
AddTag
(OpenTelemetryConsts.Server.Address, _serverAddress)
290
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.Id, response.ResponseId);
295
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.Model, response.ModelId);
348
_ = activity.
AddTag
(
TextToSpeech\OpenTelemetryTextToSpeechClient.cs (7)
206
.
AddTag
(OpenTelemetryConsts.GenAI.Operation.Name, OpenTelemetryConsts.GenAI.GenerateContentName)
207
.
AddTag
(OpenTelemetryConsts.GenAI.Request.Model, modelId)
208
.
AddTag
(OpenTelemetryConsts.GenAI.Provider.Name, _providerName)
209
.
AddTag
(OpenTelemetryConsts.GenAI.Output.Type, OpenTelemetryConsts.TypeAudio);
214
.
AddTag
(OpenTelemetryConsts.Server.Address, _serverAddress)
285
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.Id, response.ResponseId);
290
_ = activity.
AddTag
(OpenTelemetryConsts.GenAI.Response.Model, response.ModelId);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
362
_ = activity.
AddTag
(OpenAIApiTypeTag, apiType);
Microsoft.Extensions.Telemetry.Tests (8)
Logging\ExtendedLoggerFactoryTests.cs (8)
208
activity.
AddTag
("tagTestKey", "tagTestValue");
290
activity.
AddTag
("testKey1", null);
291
activity.
AddTag
("testKey2", string.Empty);
292
activity.
AddTag
("testKey3", "testValue");
319
activity.
AddTag
("testTagKey1", "testTagValue");
350
activity.
AddTag
("MyTagKey1", "1");
359
activity.
AddTag
("MyTagKey2", "2");
366
activity.
AddTag
("MyTagKey3", "3");
OrderProcessor (1)
OrderProcessingWorker.cs (1)
68
Activity.Current?.
AddTag
("order-id", order.Id);