mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish "Add service connection from OpenTelemetry Collector"
See gh-35082
This commit is contained in:
parent
6997277f75
commit
c387c87fda
@ -22,10 +22,14 @@ import org.springframework.boot.autoconfigure.service.connection.ConnectionDetai
|
|||||||
* Details required to establish a connection to a OpenTelemetry Collector service.
|
* Details required to establish a connection to a OpenTelemetry Collector service.
|
||||||
*
|
*
|
||||||
* @author Eddú Meléndez
|
* @author Eddú Meléndez
|
||||||
* @since 3.1.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
public interface OtlpConnectionDetails extends ConnectionDetails {
|
public interface OtlpMetricsConnectionDetails extends ConnectionDetails {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address to where metrics will be published.
|
||||||
|
* @return the address to where metrics will be published
|
||||||
|
*/
|
||||||
String getUrl();
|
String getUrl();
|
||||||
|
|
||||||
}
|
}
|
@ -50,17 +50,24 @@ import org.springframework.core.env.Environment;
|
|||||||
@EnableConfigurationProperties({ OtlpProperties.class, OpenTelemetryProperties.class })
|
@EnableConfigurationProperties({ OtlpProperties.class, OpenTelemetryProperties.class })
|
||||||
public class OtlpMetricsExportAutoConfiguration {
|
public class OtlpMetricsExportAutoConfiguration {
|
||||||
|
|
||||||
|
private final OtlpProperties properties;
|
||||||
|
|
||||||
|
OtlpMetricsExportAutoConfiguration(OtlpProperties properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(OtlpConnectionDetails.class)
|
@ConditionalOnMissingBean(OtlpMetricsConnectionDetails.class)
|
||||||
public OtlpConnectionDetails otlpConnectionDetails(OtlpProperties properties) {
|
OtlpMetricsConnectionDetails otlpMetricsConnectionDetails() {
|
||||||
return new PropertiesOtlpConnectionDetails(properties);
|
return new PropertiesOtlpMetricsConnectionDetails(this.properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean
|
@ConditionalOnMissingBean
|
||||||
OtlpConfig otlpConfig(OtlpProperties properties, OpenTelemetryProperties openTelemetryProperties,
|
OtlpConfig otlpConfig(OpenTelemetryProperties openTelemetryProperties,
|
||||||
OtlpConnectionDetails connectionDetails, Environment environment) {
|
OtlpMetricsConnectionDetails connectionDetails, Environment environment) {
|
||||||
return new OtlpPropertiesConfigAdapter(properties, openTelemetryProperties, connectionDetails, environment);
|
return new OtlpPropertiesConfigAdapter(this.properties, openTelemetryProperties, connectionDetails,
|
||||||
|
environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ -70,13 +77,13 @@ public class OtlpMetricsExportAutoConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adapts {@link OtlpProperties} to {@link OtlpConnectionDetails}.
|
* Adapts {@link OtlpProperties} to {@link OtlpMetricsConnectionDetails}.
|
||||||
*/
|
*/
|
||||||
static class PropertiesOtlpConnectionDetails implements OtlpConnectionDetails {
|
static class PropertiesOtlpMetricsConnectionDetails implements OtlpMetricsConnectionDetails {
|
||||||
|
|
||||||
private final OtlpProperties properties;
|
private final OtlpProperties properties;
|
||||||
|
|
||||||
PropertiesOtlpConnectionDetails(OtlpProperties properties) {
|
PropertiesOtlpMetricsConnectionDetails(OtlpProperties properties) {
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,12 +45,12 @@ class OtlpPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter<Ot
|
|||||||
|
|
||||||
private final OpenTelemetryProperties openTelemetryProperties;
|
private final OpenTelemetryProperties openTelemetryProperties;
|
||||||
|
|
||||||
private final OtlpConnectionDetails connectionDetails;
|
private final OtlpMetricsConnectionDetails connectionDetails;
|
||||||
|
|
||||||
private final Environment environment;
|
private final Environment environment;
|
||||||
|
|
||||||
OtlpPropertiesConfigAdapter(OtlpProperties properties, OpenTelemetryProperties openTelemetryProperties,
|
OtlpPropertiesConfigAdapter(OtlpProperties properties, OpenTelemetryProperties openTelemetryProperties,
|
||||||
OtlpConnectionDetails connectionDetails, Environment environment) {
|
OtlpMetricsConnectionDetails connectionDetails, Environment environment) {
|
||||||
super(properties);
|
super(properties);
|
||||||
this.connectionDetails = connectionDetails;
|
this.connectionDetails = connectionDetails;
|
||||||
this.openTelemetryProperties = openTelemetryProperties;
|
this.openTelemetryProperties = openTelemetryProperties;
|
||||||
|
@ -16,24 +16,17 @@
|
|||||||
|
|
||||||
package org.springframework.boot.actuate.autoconfigure.tracing.otlp;
|
package org.springframework.boot.actuate.autoconfigure.tracing.otlp;
|
||||||
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import io.micrometer.tracing.otel.bridge.OtelTracer;
|
import io.micrometer.tracing.otel.bridge.OtelTracer;
|
||||||
import io.opentelemetry.api.OpenTelemetry;
|
import io.opentelemetry.api.OpenTelemetry;
|
||||||
import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter;
|
import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter;
|
||||||
import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder;
|
|
||||||
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;
|
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;
|
||||||
import io.opentelemetry.sdk.trace.SdkTracerProvider;
|
import io.opentelemetry.sdk.trace.SdkTracerProvider;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.tracing.ConditionalOnEnabledTracing;
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link EnableAutoConfiguration Auto-configuration} for OTLP. Brave does not support
|
* {@link EnableAutoConfiguration Auto-configuration} for OTLP. Brave does not support
|
||||||
@ -54,48 +47,7 @@ import org.springframework.context.annotation.Bean;
|
|||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@ConditionalOnClass({ OtelTracer.class, SdkTracerProvider.class, OpenTelemetry.class, OtlpHttpSpanExporter.class })
|
@ConditionalOnClass({ OtelTracer.class, SdkTracerProvider.class, OpenTelemetry.class, OtlpHttpSpanExporter.class })
|
||||||
@EnableConfigurationProperties(OtlpProperties.class)
|
@EnableConfigurationProperties(OtlpProperties.class)
|
||||||
|
@Import({ OtlpTracingConfigurations.ConnectionDetails.class, OtlpTracingConfigurations.Exporters.class })
|
||||||
public class OtlpAutoConfiguration {
|
public class OtlpAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
|
||||||
@ConditionalOnMissingBean(OtlpTracingConnectionDetails.class)
|
|
||||||
@ConditionalOnProperty(prefix = "management.otlp.tracing", name = "endpoint")
|
|
||||||
OtlpTracingConnectionDetails otlpTracingConnectionDetails(OtlpProperties properties) {
|
|
||||||
return new PropertiesOtlpTracingConnectionDetails(properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
@ConditionalOnMissingBean(value = OtlpHttpSpanExporter.class,
|
|
||||||
type = "io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter")
|
|
||||||
@ConditionalOnBean(OtlpTracingConnectionDetails.class)
|
|
||||||
@ConditionalOnEnabledTracing
|
|
||||||
OtlpHttpSpanExporter otlpHttpSpanExporter(OtlpProperties properties,
|
|
||||||
OtlpTracingConnectionDetails connectionDetails) {
|
|
||||||
OtlpHttpSpanExporterBuilder builder = OtlpHttpSpanExporter.builder()
|
|
||||||
.setEndpoint(connectionDetails.getEndpoint())
|
|
||||||
.setTimeout(properties.getTimeout())
|
|
||||||
.setCompression(properties.getCompression().name().toLowerCase());
|
|
||||||
for (Entry<String, String> header : properties.getHeaders().entrySet()) {
|
|
||||||
builder.addHeader(header.getKey(), header.getValue());
|
|
||||||
}
|
|
||||||
return builder.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adapts {@link OtlpProperties} to {@link OtlpTracingConnectionDetails}.
|
|
||||||
*/
|
|
||||||
static class PropertiesOtlpTracingConnectionDetails implements OtlpTracingConnectionDetails {
|
|
||||||
|
|
||||||
private final OtlpProperties properties;
|
|
||||||
|
|
||||||
PropertiesOtlpTracingConnectionDetails(OtlpProperties properties) {
|
|
||||||
this.properties = properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getEndpoint() {
|
|
||||||
return this.properties.getEndpoint();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,93 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012-2023 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.springframework.boot.actuate.autoconfigure.tracing.otlp;
|
||||||
|
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter;
|
||||||
|
import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder;
|
||||||
|
|
||||||
|
import org.springframework.boot.actuate.autoconfigure.tracing.ConditionalOnEnabledTracing;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configurations imported by {@link OtlpAutoConfiguration}.
|
||||||
|
*
|
||||||
|
* @author Moritz Halbritter
|
||||||
|
*/
|
||||||
|
final class OtlpTracingConfigurations {
|
||||||
|
|
||||||
|
private OtlpTracingConfigurations() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Configuration(proxyBeanMethods = false)
|
||||||
|
static class ConnectionDetails {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean(OtlpTracingConnectionDetails.class)
|
||||||
|
@ConditionalOnProperty(prefix = "management.otlp.tracing", name = "endpoint")
|
||||||
|
OtlpTracingConnectionDetails otlpTracingConnectionDetails(OtlpProperties properties) {
|
||||||
|
return new PropertiesOtlpTracingConnectionDetails(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adapts {@link OtlpProperties} to {@link OtlpTracingConnectionDetails}.
|
||||||
|
*/
|
||||||
|
static class PropertiesOtlpTracingConnectionDetails implements OtlpTracingConnectionDetails {
|
||||||
|
|
||||||
|
private final OtlpProperties properties;
|
||||||
|
|
||||||
|
PropertiesOtlpTracingConnectionDetails(OtlpProperties properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getEndpoint() {
|
||||||
|
return this.properties.getEndpoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Configuration(proxyBeanMethods = false)
|
||||||
|
static class Exporters {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean(value = OtlpHttpSpanExporter.class,
|
||||||
|
type = "io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter")
|
||||||
|
@ConditionalOnBean(OtlpTracingConnectionDetails.class)
|
||||||
|
@ConditionalOnEnabledTracing
|
||||||
|
OtlpHttpSpanExporter otlpHttpSpanExporter(OtlpProperties properties,
|
||||||
|
OtlpTracingConnectionDetails connectionDetails) {
|
||||||
|
OtlpHttpSpanExporterBuilder builder = OtlpHttpSpanExporter.builder()
|
||||||
|
.setEndpoint(connectionDetails.getEndpoint())
|
||||||
|
.setTimeout(properties.getTimeout())
|
||||||
|
.setCompression(properties.getCompression().name().toLowerCase());
|
||||||
|
for (Entry<String, String> header : properties.getHeaders().entrySet()) {
|
||||||
|
builder.addHeader(header.getKey(), header.getValue());
|
||||||
|
}
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -22,10 +22,14 @@ import org.springframework.boot.autoconfigure.service.connection.ConnectionDetai
|
|||||||
* Details required to establish a connection to a OpenTelemetry service.
|
* Details required to establish a connection to a OpenTelemetry service.
|
||||||
*
|
*
|
||||||
* @author Eddú Meléndez
|
* @author Eddú Meléndez
|
||||||
* @since 3.1.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
public interface OtlpTracingConnectionDetails extends ConnectionDetails {
|
public interface OtlpTracingConnectionDetails extends ConnectionDetails {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address to where metrics will be published.
|
||||||
|
* @return the address to where metrics will be published
|
||||||
|
*/
|
||||||
String getEndpoint();
|
String getEndpoint();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import io.micrometer.registry.otlp.OtlpConfig;
|
|||||||
import io.micrometer.registry.otlp.OtlpMeterRegistry;
|
import io.micrometer.registry.otlp.OtlpMeterRegistry;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration.PropertiesOtlpMetricsConnectionDetails;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
@ -86,16 +87,15 @@ class OtlpMetricsExportAutoConfigurationTests {
|
|||||||
@Test
|
@Test
|
||||||
void definesPropertiesBasedConnectionDetailsByDefault() {
|
void definesPropertiesBasedConnectionDetailsByDefault() {
|
||||||
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
|
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
|
||||||
.run((context) -> assertThat(context)
|
.run((context) -> assertThat(context).hasSingleBean(PropertiesOtlpMetricsConnectionDetails.class));
|
||||||
.hasSingleBean(OtlpMetricsExportAutoConfiguration.PropertiesOtlpConnectionDetails.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testConnectionFactoryWithOverridesWhenUsingCustomConnectionDetails() {
|
void testConnectionFactoryWithOverridesWhenUsingCustomConnectionDetails() {
|
||||||
this.contextRunner.withUserConfiguration(BaseConfiguration.class, ConnectionDetailsConfiguration.class)
|
this.contextRunner.withUserConfiguration(BaseConfiguration.class, ConnectionDetailsConfiguration.class)
|
||||||
.run((context) -> {
|
.run((context) -> {
|
||||||
assertThat(context).hasSingleBean(OtlpConnectionDetails.class)
|
assertThat(context).hasSingleBean(OtlpMetricsConnectionDetails.class)
|
||||||
.doesNotHaveBean(OtlpMetricsExportAutoConfiguration.PropertiesOtlpConnectionDetails.class);
|
.doesNotHaveBean(PropertiesOtlpMetricsConnectionDetails.class);
|
||||||
OtlpConfig config = context.getBean(OtlpConfig.class);
|
OtlpConfig config = context.getBean(OtlpConfig.class);
|
||||||
assertThat(config.url()).isEqualTo("http://localhost:12345/v1/metrics");
|
assertThat(config.url()).isEqualTo("http://localhost:12345/v1/metrics");
|
||||||
});
|
});
|
||||||
@ -137,7 +137,7 @@ class OtlpMetricsExportAutoConfigurationTests {
|
|||||||
static class ConnectionDetailsConfiguration {
|
static class ConnectionDetailsConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
OtlpConnectionDetails otlpConnectionDetails() {
|
OtlpMetricsConnectionDetails otlpConnectionDetails() {
|
||||||
return () -> "http://localhost:12345/v1/metrics";
|
return () -> "http://localhost:12345/v1/metrics";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import io.micrometer.registry.otlp.AggregationTemporality;
|
|||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration.PropertiesOtlpConnectionDetails;
|
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration.PropertiesOtlpMetricsConnectionDetails;
|
||||||
import org.springframework.boot.actuate.autoconfigure.opentelemetry.OpenTelemetryProperties;
|
import org.springframework.boot.actuate.autoconfigure.opentelemetry.OpenTelemetryProperties;
|
||||||
import org.springframework.mock.env.MockEnvironment;
|
import org.springframework.mock.env.MockEnvironment;
|
||||||
|
|
||||||
@ -45,14 +45,14 @@ class OtlpPropertiesConfigAdapterTests {
|
|||||||
|
|
||||||
private MockEnvironment environment;
|
private MockEnvironment environment;
|
||||||
|
|
||||||
private OtlpConnectionDetails connectionDetails;
|
private OtlpMetricsConnectionDetails connectionDetails;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setUp() {
|
void setUp() {
|
||||||
this.properties = new OtlpProperties();
|
this.properties = new OtlpProperties();
|
||||||
this.openTelemetryProperties = new OpenTelemetryProperties();
|
this.openTelemetryProperties = new OpenTelemetryProperties();
|
||||||
this.environment = new MockEnvironment();
|
this.environment = new MockEnvironment();
|
||||||
this.connectionDetails = new PropertiesOtlpConnectionDetails(this.properties);
|
this.connectionDetails = new PropertiesOtlpMetricsConnectionDetails(this.properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -22,6 +22,7 @@ import io.opentelemetry.sdk.trace.export.SpanExporter;
|
|||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpTracingConfigurations.ConnectionDetails.PropertiesOtlpTracingConnectionDetails;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||||
import org.springframework.boot.test.context.FilteredClassLoader;
|
import org.springframework.boot.test.context.FilteredClassLoader;
|
||||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||||
@ -111,15 +112,14 @@ class OtlpAutoConfigurationTests {
|
|||||||
@Test
|
@Test
|
||||||
void definesPropertiesBasedConnectionDetailsByDefault() {
|
void definesPropertiesBasedConnectionDetailsByDefault() {
|
||||||
this.contextRunner.withPropertyValues("management.otlp.tracing.endpoint=http://localhost:4318/v1/traces")
|
this.contextRunner.withPropertyValues("management.otlp.tracing.endpoint=http://localhost:4318/v1/traces")
|
||||||
.run((context) -> assertThat(context)
|
.run((context) -> assertThat(context).hasSingleBean(PropertiesOtlpTracingConnectionDetails.class));
|
||||||
.hasSingleBean(OtlpAutoConfiguration.PropertiesOtlpTracingConnectionDetails.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testConnectionFactoryWithOverridesWhenUsingCustomConnectionDetails() {
|
void testConnectionFactoryWithOverridesWhenUsingCustomConnectionDetails() {
|
||||||
this.contextRunner.withUserConfiguration(ConnectionDetailsConfiguration.class).run((context) -> {
|
this.contextRunner.withUserConfiguration(ConnectionDetailsConfiguration.class).run((context) -> {
|
||||||
assertThat(context).hasSingleBean(OtlpTracingConnectionDetails.class)
|
assertThat(context).hasSingleBean(OtlpTracingConnectionDetails.class)
|
||||||
.doesNotHaveBean(OtlpAutoConfiguration.PropertiesOtlpTracingConnectionDetails.class);
|
.doesNotHaveBean(PropertiesOtlpTracingConnectionDetails.class);
|
||||||
OtlpHttpSpanExporter otlpHttpSpanExporter = context.getBean(OtlpHttpSpanExporter.class);
|
OtlpHttpSpanExporter otlpHttpSpanExporter = context.getBean(OtlpHttpSpanExporter.class);
|
||||||
assertThat(otlpHttpSpanExporter).extracting("delegate.httpSender.url")
|
assertThat(otlpHttpSpanExporter).extracting("delegate.httpSender.url")
|
||||||
.isEqualTo(HttpUrl.get("http://localhost:12345/v1/traces"));
|
.isEqualTo(HttpUrl.get("http://localhost:12345/v1/traces"));
|
||||||
|
@ -16,40 +16,40 @@
|
|||||||
|
|
||||||
package org.springframework.boot.docker.compose.service.connection.otlp;
|
package org.springframework.boot.docker.compose.service.connection.otlp;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpConnectionDetails;
|
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsConnectionDetails;
|
||||||
import org.springframework.boot.docker.compose.core.RunningService;
|
import org.springframework.boot.docker.compose.core.RunningService;
|
||||||
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory;
|
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory;
|
||||||
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource;
|
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link DockerComposeConnectionDetailsFactory} to create {@link OtlpConnectionDetails}
|
* {@link DockerComposeConnectionDetailsFactory} to create
|
||||||
* for a {@code otlp} service.
|
* {@link OtlpMetricsConnectionDetails} for a {@code OTLP} service.
|
||||||
*
|
*
|
||||||
* @author Eddú Meléndez
|
* @author Eddú Meléndez
|
||||||
*/
|
*/
|
||||||
class OpenTelemetryDockerComposeConnectionDetailsFactory
|
class OpenTelemetryMetricsDockerComposeConnectionDetailsFactory
|
||||||
extends DockerComposeConnectionDetailsFactory<OtlpConnectionDetails> {
|
extends DockerComposeConnectionDetailsFactory<OtlpMetricsConnectionDetails> {
|
||||||
|
|
||||||
private static final int OTLP_PORT = 4318;
|
private static final int OTLP_PORT = 4318;
|
||||||
|
|
||||||
OpenTelemetryDockerComposeConnectionDetailsFactory() {
|
OpenTelemetryMetricsDockerComposeConnectionDetailsFactory() {
|
||||||
super("otel/opentelemetry-collector-contrib",
|
super("otel/opentelemetry-collector-contrib",
|
||||||
"org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration");
|
"org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected OtlpConnectionDetails getDockerComposeConnectionDetails(DockerComposeConnectionSource source) {
|
protected OtlpMetricsConnectionDetails getDockerComposeConnectionDetails(DockerComposeConnectionSource source) {
|
||||||
return new OpenTelemetryContainerConnectionDetails(source.getRunningService());
|
return new OpenTelemetryContainerMetricsConnectionDetails(source.getRunningService());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class OpenTelemetryContainerConnectionDetails extends DockerComposeConnectionDetails
|
private static final class OpenTelemetryContainerMetricsConnectionDetails extends DockerComposeConnectionDetails
|
||||||
implements OtlpConnectionDetails {
|
implements OtlpMetricsConnectionDetails {
|
||||||
|
|
||||||
private final String host;
|
private final String host;
|
||||||
|
|
||||||
private final int port;
|
private final int port;
|
||||||
|
|
||||||
private OpenTelemetryContainerConnectionDetails(RunningService source) {
|
private OpenTelemetryContainerMetricsConnectionDetails(RunningService source) {
|
||||||
super(source);
|
super(source);
|
||||||
this.host = source.host();
|
this.host = source.host();
|
||||||
this.port = source.ports().get(OTLP_PORT);
|
this.port = source.ports().get(OTLP_PORT);
|
||||||
@ -57,7 +57,7 @@ class OpenTelemetryDockerComposeConnectionDetailsFactory
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
return "http://" + this.host + ":" + this.port + "/v1/metrics";
|
return "http://%s:%d/v1/metrics".formatted(this.host, this.port);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -23,7 +23,7 @@ import org.springframework.boot.docker.compose.service.connection.DockerComposeC
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link DockerComposeConnectionDetailsFactory} to create
|
* {@link DockerComposeConnectionDetailsFactory} to create
|
||||||
* {@link OtlpTracingConnectionDetails} for a {@code otlp} service.
|
* {@link OtlpTracingConnectionDetails} for a {@code OTLP} service.
|
||||||
*
|
*
|
||||||
* @author Eddú Meléndez
|
* @author Eddú Meléndez
|
||||||
*/
|
*/
|
||||||
@ -57,7 +57,7 @@ class OpenTelemetryTracingDockerComposeConnectionDetailsFactory
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEndpoint() {
|
public String getEndpoint() {
|
||||||
return "http://" + this.host + ":" + this.port + "/v1/traces";
|
return "http://%s:%d/v1/traces".formatted(this.host, this.port);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ org.springframework.boot.docker.compose.service.connection.mysql.MySqlJdbcDocker
|
|||||||
org.springframework.boot.docker.compose.service.connection.mysql.MySqlR2dbcDockerComposeConnectionDetailsFactory,\
|
org.springframework.boot.docker.compose.service.connection.mysql.MySqlR2dbcDockerComposeConnectionDetailsFactory,\
|
||||||
org.springframework.boot.docker.compose.service.connection.oracle.OracleJdbcDockerComposeConnectionDetailsFactory,\
|
org.springframework.boot.docker.compose.service.connection.oracle.OracleJdbcDockerComposeConnectionDetailsFactory,\
|
||||||
org.springframework.boot.docker.compose.service.connection.oracle.OracleR2dbcDockerComposeConnectionDetailsFactory,\
|
org.springframework.boot.docker.compose.service.connection.oracle.OracleR2dbcDockerComposeConnectionDetailsFactory,\
|
||||||
org.springframework.boot.docker.compose.service.connection.otlp.OpenTelemetryDockerComposeConnectionDetailsFactory,\
|
org.springframework.boot.docker.compose.service.connection.otlp.OpenTelemetryMetricsDockerComposeConnectionDetailsFactory,\
|
||||||
org.springframework.boot.docker.compose.service.connection.otlp.OpenTelemetryTracingDockerComposeConnectionDetailsFactory,\
|
org.springframework.boot.docker.compose.service.connection.otlp.OpenTelemetryTracingDockerComposeConnectionDetailsFactory,\
|
||||||
org.springframework.boot.docker.compose.service.connection.postgres.PostgresJdbcDockerComposeConnectionDetailsFactory,\
|
org.springframework.boot.docker.compose.service.connection.postgres.PostgresJdbcDockerComposeConnectionDetailsFactory,\
|
||||||
org.springframework.boot.docker.compose.service.connection.postgres.PostgresR2dbcDockerComposeConnectionDetailsFactory,\
|
org.springframework.boot.docker.compose.service.connection.postgres.PostgresR2dbcDockerComposeConnectionDetailsFactory,\
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012-2023 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.springframework.boot.docker.compose.service.connection.otlp;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsConnectionDetails;
|
||||||
|
import org.springframework.boot.docker.compose.service.connection.test.AbstractDockerComposeIntegrationTests;
|
||||||
|
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integration tests for
|
||||||
|
* {@link OpenTelemetryMetricsDockerComposeConnectionDetailsFactory}.
|
||||||
|
*
|
||||||
|
* @author Eddú Meléndez
|
||||||
|
*/
|
||||||
|
public class OpenTelemetryMetricsDockerComposeConnectionDetailsFactoryIntegrationTests
|
||||||
|
extends AbstractDockerComposeIntegrationTests {
|
||||||
|
|
||||||
|
OpenTelemetryMetricsDockerComposeConnectionDetailsFactoryIntegrationTests() {
|
||||||
|
super("otlp-compose.yaml", DockerImageNames.opentelemetry());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void runCreatesConnectionDetails() {
|
||||||
|
OtlpMetricsConnectionDetails connectionDetails = run(OtlpMetricsConnectionDetails.class);
|
||||||
|
assertThat(connectionDetails.getUrl()).startsWith("http://").endsWith("/v1/metrics");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -18,7 +18,6 @@ package org.springframework.boot.docker.compose.service.connection.otlp;
|
|||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpConnectionDetails;
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpTracingConnectionDetails;
|
import org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpTracingConnectionDetails;
|
||||||
import org.springframework.boot.docker.compose.service.connection.test.AbstractDockerComposeIntegrationTests;
|
import org.springframework.boot.docker.compose.service.connection.test.AbstractDockerComposeIntegrationTests;
|
||||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||||
@ -26,25 +25,20 @@ import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
|||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Integration tests for {@link OpenTelemetryDockerComposeConnectionDetailsFactory}.
|
* Integration tests for
|
||||||
|
* {@link OpenTelemetryTracingDockerComposeConnectionDetailsFactory}.
|
||||||
*
|
*
|
||||||
* @author Eddú Meléndez
|
* @author Eddú Meléndez
|
||||||
*/
|
*/
|
||||||
public class OpenTelemetryDockerComposeConnectionDetailsFactoryIntegrationTests
|
public class OpenTelemetryTracingDockerComposeConnectionDetailsFactoryIntegrationTests
|
||||||
extends AbstractDockerComposeIntegrationTests {
|
extends AbstractDockerComposeIntegrationTests {
|
||||||
|
|
||||||
OpenTelemetryDockerComposeConnectionDetailsFactoryIntegrationTests() {
|
OpenTelemetryTracingDockerComposeConnectionDetailsFactoryIntegrationTests() {
|
||||||
super("otlp-compose.yaml", DockerImageNames.opentelemetry());
|
super("otlp-compose.yaml", DockerImageNames.opentelemetry());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void runCreatesConnectionDetails() {
|
void runCreatesConnectionDetails() {
|
||||||
OtlpConnectionDetails connectionDetails = run(OtlpConnectionDetails.class);
|
|
||||||
assertThat(connectionDetails.getUrl()).startsWith("http://").endsWith("/v1/metrics");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void runCreatesTracingConnectionDetails() {
|
|
||||||
OtlpTracingConnectionDetails connectionDetails = run(OtlpTracingConnectionDetails.class);
|
OtlpTracingConnectionDetails connectionDetails = run(OtlpTracingConnectionDetails.class);
|
||||||
assertThat(connectionDetails.getEndpoint()).startsWith("http://").endsWith("/v1/traces");
|
assertThat(connectionDetails.getEndpoint()).startsWith("http://").endsWith("/v1/traces");
|
||||||
}
|
}
|
@ -76,6 +76,12 @@ The following service connections are currently supported:
|
|||||||
| `MongoConnectionDetails`
|
| `MongoConnectionDetails`
|
||||||
| Containers named "mongo"
|
| Containers named "mongo"
|
||||||
|
|
||||||
|
| `OtlpMetricsConnectionDetails`
|
||||||
|
| Containers named "otel/opentelemetry-collector-contrib"
|
||||||
|
|
||||||
|
| `OtlpTracingConnectionDetails`
|
||||||
|
| Containers named "otel/opentelemetry-collector-contrib"
|
||||||
|
|
||||||
| `PulsarConnectionDetails`
|
| `PulsarConnectionDetails`
|
||||||
| Containers named "apachepulsar/pulsar"
|
| Containers named "apachepulsar/pulsar"
|
||||||
|
|
||||||
|
@ -992,7 +992,10 @@ The following service connection factories are provided in the `spring-boot-test
|
|||||||
| `Neo4jConnectionDetails`
|
| `Neo4jConnectionDetails`
|
||||||
| Containers of type `Neo4jContainer`
|
| Containers of type `Neo4jContainer`
|
||||||
|
|
||||||
| `OtlpConnectionDetails`
|
| `OtlpMetricsConnectionDetails`
|
||||||
|
| Containers named "otel/opentelemetry-collector-contrib"
|
||||||
|
|
||||||
|
| `OtlpTracingConnectionDetails`
|
||||||
| Containers named "otel/opentelemetry-collector-contrib"
|
| Containers named "otel/opentelemetry-collector-contrib"
|
||||||
|
|
||||||
| `PulsarConnectionDetails`
|
| `PulsarConnectionDetails`
|
||||||
|
@ -19,41 +19,43 @@ package org.springframework.boot.testcontainers.service.connection.otlp;
|
|||||||
import org.testcontainers.containers.Container;
|
import org.testcontainers.containers.Container;
|
||||||
import org.testcontainers.containers.GenericContainer;
|
import org.testcontainers.containers.GenericContainer;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpConnectionDetails;
|
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsConnectionDetails;
|
||||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ContainerConnectionDetailsFactory} to create {@link OtlpConnectionDetails} from
|
* {@link ContainerConnectionDetailsFactory} to create
|
||||||
* a {@link ServiceConnection @ServiceConnection}-annotated {@link GenericContainer} using
|
* {@link OtlpMetricsConnectionDetails} from a
|
||||||
|
* {@link ServiceConnection @ServiceConnection}-annotated {@link GenericContainer} using
|
||||||
* the {@code "otel/opentelemetry-collector-contrib"} image.
|
* the {@code "otel/opentelemetry-collector-contrib"} image.
|
||||||
*
|
*
|
||||||
* @author Eddú Meléndez
|
* @author Eddú Meléndez
|
||||||
*/
|
*/
|
||||||
class OpenTelemetryConnectionDetailsFactory
|
class OpenTelemetryMetricsConnectionDetailsFactory
|
||||||
extends ContainerConnectionDetailsFactory<Container<?>, OtlpConnectionDetails> {
|
extends ContainerConnectionDetailsFactory<Container<?>, OtlpMetricsConnectionDetails> {
|
||||||
|
|
||||||
OpenTelemetryConnectionDetailsFactory() {
|
OpenTelemetryMetricsConnectionDetailsFactory() {
|
||||||
super("otel/opentelemetry-collector-contrib",
|
super("otel/opentelemetry-collector-contrib",
|
||||||
"org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration");
|
"org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected OtlpConnectionDetails getContainerConnectionDetails(ContainerConnectionSource<Container<?>> source) {
|
protected OtlpMetricsConnectionDetails getContainerConnectionDetails(
|
||||||
return new OpenTelemetryContainerConnectionDetails(source);
|
ContainerConnectionSource<Container<?>> source) {
|
||||||
|
return new OpenTelemetryContainerMetricsConnectionDetails(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class OpenTelemetryContainerConnectionDetails extends ContainerConnectionDetails<Container<?>>
|
private static final class OpenTelemetryContainerMetricsConnectionDetails
|
||||||
implements OtlpConnectionDetails {
|
extends ContainerConnectionDetails<Container<?>> implements OtlpMetricsConnectionDetails {
|
||||||
|
|
||||||
private OpenTelemetryContainerConnectionDetails(ContainerConnectionSource<Container<?>> source) {
|
private OpenTelemetryContainerMetricsConnectionDetails(ContainerConnectionSource<Container<?>> source) {
|
||||||
super(source);
|
super(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
return "http://" + getContainer().getHost() + ":" + getContainer().getMappedPort(4318) + "/v1/metrics";
|
return "http://%s:%d/v1/metrics".formatted(getContainer().getHost(), getContainer().getMappedPort(4318));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -55,7 +55,7 @@ class OpenTelemetryTracingConnectionDetailsFactory
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEndpoint() {
|
public String getEndpoint() {
|
||||||
return "http://" + getContainer().getHost() + ":" + getContainer().getMappedPort(4318) + "/v1/traces";
|
return "http://%s:%d/v1/traces".formatted(getContainer().getHost(), getContainer().getMappedPort(4318));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ org.springframework.boot.testcontainers.service.connection.kafka.KafkaContainerC
|
|||||||
org.springframework.boot.testcontainers.service.connection.liquibase.LiquibaseContainerConnectionDetailsFactory,\
|
org.springframework.boot.testcontainers.service.connection.liquibase.LiquibaseContainerConnectionDetailsFactory,\
|
||||||
org.springframework.boot.testcontainers.service.connection.mongo.MongoContainerConnectionDetailsFactory,\
|
org.springframework.boot.testcontainers.service.connection.mongo.MongoContainerConnectionDetailsFactory,\
|
||||||
org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jContainerConnectionDetailsFactory,\
|
org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jContainerConnectionDetailsFactory,\
|
||||||
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryConnectionDetailsFactory,\
|
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryMetricsConnectionDetailsFactory,\
|
||||||
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryTracingConnectionDetailsFactory,\
|
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryTracingConnectionDetailsFactory,\
|
||||||
org.springframework.boot.testcontainers.service.connection.pulsar.PulsarContainerConnectionDetailsFactory,\
|
org.springframework.boot.testcontainers.service.connection.pulsar.PulsarContainerConnectionDetailsFactory,\
|
||||||
org.springframework.boot.testcontainers.service.connection.r2dbc.MariaDbR2dbcContainerConnectionDetailsFactory,\
|
org.springframework.boot.testcontainers.service.connection.r2dbc.MariaDbR2dbcContainerConnectionDetailsFactory,\
|
||||||
|
@ -48,7 +48,7 @@ import static org.hamcrest.Matchers.endsWith;
|
|||||||
import static org.hamcrest.Matchers.matchesPattern;
|
import static org.hamcrest.Matchers.matchesPattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link OpenTelemetryConnectionDetailsFactory}.
|
* Tests for {@link OpenTelemetryMetricsConnectionDetailsFactory}.
|
||||||
*
|
*
|
||||||
* @author Eddú Meléndez
|
* @author Eddú Meléndez
|
||||||
* @author Jonatan Ivanov
|
* @author Jonatan Ivanov
|
||||||
@ -57,7 +57,7 @@ import static org.hamcrest.Matchers.matchesPattern;
|
|||||||
@TestPropertySource(properties = { "management.otlp.metrics.export.resource-attributes.service.name=test",
|
@TestPropertySource(properties = { "management.otlp.metrics.export.resource-attributes.service.name=test",
|
||||||
"management.otlp.metrics.export.step=1s" })
|
"management.otlp.metrics.export.step=1s" })
|
||||||
@Testcontainers(disabledWithoutDocker = true)
|
@Testcontainers(disabledWithoutDocker = true)
|
||||||
class OtlpContainerConnectionDetailsFactoryIntegrationTests {
|
class OpenTelemetryMetricsConnectionDetailsFactoryIntegrationTests {
|
||||||
|
|
||||||
private static final String OPENMETRICS_001 = "application/openmetrics-text; version=0.0.1; charset=utf-8";
|
private static final String OPENMETRICS_001 = "application/openmetrics-text; version=0.0.1; charset=utf-8";
|
||||||
|
|
@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
*/
|
*/
|
||||||
@SpringJUnitConfig
|
@SpringJUnitConfig
|
||||||
@Testcontainers(disabledWithoutDocker = true)
|
@Testcontainers(disabledWithoutDocker = true)
|
||||||
class OtlpTracingContainerConnectionDetailsFactoryIntegrationTests {
|
class OpenTelemetryTracingConnectionDetailsFactoryIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
@ServiceConnection
|
@ServiceConnection
|
Loading…
Reference in New Issue
Block a user