|
55 | 55 | import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder; |
56 | 56 | import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer; |
57 | 57 | import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider; |
| 58 | +import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; |
58 | 59 | import io.opentelemetry.sdk.autoconfigure.spi.internal.AutoConfigureListener; |
59 | 60 | import io.opentelemetry.sdk.common.CompletableResultCode; |
60 | 61 | import io.opentelemetry.sdk.logs.LogRecordProcessor; |
|
69 | 70 | import io.opentelemetry.sdk.trace.SdkTracerProviderBuilder; |
70 | 71 | import io.opentelemetry.sdk.trace.export.SpanExporter; |
71 | 72 | import io.opentelemetry.sdk.trace.samplers.SamplingDecision; |
72 | | -import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; |
73 | 73 | import java.io.File; |
74 | 74 | import java.util.ArrayList; |
75 | 75 | import java.util.Collections; |
@@ -275,7 +275,8 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) { |
275 | 275 | (metricExporter, configProperties) -> { |
276 | 276 | if (metricExporter |
277 | 277 | instanceof AzureMonitorMetricExporterProvider.MarkerMetricExporter) { |
278 | | - return buildMetricExporter(configuration, telemetryClient, metricFilters, configProperties); |
| 278 | + return buildMetricExporter( |
| 279 | + configuration, telemetryClient, metricFilters, configProperties); |
279 | 280 | } else { |
280 | 281 | return metricExporter; |
281 | 282 | } |
@@ -366,16 +367,20 @@ private static SpanExporter buildTraceExporter( |
366 | 367 | private static MetricExporter buildMetricExporter( |
367 | 368 | Configuration configuration, |
368 | 369 | TelemetryClient telemetryClient, |
369 | | - List<MetricFilter> metricFilters, ConfigProperties configProperties) { |
370 | | - |
| 370 | + List<MetricFilter> metricFilters, |
| 371 | + ConfigProperties configProperties) { |
| 372 | + |
371 | 373 | String otelMetricsEndpoint = configProperties.getString("otel.metrics.exporter.otlp.endpoint"); |
372 | 374 | String otelMetricsExporter = configProperties.getString("otel.metrics.exporter"); |
373 | | - Boolean otlpEnabled = (otelMetricsExporter != null && !otelMetricsExporter.isEmpty()) && |
374 | | - (otelMetricsEndpoint != null && !otelMetricsEndpoint.isEmpty()); |
| 375 | + Boolean otlpEnabled = |
| 376 | + (otelMetricsExporter != null && !otelMetricsExporter.isEmpty()) |
| 377 | + && (otelMetricsEndpoint != null && !otelMetricsEndpoint.isEmpty()); |
375 | 378 |
|
376 | 379 | MetricDataMapper mapper = |
377 | 380 | new MetricDataMapper( |
378 | | - telemetryClient::populateDefaults, configuration.preview.captureHttpServer4xxAsError, otlpEnabled); |
| 381 | + telemetryClient::populateDefaults, |
| 382 | + configuration.preview.captureHttpServer4xxAsError, |
| 383 | + otlpEnabled); |
379 | 384 | return new AgentMetricExporter( |
380 | 385 | metricFilters, mapper, telemetryClient.getMetricsBatchItemProcessor()); |
381 | 386 | } |
|
0 commit comments