Search in sources :

Example 1 with ResourceMetrics

use of io.opentelemetry.proto.metrics.v1.ResourceMetrics in project opentelemetry-java by open-telemetry.

the class OtlpExporterIntegrationTest method testMetricExport.

private static void testMetricExport(MetricExporter metricExporter) {
    MetricReaderFactory reader = PeriodicMetricReader.builder(metricExporter).setInterval(Duration.ofSeconds(5)).newMetricReaderFactory();
    SdkMeterProvider meterProvider = SdkMeterProvider.builder().setResource(RESOURCE).registerMetricReader(reader).build();
    Meter meter = meterProvider.meterBuilder(OtlpExporterIntegrationTest.class.getName()).build();
    LongCounter longCounter = meter.counterBuilder("my-counter").build();
    longCounter.add(100, Attributes.builder().put("key", "value").build());
    try {
        await().atMost(Duration.ofSeconds(30)).untilAsserted(() -> assertThat(grpcServer.metricRequests).hasSize(1));
    } finally {
        meterProvider.close();
    }
    ExportMetricsServiceRequest request = grpcServer.metricRequests.get(0);
    assertThat(request.getResourceMetricsCount()).isEqualTo(1);
    ResourceMetrics resourceMetrics = request.getResourceMetrics(0);
    assertThat(resourceMetrics.getResource().getAttributesList()).contains(KeyValue.newBuilder().setKey(ResourceAttributes.SERVICE_NAME.getKey()).setValue(AnyValue.newBuilder().setStringValue("integration test").build()).build());
    assertThat(resourceMetrics.getInstrumentationLibraryMetricsCount()).isEqualTo(1);
    InstrumentationLibraryMetrics ilMetrics = resourceMetrics.getInstrumentationLibraryMetrics(0);
    assertThat(ilMetrics.getInstrumentationLibrary().getName()).isEqualTo(OtlpExporterIntegrationTest.class.getName());
    assertThat(ilMetrics.getMetricsCount()).isEqualTo(1);
    Metric metric = ilMetrics.getMetrics(0);
    assertThat(metric.getName()).isEqualTo("my-counter");
    assertThat(metric.getDataCase()).isEqualTo(Metric.DataCase.SUM);
    Sum sum = metric.getSum();
    assertThat(sum.getAggregationTemporality()).isEqualTo(AggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE);
    assertThat(sum.getDataPointsCount()).isEqualTo(1);
    NumberDataPoint dataPoint = sum.getDataPoints(0);
    assertThat(dataPoint.getAsInt()).isEqualTo(100);
    assertThat(dataPoint.getAttributesList()).isEqualTo(Collections.singletonList(KeyValue.newBuilder().setKey("key").setValue(AnyValue.newBuilder().setStringValue("value").build()).build()));
}
Also used : ResourceMetrics(io.opentelemetry.proto.metrics.v1.ResourceMetrics) SdkMeterProvider(io.opentelemetry.sdk.metrics.SdkMeterProvider) Meter(io.opentelemetry.api.metrics.Meter) NumberDataPoint(io.opentelemetry.proto.metrics.v1.NumberDataPoint) MetricReaderFactory(io.opentelemetry.sdk.metrics.export.MetricReaderFactory) Metric(io.opentelemetry.proto.metrics.v1.Metric) Sum(io.opentelemetry.proto.metrics.v1.Sum) InstrumentationLibraryMetrics(io.opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics) LongCounter(io.opentelemetry.api.metrics.LongCounter) ExportMetricsServiceRequest(io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)

Example 2 with ResourceMetrics

use of io.opentelemetry.proto.metrics.v1.ResourceMetrics in project opentelemetry-java by open-telemetry.

the class FullConfigTest method configures.

@Test
void configures() throws Exception {
    Collection<String> fields = GlobalOpenTelemetry.get().getPropagators().getTextMapPropagator().fields();
    List<String> keys = new ArrayList<>();
    keys.addAll(W3CTraceContextPropagator.getInstance().fields());
    keys.addAll(W3CBaggagePropagator.getInstance().fields());
    keys.addAll(B3Propagator.injectingSingleHeader().fields());
    keys.addAll(B3Propagator.injectingMultiHeaders().fields());
    keys.addAll(JaegerPropagator.getInstance().fields());
    keys.addAll(OtTracePropagator.getInstance().fields());
    keys.addAll(AwsXrayPropagator.getInstance().fields());
    // Added by TestPropagatorProvider
    keys.add("test");
    assertThat(fields).containsExactlyInAnyOrderElementsOf(keys);
    GlobalOpenTelemetry.get().getMeterProvider().get("test").counterBuilder("test").build().add(1);
    GlobalOpenTelemetry.get().getTracer("test").spanBuilder("test").startSpan().setAttribute("cat", "meow").setAttribute("dog", "bark").end();
    Meter meter = GlobalOpenTelemetry.get().getMeter("test");
    meter.counterBuilder("my-metric").build().add(1, Attributes.builder().put("allowed", "bear").put("not allowed", "dog").build());
    meter.counterBuilder("my-other-metric").build().add(1);
    LogEmitter logEmitter = logEmitterProvider.get("test");
    logEmitter.logBuilder().setBody("debug log message").setSeverity(Severity.DEBUG).emit();
    logEmitter.logBuilder().setBody("info log message").setSeverity(Severity.INFO).emit();
    await().untilAsserted(() -> assertThat(otlpTraceRequests).hasSize(1));
    ExportTraceServiceRequest traceRequest = otlpTraceRequests.take();
    assertThat(traceRequest.getResourceSpans(0).getResource().getAttributesList()).contains(KeyValue.newBuilder().setKey("service.name").setValue(AnyValue.newBuilder().setStringValue("test").build()).build(), KeyValue.newBuilder().setKey("cat").setValue(AnyValue.newBuilder().setStringValue("meow").build()).build());
    io.opentelemetry.proto.trace.v1.Span span = traceRequest.getResourceSpans(0).getInstrumentationLibrarySpans(0).getSpans(0);
    // Dog dropped by attribute limit.
    assertThat(span.getAttributesList()).containsExactlyInAnyOrder(KeyValue.newBuilder().setKey("configured").setValue(AnyValue.newBuilder().setBoolValue(true).build()).build(), KeyValue.newBuilder().setKey("wrapped").setValue(AnyValue.newBuilder().setIntValue(1).build()).build(), KeyValue.newBuilder().setKey("cat").setValue(AnyValue.newBuilder().setStringValue("meow").build()).build());
    // await on assertions since metrics may come in different order for BatchSpanProcessor,
    // exporter, or the ones we
    // created in the test.
    await().untilAsserted(() -> {
        ExportMetricsServiceRequest metricRequest = otlpMetricsRequests.take();
        assertThat(metricRequest.getResourceMetrics(0).getResource().getAttributesList()).contains(KeyValue.newBuilder().setKey("service.name").setValue(AnyValue.newBuilder().setStringValue("test").build()).build(), KeyValue.newBuilder().setKey("cat").setValue(AnyValue.newBuilder().setStringValue("meow").build()).build());
        for (ResourceMetrics resourceMetrics : metricRequest.getResourceMetricsList()) {
            assertThat(resourceMetrics.getInstrumentationLibraryMetricsList()).anySatisfy(ilm -> assertThat(ilm.getInstrumentationLibrary().getName()).isEqualTo("test"));
            for (InstrumentationLibraryMetrics instrumentationLibraryMetrics : resourceMetrics.getInstrumentationLibraryMetricsList()) {
                for (Metric metric : instrumentationLibraryMetrics.getMetricsList()) {
                    // SPI was loaded
                    // MetricExporterCustomizer filters metrics not named my-metric
                    assertThat(metric.getName()).isEqualTo("my-metric");
                    // TestMeterProviderConfigurer configures a view that only passes on attribute
                    // named allowed
                    // configured-test
                    assertThat(getFirstDataPointLabels(metric)).contains(KeyValue.newBuilder().setKey("allowed").setValue(AnyValue.newBuilder().setStringValue("bear").build()).build());
                }
            }
        }
    });
    await().untilAsserted(() -> assertThat(otlpLogsRequests).hasSize(1));
    ExportLogsServiceRequest logRequest = otlpLogsRequests.take();
    assertThat(logRequest.getResourceLogs(0).getResource().getAttributesList()).contains(KeyValue.newBuilder().setKey("service.name").setValue(AnyValue.newBuilder().setStringValue("test").build()).build(), KeyValue.newBuilder().setKey("cat").setValue(AnyValue.newBuilder().setStringValue("meow").build()).build());
    // MetricExporterCustomizer filters logs not whose level is less than Severity.INFO
    LogRecord log = logRequest.getResourceLogs(0).getInstrumentationLibraryLogs(0).getLogRecords(0);
    assertThat(log.getBody().getStringValue()).isEqualTo("info log message");
    assertThat(log.getSeverityNumberValue()).isEqualTo(Severity.INFO.getSeverityNumber());
}
Also used : ExportTraceServiceRequest(io.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest) Meter(io.opentelemetry.api.metrics.Meter) ArrayList(java.util.ArrayList) InstrumentationLibraryMetrics(io.opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics) ExportLogsServiceRequest(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) ResourceMetrics(io.opentelemetry.proto.metrics.v1.ResourceMetrics) LogEmitter(io.opentelemetry.sdk.logs.LogEmitter) LogRecord(io.opentelemetry.proto.logs.v1.LogRecord) Metric(io.opentelemetry.proto.metrics.v1.Metric) ExportMetricsServiceRequest(io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) Test(org.junit.jupiter.api.Test)

Example 3 with ResourceMetrics

use of io.opentelemetry.proto.metrics.v1.ResourceMetrics in project opentelemetry-java by open-telemetry.

the class MetricsRequestMarshalerTest method protoResourceMetrics.

@Test
void protoResourceMetrics() {
    Resource resource = Resource.create(Attributes.of(stringKey("ka"), "va"), "http://resource.url");
    io.opentelemetry.proto.resource.v1.Resource resourceProto = io.opentelemetry.proto.resource.v1.Resource.newBuilder().addAllAttributes(singletonList(KeyValue.newBuilder().setKey("ka").setValue(stringValue("va")).build())).build();
    io.opentelemetry.proto.resource.v1.Resource emptyResourceProto = io.opentelemetry.proto.resource.v1.Resource.newBuilder().build();
    InstrumentationLibraryInfo instrumentationLibraryInfo = InstrumentationLibraryInfo.create("name", "version", "http://url");
    InstrumentationLibrary instrumentationLibraryProto = InstrumentationLibrary.newBuilder().setName("name").setVersion("version").build();
    InstrumentationLibrary emptyInstrumentationLibraryProto = InstrumentationLibrary.newBuilder().setName("").setVersion("").build();
    Metric metricDoubleSum = Metric.newBuilder().setName("name").setDescription("description").setUnit("1").setSum(Sum.newBuilder().setIsMonotonic(true).setAggregationTemporality(AGGREGATION_TEMPORALITY_CUMULATIVE).addDataPoints(NumberDataPoint.newBuilder().setStartTimeUnixNano(123).setTimeUnixNano(456).addAllAttributes(singletonList(KeyValue.newBuilder().setKey("k").setValue(stringValue("v")).build())).setAsDouble(5.0).build()).build()).build();
    assertThat(toProtoResourceMetrics(ImmutableList.of(MetricData.createDoubleSum(resource, instrumentationLibraryInfo, "name", "description", "1", ImmutableSumData.create(/* isMonotonic= */
    true, AggregationTemporality.CUMULATIVE, Collections.singletonList(ImmutableDoublePointData.create(123, 456, KV_ATTR, 5.0)))), MetricData.createDoubleSum(resource, instrumentationLibraryInfo, "name", "description", "1", ImmutableSumData.create(/* isMonotonic= */
    true, AggregationTemporality.CUMULATIVE, Collections.singletonList(ImmutableDoublePointData.create(123, 456, KV_ATTR, 5.0)))), MetricData.createDoubleSum(Resource.empty(), instrumentationLibraryInfo, "name", "description", "1", ImmutableSumData.create(/* isMonotonic= */
    true, AggregationTemporality.CUMULATIVE, Collections.singletonList(ImmutableDoublePointData.create(123, 456, KV_ATTR, 5.0)))), MetricData.createDoubleSum(Resource.empty(), InstrumentationLibraryInfo.empty(), "name", "description", "1", ImmutableSumData.create(/* isMonotonic= */
    true, AggregationTemporality.CUMULATIVE, Collections.singletonList(ImmutableDoublePointData.create(123, 456, KV_ATTR, 5.0))))))).satisfiesExactlyInAnyOrder(resourceMetrics -> {
        assertThat(resourceMetrics.getResource()).isEqualTo(resourceProto);
        assertThat(resourceMetrics.getSchemaUrl()).isEqualTo("http://resource.url");
        assertThat(resourceMetrics.getInstrumentationLibraryMetricsList()).containsExactlyInAnyOrder(InstrumentationLibraryMetrics.newBuilder().setInstrumentationLibrary(instrumentationLibraryProto).addAllMetrics(ImmutableList.of(metricDoubleSum, metricDoubleSum)).setSchemaUrl("http://url").build());
    }, resourceMetrics -> {
        assertThat(resourceMetrics.getResource()).isEqualTo(emptyResourceProto);
        assertThat(resourceMetrics.getInstrumentationLibraryMetricsList()).containsExactlyInAnyOrder(InstrumentationLibraryMetrics.newBuilder().setInstrumentationLibrary(emptyInstrumentationLibraryProto).addAllMetrics(singletonList(metricDoubleSum)).build(), InstrumentationLibraryMetrics.newBuilder().setInstrumentationLibrary(instrumentationLibraryProto).addAllMetrics(singletonList(metricDoubleSum)).setSchemaUrl("http://url").build());
    });
}
Also used : InstrumentationLibraryInfo(io.opentelemetry.sdk.common.InstrumentationLibraryInfo) Resource(io.opentelemetry.sdk.resources.Resource) Metric(io.opentelemetry.proto.metrics.v1.Metric) InstrumentationLibrary(io.opentelemetry.proto.common.v1.InstrumentationLibrary) Test(org.junit.jupiter.api.Test)

Example 4 with ResourceMetrics

use of io.opentelemetry.proto.metrics.v1.ResourceMetrics in project opentelemetry-java by open-telemetry.

the class OtlpHttpMetricExporterTest method exportAndAssertResult.

private static ExportMetricsServiceRequest exportAndAssertResult(OtlpHttpMetricExporter otlpHttpMetricExporter, boolean expectedResult) {
    List<MetricData> metrics = Collections.singletonList(generateFakeMetric());
    CompletableResultCode resultCode = otlpHttpMetricExporter.export(metrics);
    resultCode.join(10, TimeUnit.SECONDS);
    assertThat(resultCode.isSuccess()).isEqualTo(expectedResult);
    List<ResourceMetrics> resourceMetrics = Arrays.stream(ResourceMetricsMarshaler.create(metrics)).map(marshaler -> {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            marshaler.writeBinaryTo(bos);
            return ResourceMetrics.parseFrom(bos.toByteArray());
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }).collect(Collectors.toList());
    return ExportMetricsServiceRequest.newBuilder().addAllResourceMetrics(resourceMetrics).build();
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Attributes(io.opentelemetry.api.common.Attributes) ResourceMetricsMarshaler(io.opentelemetry.exporter.internal.otlp.metrics.ResourceMetricsMarshaler) InetAddress(java.net.InetAddress) Duration(java.time.Duration) Level(org.slf4j.event.Level) GzipSource(okio.GzipSource) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) HttpResponse(com.linecorp.armeria.common.HttpResponse) MockWebServerExtension(com.linecorp.armeria.testing.junit5.server.mock.MockWebServerExtension) Status(com.google.rpc.Status) HttpMethod(com.linecorp.armeria.common.HttpMethod) Collectors(java.util.stream.Collectors) ImmutableLongPointData(io.opentelemetry.sdk.metrics.internal.data.ImmutableLongPointData) StandardCharsets(java.nio.charset.StandardCharsets) OkHttpExporter(io.opentelemetry.exporter.internal.okhttp.OkHttpExporter) UncheckedIOException(java.io.UncheckedIOException) Test(org.junit.jupiter.api.Test) List(java.util.List) LogCapturer(io.github.netmikey.logunit.api.LogCapturer) HeldCertificate(okhttp3.tls.HeldCertificate) ExportMetricsServiceResponse(io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse) MetricData(io.opentelemetry.sdk.metrics.data.MetricData) Assertions.assertThatCode(org.assertj.core.api.Assertions.assertThatCode) ServerBuilder(com.linecorp.armeria.server.ServerBuilder) AggregatedHttpRequest(com.linecorp.armeria.common.AggregatedHttpRequest) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Resource(io.opentelemetry.sdk.resources.Resource) MediaType(com.linecorp.armeria.common.MediaType) InstrumentationLibraryInfo(io.opentelemetry.sdk.common.InstrumentationLibraryInfo) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) RetryPolicy(io.opentelemetry.exporter.internal.retry.RetryPolicy) HttpStatus(com.linecorp.armeria.common.HttpStatus) RegisterExtension(org.junit.jupiter.api.extension.RegisterExtension) LoggingEvent(org.slf4j.event.LoggingEvent) ImmutableSumData(io.opentelemetry.sdk.metrics.internal.data.ImmutableSumData) Buffer(okio.Buffer) AggregationTemporality(io.opentelemetry.sdk.metrics.data.AggregationTemporality) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) ExportMetricsServiceRequest(io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) TimeUnit(java.util.concurrent.TimeUnit) RetryUtil(io.opentelemetry.exporter.internal.retry.RetryUtil) AttributeKey.stringKey(io.opentelemetry.api.common.AttributeKey.stringKey) ResourceMetrics(io.opentelemetry.proto.metrics.v1.ResourceMetrics) Message(com.google.protobuf.Message) Collections(java.util.Collections) CompletableResultCode(io.opentelemetry.sdk.common.CompletableResultCode) ResourceMetrics(io.opentelemetry.proto.metrics.v1.ResourceMetrics) CompletableResultCode(io.opentelemetry.sdk.common.CompletableResultCode) UncheckedIOException(java.io.UncheckedIOException) ByteArrayOutputStream(java.io.ByteArrayOutputStream) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) MetricData(io.opentelemetry.sdk.metrics.data.MetricData)

Example 5 with ResourceMetrics

use of io.opentelemetry.proto.metrics.v1.ResourceMetrics in project opentelemetry-java-instrumentation by open-telemetry.

the class AgentTestingExporterAccess method getExportedMetrics.

@SuppressWarnings("unchecked")
public static List<MetricData> getExportedMetrics() {
    List<byte[]> exportRequests;
    try {
        exportRequests = (List<byte[]>) getMetricExportRequests.invokeExact();
    } catch (Throwable t) {
        throw new AssertionError("Could not invoke getMetricExportRequests", t);
    }
    List<ResourceMetrics> allResourceMetrics = exportRequests.stream().map(serialized -> {
        try {
            return ExportMetricsServiceRequest.parseFrom(serialized);
        } catch (InvalidProtocolBufferException e) {
            throw new AssertionError(e);
        }
    }).flatMap(request -> request.getResourceMetricsList().stream()).collect(toList());
    List<MetricData> metrics = new ArrayList<>();
    for (ResourceMetrics resourceMetrics : allResourceMetrics) {
        Resource resource = resourceMetrics.getResource();
        for (InstrumentationLibraryMetrics ilMetrics : resourceMetrics.getInstrumentationLibraryMetricsList()) {
            InstrumentationLibrary instrumentationLibrary = ilMetrics.getInstrumentationLibrary();
            for (Metric metric : ilMetrics.getMetricsList()) {
                metrics.add(createMetricData(metric, io.opentelemetry.sdk.resources.Resource.create(fromProto(resource.getAttributesList())), InstrumentationLibraryInfo.create(instrumentationLibrary.getName(), instrumentationLibrary.getVersion())));
            }
        }
    }
    return metrics;
}
Also used : TraceFlags(io.opentelemetry.api.trace.TraceFlags) LongPointData(io.opentelemetry.sdk.metrics.data.LongPointData) KeyValue(io.opentelemetry.proto.common.v1.KeyValue) EventData(io.opentelemetry.sdk.trace.data.EventData) Sum(io.opentelemetry.proto.metrics.v1.Sum) StatusCode(io.opentelemetry.api.trace.StatusCode) ImmutableSummaryPointData(io.opentelemetry.sdk.metrics.internal.data.ImmutableSummaryPointData) Attributes(io.opentelemetry.api.common.Attributes) ResourceLogs(io.opentelemetry.proto.logs.v1.ResourceLogs) ResourceSpans(io.opentelemetry.proto.trace.v1.ResourceSpans) Resource(io.opentelemetry.proto.resource.v1.Resource) LogDataBuilder(io.opentelemetry.sdk.logs.data.LogDataBuilder) AttributeKey.stringArrayKey(io.opentelemetry.api.common.AttributeKey.stringArrayKey) ExportLogsServiceRequest(io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) ValueAtPercentile(io.opentelemetry.sdk.metrics.data.ValueAtPercentile) SpanContext(io.opentelemetry.api.trace.SpanContext) SummaryPointData(io.opentelemetry.sdk.metrics.data.SummaryPointData) MethodHandles(java.lang.invoke.MethodHandles) Collection(java.util.Collection) AttributeKey.doubleArrayKey(io.opentelemetry.api.common.AttributeKey.doubleArrayKey) SpanKind(io.opentelemetry.api.trace.SpanKind) Collectors(java.util.stream.Collectors) ArrayValue(io.opentelemetry.proto.common.v1.ArrayValue) List(java.util.List) InstrumentationLibraryMetrics(io.opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics) ExportTraceServiceRequest(io.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest) SpanData(io.opentelemetry.sdk.trace.data.SpanData) AttributeKey.longArrayKey(io.opentelemetry.api.common.AttributeKey.longArrayKey) AnyValue(io.opentelemetry.proto.common.v1.AnyValue) MetricData(io.opentelemetry.sdk.metrics.data.MetricData) Pattern(java.util.regex.Pattern) ImmutableValueAtPercentile(io.opentelemetry.sdk.metrics.internal.data.ImmutableValueAtPercentile) HistogramDataPoint(io.opentelemetry.proto.metrics.v1.HistogramDataPoint) MethodHandle(java.lang.invoke.MethodHandle) StatusData(io.opentelemetry.sdk.trace.data.StatusData) InstrumentationLibrarySpans(io.opentelemetry.proto.trace.v1.InstrumentationLibrarySpans) ImmutableSummaryData(io.opentelemetry.sdk.metrics.internal.data.ImmutableSummaryData) InstrumentationLibraryInfo(io.opentelemetry.sdk.common.InstrumentationLibraryInfo) ArrayList(java.util.ArrayList) TraceState(io.opentelemetry.api.trace.TraceState) Metric(io.opentelemetry.proto.metrics.v1.Metric) DoublePointData(io.opentelemetry.sdk.metrics.data.DoublePointData) HistogramPointData(io.opentelemetry.sdk.metrics.data.HistogramPointData) TraceStateBuilder(io.opentelemetry.api.trace.TraceStateBuilder) LogData(io.opentelemetry.sdk.logs.data.LogData) ImmutableGaugeData(io.opentelemetry.sdk.metrics.internal.data.ImmutableGaugeData) Severity(io.opentelemetry.sdk.logs.data.Severity) ImmutableSumData(io.opentelemetry.sdk.metrics.internal.data.ImmutableSumData) AggregationTemporality(io.opentelemetry.sdk.metrics.data.AggregationTemporality) LogRecord(io.opentelemetry.proto.logs.v1.LogRecord) SeverityNumber(io.opentelemetry.proto.logs.v1.SeverityNumber) ExportMetricsServiceRequest(io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) Span(io.opentelemetry.proto.trace.v1.Span) AttributesBuilder(io.opentelemetry.api.common.AttributesBuilder) NumberDataPoint(io.opentelemetry.proto.metrics.v1.NumberDataPoint) TimeUnit(java.util.concurrent.TimeUnit) ImmutableHistogramPointData(io.opentelemetry.sdk.metrics.internal.data.ImmutableHistogramPointData) Collectors.toList(java.util.stream.Collectors.toList) MethodType(java.lang.invoke.MethodType) InstrumentationLibrary(io.opentelemetry.proto.common.v1.InstrumentationLibrary) ResourceMetrics(io.opentelemetry.proto.metrics.v1.ResourceMetrics) InstrumentationLibraryLogs(io.opentelemetry.proto.logs.v1.InstrumentationLibraryLogs) AttributeKey.booleanArrayKey(io.opentelemetry.api.common.AttributeKey.booleanArrayKey) ImmutableHistogramData(io.opentelemetry.sdk.metrics.internal.data.ImmutableHistogramData) LinkData(io.opentelemetry.sdk.trace.data.LinkData) SummaryDataPoint(io.opentelemetry.proto.metrics.v1.SummaryDataPoint) Status(io.opentelemetry.proto.trace.v1.Status) TestSpanData(io.opentelemetry.sdk.testing.trace.TestSpanData) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) ArrayList(java.util.ArrayList) Resource(io.opentelemetry.proto.resource.v1.Resource) InstrumentationLibraryMetrics(io.opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics) ResourceMetrics(io.opentelemetry.proto.metrics.v1.ResourceMetrics) Metric(io.opentelemetry.proto.metrics.v1.Metric) MetricData(io.opentelemetry.sdk.metrics.data.MetricData) InstrumentationLibrary(io.opentelemetry.proto.common.v1.InstrumentationLibrary)

Aggregations

ExportMetricsServiceRequest (io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)4 Metric (io.opentelemetry.proto.metrics.v1.Metric)4 ResourceMetrics (io.opentelemetry.proto.metrics.v1.ResourceMetrics)4 InstrumentationLibraryMetrics (io.opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics)3 InstrumentationLibraryInfo (io.opentelemetry.sdk.common.InstrumentationLibraryInfo)3 Test (org.junit.jupiter.api.Test)3 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)2 Attributes (io.opentelemetry.api.common.Attributes)2 Meter (io.opentelemetry.api.metrics.Meter)2 ExportLogsServiceRequest (io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)2 ExportTraceServiceRequest (io.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)2 InstrumentationLibrary (io.opentelemetry.proto.common.v1.InstrumentationLibrary)2 LogRecord (io.opentelemetry.proto.logs.v1.LogRecord)2 AggregationTemporality (io.opentelemetry.sdk.metrics.data.AggregationTemporality)2 MetricData (io.opentelemetry.sdk.metrics.data.MetricData)2 ImmutableSumData (io.opentelemetry.sdk.metrics.internal.data.ImmutableSumData)2 Resource (io.opentelemetry.sdk.resources.Resource)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 TimeUnit (java.util.concurrent.TimeUnit)2