Polish Micrometer tracing changes

See gh-30833
pull/30862/head
izeye 3 years ago committed by Andy Wilkinson
parent 0220624a13
commit 77c3b6c899

@ -23,7 +23,7 @@ import org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontPropert
import org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties.Metrics.Export; import org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties.Metrics.Export;
/** /**
* Adapter to convert {@link WavefrontProperties.Metrics} to a {@link WavefrontConfig}. * Adapter to convert {@link WavefrontProperties} to a {@link WavefrontConfig}.
* *
* @author Jon Schneider * @author Jon Schneider
* @author Moritz Halbritter * @author Moritz Halbritter

@ -54,7 +54,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
/** /**
* Configurations for Open Telemetry. Those are imported by * Configurations for OpenTelemetry. Those are imported by
* {@link OpenTelemetryAutoConfiguration}. * {@link OpenTelemetryAutoConfiguration}.
* *
* @author Moritz Halbritter * @author Moritz Halbritter

@ -44,7 +44,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for Wavefront. * {@link EnableAutoConfiguration Auto-configuration} for Wavefront tracing.
* *
* @author Moritz Halbritter * @author Moritz Halbritter
* @since 3.0.0 * @since 3.0.0

@ -34,8 +34,8 @@ import org.springframework.util.unit.DataSize;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for Wavefront common infrastructure. * {@link EnableAutoConfiguration Auto-configuration} for Wavefront common infrastructure.
* Metrics are auto-configured in {@link WavefrontMetricsExportAutoConfiguration}, tracing * Metrics are auto-configured in {@link WavefrontMetricsExportAutoConfiguration}, and
* is auto-configured in {@link WavefrontTracingAutoConfiguration}. * tracing is auto-configured in {@link WavefrontTracingAutoConfiguration}.
* *
* @author Moritz Halbritter * @author Moritz Halbritter
* @since 3.0.0 * @since 3.0.0

@ -41,13 +41,14 @@ public class WavefrontProperties {
private URI uri = URI.create("https://longboard.wavefront.com"); private URI uri = URI.create("https://longboard.wavefront.com");
/** /**
* Unique identifier for the app instance that is the source of metrics being * Unique identifier for the app instance that is the source of metrics and traces
* published to Wavefront. Defaults to the local host name. * being published to Wavefront. Defaults to the local host name.
*/ */
private String source; private String source;
/** /**
* API token used when publishing metrics directly to the Wavefront API host. * API token used when publishing metrics and traces directly to the Wavefront API
* host.
*/ */
private String apiToken; private String apiToken;

@ -64,14 +64,13 @@ class OpenTelemetryConfigurationsTracerConfigurationTests {
assertThat(context).hasBean("customTracer"); assertThat(context).hasBean("customTracer");
assertThat(context).hasSingleBean(Tracer.class); assertThat(context).hasSingleBean(Tracer.class);
}); });
} }
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
private static class OpenTelemetryConfiguration { private static class OpenTelemetryConfiguration {
@Bean @Bean
OpenTelemetry tracer() { OpenTelemetry openTelemetry() {
return Mockito.mock(OpenTelemetry.class); return Mockito.mock(OpenTelemetry.class);
} }

@ -60,15 +60,6 @@ class ZipkinConfigurationsSenderConfigurationTests {
}); });
} }
@Test
void shouldNotSupplyRestTemplateSenderIfNoBuilderIsAvailable() {
this.contextRunner.run((context) -> {
assertThat(context).doesNotHaveBean(ZipkinRestTemplateSender.class);
assertThat(context).hasSingleBean(Sender.class);
assertThat(context).hasSingleBean(URLConnectionSender.class);
});
}
@Test @Test
void shouldBackOffOnCustomBeans() { void shouldBackOffOnCustomBeans() {
this.contextRunner.withUserConfiguration(CustomConfiguration.class).run((context) -> { this.contextRunner.withUserConfiguration(CustomConfiguration.class).run((context) -> {

@ -589,7 +589,7 @@ If you are exporting metrics to https://www.wavefront.com/[Wavefront] directly,
---- ----
management: management:
wavefront: wavefront:
api-token: "YOUR_API_TOKEN" api-token: "YOUR_API_TOKEN"
---- ----
Alternatively, you can use a Wavefront sidecar or an internal proxy in your environment to forward metrics data to the Wavefront API host: Alternatively, you can use a Wavefront sidecar or an internal proxy in your environment to forward metrics data to the Wavefront API host:
@ -598,7 +598,7 @@ Alternatively, you can use a Wavefront sidecar or an internal proxy in your envi
---- ----
management: management:
wavefront: wavefront:
uri: "proxy://localhost:2878" uri: "proxy://localhost:2878"
---- ----
NOTE: If you publish metrics to a Wavefront proxy (as described in https://docs.wavefront.com/proxies_installing.html[the Wavefront documentation]), the host must be in the `proxy://HOST:PORT` format. NOTE: If you publish metrics to a Wavefront proxy (as described in https://docs.wavefront.com/proxies_installing.html[the Wavefront documentation]), the host must be in the `proxy://HOST:PORT` format.

Loading…
Cancel
Save