OpenTelemetry.Extensions.Hosting/OpenTelemetryServicesExtensions.cs

opentelemetry-dotnet · src/OpenTelemetry.Extensions.Hosting/OpenTelemetryServicesExtensions.cs · csharp · Apache-2.0
analytics

Provides extension methods to integrate OpenTelemetry SDK services into the .NET dependency injection container and host lifecycle.

// Source: https://github.com/open-telemetry/opentelemetry-dotnet | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using OpenTelemetry;
using OpenTelemetry.Extensions.Hosting.Implementation;
using OpenTelemetry.Internal;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;

namespace Microsoft.Extensions.DependencyInjection;

/// <summary>
/// Extension methods for setting up OpenTelemetry services in an <see
/// cref="IServiceCollection" />.
/// </summary>
public static class OpenTelemetryServicesExtensions
{
    /// <summary>
    /// Adds OpenTelemetry SDK services into the su

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key