Skip to content

Class OpenTelemetryHostApplicationBuilderExtensions

Namespace: Cephalon.Observability.OpenTelemetry.Hosting
Assembly: Cephalon.Observability.OpenTelemetry.dll

Adds OpenTelemetry OTLP exporter wiring for Cephalon hosts.

public static class OpenTelemetryHostApplicationBuilderExtensions

objectOpenTelemetryHostApplicationBuilderExtensions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

AddCephalonOpenTelemetry<TBuilder>(TBuilder, Action<TelemetryExportOptions>?)

Section titled “ AddCephalonOpenTelemetry<TBuilder>(TBuilder, Action<TelemetryExportOptions>?)”

Adds OpenTelemetry exporter registration for the Cephalon engine diagnostics surface.

public static TBuilder AddCephalonOpenTelemetry<TBuilder>(this TBuilder builder, Action<TelemetryExportOptions>? configure = null) where TBuilder : IHostApplicationBuilder

builder TBuilder

The target host-application builder.

configure Action<TelemetryExportOptions>?

An optional callback that can extend or override the configuration-driven telemetry export options.

TBuilder

The same builder instance for fluent host composition.

TBuilder

The host-application builder type to extend.

This package keeps exporter wiring outside Cephalon.Engine and Cephalon.Observability. Hosts opt in explicitly when they want a supported OpenTelemetry path instead of guidance-only settings.

Registration is skipped when every signal is disabled or when no export endpoint is configured and explicit self-hosted defaults are not enabled. When UseSelfHostedDefaults is enabled, the package falls back to the standard local OTLP collector ports and adds a deployment.environment.name resource attribute from the current host environment. The endpoint is interpreted as a base collector endpoint for HTTP/protobuf and the signal-specific OTLP paths are appended automatically.