OpenTelemetryCollectorExtensions Methods
ClassMethods3 members
Provides extension methods for adding and configuring OpenTelemetry Collector resources.
AddOpenTelemetryCollector(IDistributedApplicationBuilder, string, Action<OpenTelemetryCollectorSettings>) Section titled AddOpenTelemetryCollector(IDistributedApplicationBuilder, string, Action<OpenTelemetryCollectorSettings>)extensionIResourceBuilder<OpenTelemetryCollectorResource> Adds an OpenTelemetry Collector container resource to the application model.
public static class OpenTelemetryCollectorExtensions{ public static IResourceBuilder<OpenTelemetryCollectorResource> AddOpenTelemetryCollector( this IDistributedApplicationBuilder builder, string name, Action<OpenTelemetryCollectorSettings>? configureSettings = null) { // ... }}Parameters
builderIDistributedApplicationBuilder The application builder.namestringThe name of the resource.configureSettings Action<OpenTelemetryCollectorSettings> optionalAn optional callback that configures the collector settings.Returns
IResourceBuilder<OpenTelemetryCollectorResource> A reference to the resource builder.WithAppForwarding(IResourceBuilder<OpenTelemetryCollectorResource>) Section titled WithAppForwarding(IResourceBuilder<OpenTelemetryCollectorResource>)extensionIResourceBuilder<OpenTelemetryCollectorResource> Configures all compatible resources in the application to forward telemetry to this collector.
public static class OpenTelemetryCollectorExtensions{ public static IResourceBuilder<OpenTelemetryCollectorResource> WithAppForwarding( this IResourceBuilder<OpenTelemetryCollectorResource> builder) { // ... }}Parameters
builderIResourceBuilder<OpenTelemetryCollectorResource> The collector resource builder.Returns
IResourceBuilder<OpenTelemetryCollectorResource> A reference to the resource builder.WithConfig(IResourceBuilder<OpenTelemetryCollectorResource>, string) Section titled WithConfig(IResourceBuilder<OpenTelemetryCollectorResource>, string)extensionIResourceBuilder<OpenTelemetryCollectorResource> Adds a configuration file to the collector resource.
public static class OpenTelemetryCollectorExtensions{ public static IResourceBuilder<OpenTelemetryCollectorResource> WithConfig( this IResourceBuilder<OpenTelemetryCollectorResource> builder, string configPath) { // ... }}Parameters
builderIResourceBuilder<OpenTelemetryCollectorResource> The collector resource builder.configPath stringThe path to the collector configuration file.Returns
IResourceBuilder<OpenTelemetryCollectorResource> A reference to the resource builder.