microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/src/Microsoft.Teams.Core/Diagnostics/CoreTelemetryNames.cs
35lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | namespace Microsoft.Teams.Core.Diagnostics; |
| 5 | |
| 6 | /// <summary> |
| 7 | /// Names of the <see cref="System.Diagnostics.ActivitySource"/> and <see cref="System.Diagnostics.Metrics.Meter"/> |
| 8 | /// emitted by <c>Microsoft.Teams.Core</c>. |
| 9 | /// </summary> |
| 10 | /// <remarks> |
| 11 | /// Consumers register these names with their OpenTelemetry tracer and meter providers so that the bot |
| 12 | /// pipeline spans (<c>turn</c>, <c>middleware</c>, <c>auth.outbound</c>, <c>conversation_client</c>) and metrics |
| 13 | /// (<c>teams.activities.received</c>, <c>teams.turn.duration</c>, <c>teams.handler.errors</c>, |
| 14 | /// <c>teams.middleware.duration</c>, <c>teams.outbound.calls</c>, <c>teams.outbound.errors</c>) flow to |
| 15 | /// configured exporters. Higher-level layers publish their own sources (for example, |
| 16 | /// <c>Microsoft.Teams.Apps.Diagnostics.TeamsBotApplicationTelemetry</c>); register them all to capture |
| 17 | /// the full bot pipeline. |
| 18 | /// <code> |
| 19 | /// builder.Services.AddOpenTelemetry() |
| 20 | /// .WithTracing(t => t.AddSource(CoreTelemetryNames.ActivitySourceName)) |
| 21 | /// .WithMetrics(m => m.AddMeter(CoreTelemetryNames.MeterName)); |
| 22 | /// </code> |
| 23 | /// </remarks> |
| 24 | public static class CoreTelemetryNames |
| 25 | { |
| 26 | /// <summary> |
| 27 | /// Name of the <see cref="System.Diagnostics.ActivitySource"/> that emits Core pipeline spans. |
| 28 | /// </summary> |
| 29 | public const string ActivitySourceName = "Microsoft.Teams.Core"; |
| 30 | |
| 31 | /// <summary> |
| 32 | /// Name of the <see cref="System.Diagnostics.Metrics.Meter"/> that emits Core pipeline metrics. |
| 33 | /// </summary> |
| 34 | public const string MeterName = "Microsoft.Teams.Core"; |
| 35 | } |
| 36 | |