mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-02 19:30:23 +01:00
Polish "Add support for Grafana LGTM stack"
See gh-41551
This commit is contained in:
+3
-3
@@ -23,12 +23,12 @@ import org.springframework.boot.testsupport.container.TestImage;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Integration tests for
|
||||
* {@link OpenTelemetryMetricsDockerComposeConnectionDetailsFactory}.
|
||||
* Integration tests for {@link OpenTelemetryMetricsDockerComposeConnectionDetailsFactory}
|
||||
* using {@link TestImage#GRAFANA_OTEL_LGTM}.
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
class GrafanaOtelMetricsDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||
class GrafanaOpenTelemetryMetricsDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||
|
||||
@DockerComposeTest(composeFile = "otlp-compose.yaml", image = TestImage.GRAFANA_OTEL_LGTM)
|
||||
void runCreatesConnectionDetails(OtlpMetricsConnectionDetails connectionDetails) {
|
||||
+3
-3
@@ -23,12 +23,12 @@ import org.springframework.boot.testsupport.container.TestImage;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Integration tests for
|
||||
* {@link OpenTelemetryTracingDockerComposeConnectionDetailsFactory}.
|
||||
* Integration tests for {@link OpenTelemetryTracingDockerComposeConnectionDetailsFactory}
|
||||
* using {@link TestImage#GRAFANA_OTEL_LGTM}.
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
class GrafanaOtelTracingDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||
class GrafanaOpenTelemetryTracingDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||
|
||||
@DockerComposeTest(composeFile = "otlp-compose.yaml", image = TestImage.GRAFANA_OTEL_LGTM)
|
||||
void runCreatesConnectionDetails(OtlpTracingConnectionDetails connectionDetails) {
|
||||
+2
-2
@@ -23,8 +23,8 @@ import org.springframework.boot.testsupport.container.TestImage;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Integration tests for
|
||||
* {@link OpenTelemetryMetricsDockerComposeConnectionDetailsFactory}.
|
||||
* Integration tests for {@link OpenTelemetryMetricsDockerComposeConnectionDetailsFactory}
|
||||
* using {@link TestImage#OPENTELEMETRY}.
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ import org.springframework.boot.testsupport.container.TestImage;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Integration tests for
|
||||
* {@link OpenTelemetryTracingDockerComposeConnectionDetailsFactory}.
|
||||
* Integration tests for {@link OpenTelemetryTracingDockerComposeConnectionDetailsFactory}
|
||||
* using {@link TestImage#OPENTELEMETRY}.
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
|
||||
+2
-2
@@ -72,10 +72,10 @@ The following service connection factories are provided in the `spring-boot-test
|
||||
| Containers of type `Neo4jContainer`
|
||||
|
||||
| `OtlpMetricsConnectionDetails`
|
||||
| Containers named "otel/opentelemetry-collector-contrib" or `LgtmStackContainer`
|
||||
| Containers named "otel/opentelemetry-collector-contrib" or of type `LgtmStackContainer`
|
||||
|
||||
| `OtlpTracingConnectionDetails`
|
||||
| Containers named "otel/opentelemetry-collector-contrib" or `LgtmStackContainer`
|
||||
| Containers named "otel/opentelemetry-collector-contrib" or of type `LgtmStackContainer`
|
||||
|
||||
| `PulsarConnectionDetails`
|
||||
| Containers of type `PulsarContainer`
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link GrafanaOtelLgtmMetricsContainerConnectionDetailsFactory}.
|
||||
* Tests for {@link GrafanaOpenTelemetryMetricsContainerConnectionDetailsFactory}.
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
@@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@TestPropertySource(properties = { "management.otlp.metrics.export.resource-attributes.service.name=test",
|
||||
"management.otlp.metrics.export.step=1s" })
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
class GrafanaOtelLgtmMetricsContainerConnectionDetailsFactoryIntegrationTests {
|
||||
class GrafanaOpenTelemetryMetricsContainerConnectionDetailsFactoryIntegrationTests {
|
||||
|
||||
@Container
|
||||
@ServiceConnection
|
||||
+2
-3
@@ -33,14 +33,13 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for
|
||||
* {@link GrafanaOtelLgtmTracingContainerConnectionDetailsFactoryIntegrationTests}.
|
||||
* Tests for {@link GrafanaOpenTelemetryTracingContainerConnectionDetailsFactory}.
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
@SpringJUnitConfig
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
class GrafanaOtelLgtmTracingContainerConnectionDetailsFactoryIntegrationTests {
|
||||
class GrafanaOpenTelemetryTracingContainerConnectionDetailsFactoryIntegrationTests {
|
||||
|
||||
@Container
|
||||
@ServiceConnection
|
||||
+5
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.otlp;
|
||||
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.grafana.LgtmStackContainer;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsConnectionDetails;
|
||||
@@ -27,15 +26,15 @@ import org.springframework.boot.testcontainers.service.connection.ServiceConnect
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} to create
|
||||
* {@link OtlpMetricsConnectionDetails} from a
|
||||
* {@link ServiceConnection @ServiceConnection}-annotated {@link GenericContainer} using
|
||||
* the {@code "otel/opentelemetry-collector-contrib"} image.
|
||||
* {@link ServiceConnection @ServiceConnection}-annotated {@link LgtmStackContainer} using
|
||||
* the {@code "grafana/otel-lgtmb"} image.
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
class GrafanaOtelLgtmMetricsContainerConnectionDetailsFactory
|
||||
class GrafanaOpenTelemetryMetricsContainerConnectionDetailsFactory
|
||||
extends ContainerConnectionDetailsFactory<LgtmStackContainer, OtlpMetricsConnectionDetails> {
|
||||
|
||||
GrafanaOtelLgtmMetricsContainerConnectionDetailsFactory() {
|
||||
GrafanaOpenTelemetryMetricsContainerConnectionDetailsFactory() {
|
||||
super(ANY_CONNECTION_NAME,
|
||||
"org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration");
|
||||
}
|
||||
+5
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 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.
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.otlp;
|
||||
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.grafana.LgtmStackContainer;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpTracingConnectionDetails;
|
||||
@@ -27,15 +26,15 @@ import org.springframework.boot.testcontainers.service.connection.ServiceConnect
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} to create
|
||||
* {@link OtlpTracingConnectionDetails} from a
|
||||
* {@link ServiceConnection @ServiceConnection}-annotated {@link GenericContainer} using
|
||||
* the {@code "otel/opentelemetry-collector-contrib"} image.
|
||||
* {@link ServiceConnection @ServiceConnection}-annotated {@link LgtmStackContainer} using
|
||||
* the {@code "grafana/otel-lgtm"} image.
|
||||
*
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
class GrafanaOtelLgtmTracingContainerConnectionDetailsFactory
|
||||
class GrafanaOpenTelemetryTracingContainerConnectionDetailsFactory
|
||||
extends ContainerConnectionDetailsFactory<LgtmStackContainer, OtlpTracingConnectionDetails> {
|
||||
|
||||
GrafanaOtelLgtmTracingContainerConnectionDetailsFactory() {
|
||||
GrafanaOpenTelemetryTracingContainerConnectionDetailsFactory() {
|
||||
super(ANY_CONNECTION_NAME, "org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpAutoConfiguration");
|
||||
}
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ org.springframework.boot.testcontainers.service.connection.ldap.OpenLdapContaine
|
||||
org.springframework.boot.testcontainers.service.connection.liquibase.LiquibaseContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.mongo.MongoContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.otlp.GrafanaOtelLgtmMetricsContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.otlp.GrafanaOtelLgtmTracingContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.otlp.GrafanaOpenTelemetryMetricsContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.otlp.GrafanaOpenTelemetryTracingContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryMetricsContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryTracingContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.pulsar.PulsarContainerConnectionDetailsFactory,\
|
||||
|
||||
+6
-6
@@ -101,6 +101,12 @@ public enum TestImage {
|
||||
*/
|
||||
ELASTICSEARCH_8("elasticsearch", "8.6.1"),
|
||||
|
||||
/**
|
||||
* A container image suitable for testing Grafana OTel LGTM.
|
||||
*/
|
||||
GRAFANA_OTEL_LGTM("grafana/otel-lgtm", "0.6.0", () -> LgtmStackContainer.class,
|
||||
(container) -> ((LgtmStackContainer) container).withStartupTimeout(Duration.ofMinutes(2))),
|
||||
|
||||
/**
|
||||
* A container image suitable for testing Confluent's distribution of Kafka.
|
||||
*/
|
||||
@@ -159,12 +165,6 @@ public enum TestImage {
|
||||
*/
|
||||
OPENTELEMETRY("otel/opentelemetry-collector-contrib", "0.75.0"),
|
||||
|
||||
/**
|
||||
* A container image suitable for testing Grafana Otel LGTM.
|
||||
*/
|
||||
GRAFANA_OTEL_LGTM("grafana/otel-lgtm", "0.6.0", () -> LgtmStackContainer.class,
|
||||
(container) -> ((LgtmStackContainer) container).withStartupTimeout(Duration.ofMinutes(2))),
|
||||
|
||||
/**
|
||||
* A container image suitable for testing Postgres.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user