Skip to content

Commit

Permalink
[console, in-memory] Tweak nullable annotations in registration exten…
Browse files Browse the repository at this point in the history
…sions (#5833)
  • Loading branch information
CodeBlanch authored Sep 16, 2024
1 parent 82b1fbd commit 9b83188
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ override OpenTelemetry.Exporter.ConsoleLogRecordExporter.Export(in OpenTelemetry
override OpenTelemetry.Exporter.ConsoleMetricExporter.Export(in OpenTelemetry.Batch<OpenTelemetry.Metrics.Metric!> batch) -> OpenTelemetry.ExportResult
static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder) -> OpenTelemetry.Logs.LoggerProviderBuilder!
static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, string? name, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>? configure) -> OpenTelemetry.Logs.LoggerProviderBuilder!
static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>? configure) -> OpenTelemetry.Logs.LoggerProviderBuilder!
static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.LoggerProviderBuilder! loggerProviderBuilder, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>! configure) -> OpenTelemetry.Logs.LoggerProviderBuilder!
static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
static OpenTelemetry.Logs.ConsoleExporterLoggingExtensions.AddConsoleExporter(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>? configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, string? name, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!, OpenTelemetry.Metrics.MetricReaderOptions!>? configureExporterAndMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, string? name, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>? configureExporter) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!, OpenTelemetry.Metrics.MetricReaderOptions!>? configureExporterAndMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>? configureExporter) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.ConsoleExporterMetricsExtensions.AddConsoleExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>! configureExporter) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Trace.ConsoleExporterHelperExtensions.AddConsoleExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder) -> OpenTelemetry.Trace.TracerProviderBuilder!
static OpenTelemetry.Trace.ConsoleExporterHelperExtensions.AddConsoleExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder, string? name, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>? configure) -> OpenTelemetry.Trace.TracerProviderBuilder!
static OpenTelemetry.Trace.ConsoleExporterHelperExtensions.AddConsoleExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>? configure) -> OpenTelemetry.Trace.TracerProviderBuilder!
static OpenTelemetry.Trace.ConsoleExporterHelperExtensions.AddConsoleExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Action<OpenTelemetry.Exporter.ConsoleExporterOptions!>! configure) -> OpenTelemetry.Trace.TracerProviderBuilder!
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ public static TracerProviderBuilder AddConsoleExporter(this TracerProviderBuilde
/// <param name="builder"><see cref="TracerProviderBuilder"/> builder to use.</param>
/// <param name="configure">Callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <returns>The instance of <see cref="TracerProviderBuilder"/> to chain the calls.</returns>
public static TracerProviderBuilder AddConsoleExporter(this TracerProviderBuilder builder, Action<ConsoleExporterOptions>? configure)
public static TracerProviderBuilder AddConsoleExporter(this TracerProviderBuilder builder, Action<ConsoleExporterOptions> configure)
=> AddConsoleExporter(builder, name: null, configure);

/// <summary>
/// Adds Console exporter to the TracerProvider.
/// </summary>
/// <param name="builder"><see cref="TracerProviderBuilder"/> builder to use.</param>
/// <param name="name">Name which is used when retrieving options.</param>
/// <param name="configure">Callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <param name="name">Optional name which is used when retrieving options.</param>
/// <param name="configure">Optional callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <returns>The instance of <see cref="TracerProviderBuilder"/> to chain the calls.</returns>
public static TracerProviderBuilder AddConsoleExporter(
this TracerProviderBuilder builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static OpenTelemetryLoggerOptions AddConsoleExporter(this OpenTelemetryLo
/// Adds Console exporter with OpenTelemetryLoggerOptions.
/// </summary>
/// <param name="loggerOptions"><see cref="OpenTelemetryLoggerOptions"/> options to use.</param>
/// <param name="configure">Callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <param name="configure">Optional callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <returns>The instance of <see cref="OpenTelemetryLoggerOptions"/> to chain the calls.</returns>
// TODO: [Obsolete("Call LoggerProviderBuilder.AddConsoleExporter instead this method will be removed in a future version.")]
public static OpenTelemetryLoggerOptions AddConsoleExporter(this OpenTelemetryLoggerOptions loggerOptions, Action<ConsoleExporterOptions>? configure)
Expand Down Expand Up @@ -52,15 +52,15 @@ public static LoggerProviderBuilder AddConsoleExporter(
/// <returns>The supplied instance of <see cref="LoggerProviderBuilder"/> to chain the calls.</returns>
public static LoggerProviderBuilder AddConsoleExporter(
this LoggerProviderBuilder loggerProviderBuilder,
Action<ConsoleExporterOptions>? configure)
Action<ConsoleExporterOptions> configure)
=> AddConsoleExporter(loggerProviderBuilder, name: null, configure);

/// <summary>
/// Adds Console exporter with LoggerProviderBuilder.
/// </summary>
/// <param name="loggerProviderBuilder"><see cref="LoggerProviderBuilder"/>.</param>
/// <param name="name">Name which is used when retrieving options.</param>
/// <param name="configure">Callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <param name="name">Optional name which is used when retrieving options.</param>
/// <param name="configure">Optional callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <returns>The supplied instance of <see cref="LoggerProviderBuilder"/> to chain the calls.</returns>
public static LoggerProviderBuilder AddConsoleExporter(
this LoggerProviderBuilder loggerProviderBuilder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public static MeterProviderBuilder AddConsoleExporter(this MeterProviderBuilder
/// <param name="builder"><see cref="MeterProviderBuilder"/> builder to use.</param>
/// <param name="configureExporter">Callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <returns>The instance of <see cref="MeterProviderBuilder"/> to chain the calls.</returns>
public static MeterProviderBuilder AddConsoleExporter(this MeterProviderBuilder builder, Action<ConsoleExporterOptions>? configureExporter)
public static MeterProviderBuilder AddConsoleExporter(this MeterProviderBuilder builder, Action<ConsoleExporterOptions> configureExporter)
=> AddConsoleExporter(builder, name: null, configureExporter);

/// <summary>
/// Adds <see cref="ConsoleMetricExporter"/> to the <see cref="MeterProviderBuilder"/>.
/// </summary>
/// <param name="builder"><see cref="MeterProviderBuilder"/> builder to use.</param>
/// <param name="name">Name which is used when retrieving options.</param>
/// <param name="configureExporter">Callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <param name="name">Optional name which is used when retrieving options.</param>
/// <param name="configureExporter">Optional callback action for configuring <see cref="ConsoleExporterOptions"/>.</param>
/// <returns>The instance of <see cref="MeterProviderBuilder"/> to chain the calls.</returns>
public static MeterProviderBuilder AddConsoleExporter(
this MeterProviderBuilder builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static OpenTelemetry.Logs.InMemoryExporterLoggingExtensions.AddInMemoryExporter(
static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, string? name, System.Collections.Generic.ICollection<OpenTelemetry.Metrics.Metric!>! exportedItems, System.Action<OpenTelemetry.Metrics.MetricReaderOptions!>? configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, string? name, System.Collections.Generic.ICollection<OpenTelemetry.Metrics.MetricSnapshot!>! exportedItems, System.Action<OpenTelemetry.Metrics.MetricReaderOptions!>? configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Collections.Generic.ICollection<OpenTelemetry.Metrics.Metric!>! exportedItems) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Collections.Generic.ICollection<OpenTelemetry.Metrics.Metric!>! exportedItems, System.Action<OpenTelemetry.Metrics.MetricReaderOptions!>? configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Collections.Generic.ICollection<OpenTelemetry.Metrics.Metric!>! exportedItems, System.Action<OpenTelemetry.Metrics.MetricReaderOptions!>! configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Collections.Generic.ICollection<OpenTelemetry.Metrics.MetricSnapshot!>! exportedItems) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Collections.Generic.ICollection<OpenTelemetry.Metrics.MetricSnapshot!>! exportedItems, System.Action<OpenTelemetry.Metrics.MetricReaderOptions!>? configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Metrics.InMemoryExporterMetricsExtensions.AddInMemoryExporter(this OpenTelemetry.Metrics.MeterProviderBuilder! builder, System.Collections.Generic.ICollection<OpenTelemetry.Metrics.MetricSnapshot!>! exportedItems, System.Action<OpenTelemetry.Metrics.MetricReaderOptions!>! configureMetricReader) -> OpenTelemetry.Metrics.MeterProviderBuilder!
static OpenTelemetry.Trace.InMemoryExporterHelperExtensions.AddInMemoryExporter(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Collections.Generic.ICollection<System.Diagnostics.Activity!>! exportedItems) -> OpenTelemetry.Trace.TracerProviderBuilder!
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static MeterProviderBuilder AddInMemoryExporter(this MeterProviderBuilder
public static MeterProviderBuilder AddInMemoryExporter(
this MeterProviderBuilder builder,
ICollection<Metric> exportedItems,
Action<MetricReaderOptions>? configureMetricReader)
Action<MetricReaderOptions> configureMetricReader)
=> AddInMemoryExporter(builder, name: null, exportedItems, configureMetricReader);

/// <summary>
Expand All @@ -51,9 +51,9 @@ public static MeterProviderBuilder AddInMemoryExporter(
/// Be aware that <see cref="Metric"/> may continue to be updated after export.
/// </remarks>
/// <param name="builder"><see cref="MeterProviderBuilder"/> builder to use.</param>
/// <param name="name">Name which is used when retrieving options.</param>
/// <param name="name">Optional name which is used when retrieving options.</param>
/// <param name="exportedItems">Collection which will be populated with the exported <see cref="Metric"/>.</param>
/// <param name="configureMetricReader">Callback action for configuring <see cref="MetricReaderOptions"/>.</param>
/// <param name="configureMetricReader">Optional callback action for configuring <see cref="MetricReaderOptions"/>.</param>
/// <returns>The instance of <see cref="MeterProviderBuilder"/> to chain the calls.</returns>
public static MeterProviderBuilder AddInMemoryExporter(
this MeterProviderBuilder builder,
Expand Down Expand Up @@ -108,7 +108,7 @@ public static MeterProviderBuilder AddInMemoryExporter(
public static MeterProviderBuilder AddInMemoryExporter(
this MeterProviderBuilder builder,
ICollection<MetricSnapshot> exportedItems,
Action<MetricReaderOptions>? configureMetricReader)
Action<MetricReaderOptions> configureMetricReader)
=> AddInMemoryExporter(builder, name: null, exportedItems, configureMetricReader);

/// <summary>
Expand All @@ -119,9 +119,9 @@ public static MeterProviderBuilder AddInMemoryExporter(
/// Use this if you need a copy of <see cref="Metric"/> that will not be updated after export.
/// </remarks>
/// <param name="builder"><see cref="MeterProviderBuilder"/> builder to use.</param>
/// <param name="name">Name which is used when retrieving options.</param>
/// <param name="name">Optional name which is used when retrieving options.</param>
/// <param name="exportedItems">Collection which will be populated with the exported <see cref="Metric"/> represented as <see cref="MetricSnapshot"/>.</param>
/// <param name="configureMetricReader">Callback action for configuring <see cref="MetricReaderOptions"/>.</param>
/// <param name="configureMetricReader">Optional callback action for configuring <see cref="MetricReaderOptions"/>.</param>
/// <returns>The instance of <see cref="MeterProviderBuilder"/> to chain the calls.</returns>
public static MeterProviderBuilder AddInMemoryExporter(
this MeterProviderBuilder builder,
Expand Down

0 comments on commit 9b83188

Please sign in to comment.