Search in sources :

Example 11 with MetricExporter

use of io.opentelemetry.sdk.metrics.export.MetricExporter in project opentelemetry-java by open-telemetry.

the class OtlpExporterIntegrationTest method testOtlpGrpcMetricExport.

@ParameterizedTest
@ValueSource(strings = { "gzip", "none" })
void testOtlpGrpcMetricExport(String compression) {
    MetricExporter otlpGrpcMetricExporter = OtlpGrpcMetricExporter.builder().setEndpoint("http://" + collector.getHost() + ":" + collector.getMappedPort(COLLECTOR_OTLP_GRPC_PORT)).setCompression(compression).build();
    testMetricExport(otlpGrpcMetricExporter);
}
Also used : OtlpHttpMetricExporter(io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter) OtlpGrpcMetricExporter(io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter) MetricExporter(io.opentelemetry.sdk.metrics.export.MetricExporter) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 12 with MetricExporter

use of io.opentelemetry.sdk.metrics.export.MetricExporter in project opentelemetry-java by open-telemetry.

the class OtlpExporterIntegrationTest method testOtlpHttpMetricExport.

@ParameterizedTest
@ValueSource(strings = { "gzip", "none" })
void testOtlpHttpMetricExport(String compression) {
    MetricExporter otlpGrpcMetricExporter = OtlpHttpMetricExporter.builder().setEndpoint("http://" + collector.getHost() + ":" + collector.getMappedPort(COLLECTOR_OTLP_HTTP_PORT) + "/v1/metrics").setCompression(compression).build();
    testMetricExport(otlpGrpcMetricExporter);
}
Also used : OtlpHttpMetricExporter(io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter) OtlpGrpcMetricExporter(io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter) MetricExporter(io.opentelemetry.sdk.metrics.export.MetricExporter) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

MetricExporter (io.opentelemetry.sdk.metrics.export.MetricExporter)12 Test (org.junit.jupiter.api.Test)8 HashMap (java.util.HashMap)6 ConfigProperties (io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties)5 OtlpHttpMetricExporter (io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter)4 OtlpGrpcMetricExporter (io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter)4 LoggingMetricExporter (io.opentelemetry.exporter.logging.LoggingMetricExporter)2 SuppressLogger (io.opentelemetry.internal.testing.slf4j.SuppressLogger)2 ConfigurationException (io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException)2 LogExporter (io.opentelemetry.sdk.logs.export.LogExporter)2 SdkMeterProviderBuilder (io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder)2 MetricReaderFactory (io.opentelemetry.sdk.metrics.export.MetricReaderFactory)2 SpanExporter (io.opentelemetry.sdk.trace.export.SpanExporter)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 ValueSource (org.junit.jupiter.params.provider.ValueSource)2 RetryUtil (io.opentelemetry.exporter.internal.retry.RetryUtil)1 OtlpHttpMetricExporterBuilder (io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder)1 OtlpGrpcMetricExporterBuilder (io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporterBuilder)1 PrometheusHttpServer (io.opentelemetry.exporter.prometheus.PrometheusHttpServer)1 PrometheusHttpServerBuilder (io.opentelemetry.exporter.prometheus.PrometheusHttpServerBuilder)1