|
11 | 11 | import io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporterBuilder; |
12 | 12 | import io.opentelemetry.opencensusshim.internal.metrics.MetricAdapter; |
13 | 13 | import io.opentelemetry.sdk.OpenTelemetrySdk; |
14 | | -import io.opentelemetry.sdk.common.CompletableResultCode; |
15 | 14 | import io.opentelemetry.sdk.metrics.SdkMeterProvider; |
16 | 15 | import io.opentelemetry.sdk.metrics.data.AggregationTemporality; |
17 | 16 | import io.opentelemetry.sdk.metrics.data.MetricData; |
18 | 17 | import io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector; |
19 | 18 | import io.opentelemetry.sdk.metrics.export.MetricExporter; |
20 | 19 | import io.opentelemetry.sdk.metrics.export.PeriodicMetricReaderBuilder; |
21 | 20 | import io.opentelemetry.sdk.resources.Resource; |
22 | | -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; |
| 21 | +import io.opentelemetry.semconv.ServiceAttributes; |
| 22 | +import io.opentelemetry.semconv.TelemetryAttributes; |
23 | 23 | import lombok.Getter; |
24 | 24 | import lombok.extern.slf4j.Slf4j; |
25 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -111,9 +111,9 @@ void doEnable() { |
111 | 111 | enabled = true; |
112 | 112 | otlpMetricsExporterSettings = configuration.getExporters().getMetrics().getOtlp(); |
113 | 113 | AggregationTemporalitySelector aggregationTemporalitySelector = otlpMetricsExporterSettings.getPreferredTemporality() == AggregationTemporality.DELTA ? AggregationTemporalitySelector.deltaPreferred() : AggregationTemporalitySelector.alwaysCumulative(); |
114 | | - otelResource = Resource.create(Attributes.of(ResourceAttributes.SERVICE_NAME, configuration.getExporters() |
| 114 | + otelResource = Resource.create(Attributes.of(ServiceAttributes.SERVICE_NAME, configuration.getExporters() |
115 | 115 | .getMetrics() |
116 | | - .getServiceName(), AttributeKey.stringKey("inspectit.eum-server.version"), appStartupRunner.getServerVersion(), ResourceAttributes.TELEMETRY_SDK_VERSION, appStartupRunner.getOpenTelemetryVersion(), ResourceAttributes.TELEMETRY_SDK_LANGUAGE, "java", ResourceAttributes.TELEMETRY_SDK_NAME, "opentelemetry")); |
| 116 | + .getServiceName(), AttributeKey.stringKey("inspectit.eum-server.version"), appStartupRunner.getServerVersion(), TelemetryAttributes.TELEMETRY_SDK_VERSION, appStartupRunner.getOpenTelemetryVersion(), TelemetryAttributes.TELEMETRY_SDK_LANGUAGE, "java", TelemetryAttributes.TELEMETRY_SDK_NAME, "opentelemetry")); |
117 | 117 | String endpoint = configuration.getExporters().getMetrics().getOtlp().getEndpoint(); |
118 | 118 | // OTEL expects that the URI starts with 'http://' or 'https://' |
119 | 119 | if (!endpoint.startsWith("http")) { |
|
0 commit comments