Skip to content

Commit

Permalink
Deprecate SignalFX support
Browse files Browse the repository at this point in the history
Closes gh-43962
  • Loading branch information
mhalbritter committed Jan 29, 2025
1 parent a13fe0b commit 58cc3a0
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 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.
Expand Down Expand Up @@ -38,6 +38,7 @@
* @author Jon Schneider
* @author Andy Wilkinson
* @since 2.0.0
* @deprecated since 3.5.0 for removal in 3.7.0
*/
@AutoConfiguration(
before = { CompositeMeterRegistryAutoConfiguration.class, SimpleMetricsExportAutoConfiguration.class },
Expand All @@ -46,6 +47,8 @@
@ConditionalOnClass(SignalFxMeterRegistry.class)
@ConditionalOnEnabledMetricsExport("signalfx")
@EnableConfigurationProperties(SignalFxProperties.class)
@Deprecated(since = "3.5.0", forRemoval = true)
@SuppressWarnings("removal")
public class SignalFxMetricsExportAutoConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;

/**
* {@link ConfigurationProperties @ConfigurationProperties} for configuring metrics export
Expand All @@ -29,8 +30,10 @@
* @author Andy Wilkinson
* @author Stephane Nicoll
* @since 2.0.0
* @deprecated since 3.5.0 for removal in 3.7.0
*/
@ConfigurationProperties("management.signalfx.metrics.export")
@Deprecated(since = "3.5.0", forRemoval = true)
public class SignalFxProperties extends StepRegistryProperties {

/**
Expand Down Expand Up @@ -60,47 +63,115 @@ public class SignalFxProperties extends StepRegistryProperties {
private HistogramType publishedHistogramType = HistogramType.DEFAULT;

@Override
@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public Duration getStep() {
return this.step;
}

@Override
@Deprecated(since = "3.5.0", forRemoval = true)
public void setStep(Duration step) {
this.step = step;
}

@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public String getAccessToken() {
return this.accessToken;
}

@Deprecated(since = "3.5.0", forRemoval = true)
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}

@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public String getUri() {
return this.uri;
}

@Deprecated(since = "3.5.0", forRemoval = true)
public void setUri(String uri) {
this.uri = uri;
}

@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public String getSource() {
return this.source;
}

@Deprecated(since = "3.5.0", forRemoval = true)
public void setSource(String source) {
this.source = source;
}

@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public HistogramType getPublishedHistogramType() {
return this.publishedHistogramType;
}

@Deprecated(since = "3.5.0", forRemoval = true)
public void setPublishedHistogramType(HistogramType publishedHistogramType) {
this.publishedHistogramType = publishedHistogramType;
}

@Override
@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public boolean isEnabled() {
return super.isEnabled();
}

@Override
@Deprecated(since = "3.5.0", forRemoval = true)
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
}

@Override
@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public Duration getConnectTimeout() {
return super.getConnectTimeout();
}

@Override
@Deprecated(since = "3.5.0", forRemoval = true)
public void setConnectTimeout(Duration connectTimeout) {
super.setConnectTimeout(connectTimeout);
}

@Override
@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public Duration getReadTimeout() {
return super.getReadTimeout();
}

@Override
@Deprecated(since = "3.5.0", forRemoval = true)
public void setReadTimeout(Duration readTimeout) {
super.setReadTimeout(readTimeout);
}

@Override
@DeprecatedConfigurationProperty(since = "3.5.0", reason = "Deprecated in Micrometer 1.15.0")
@Deprecated(since = "3.5.0", forRemoval = true)
public Integer getBatchSize() {
return super.getBatchSize();
}

@Override
@Deprecated(since = "3.5.0", forRemoval = true)
public void setBatchSize(Integer batchSize) {
super.setBatchSize(batchSize);
}

@Deprecated(since = "3.5.0", forRemoval = true)
public enum HistogramType {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
Expand All @@ -19,14 +19,16 @@
import io.micrometer.signalfx.SignalFxConfig;

import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryPropertiesConfigAdapter;
import org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxProperties.HistogramType;

/**
* Adapter to convert {@link SignalFxProperties} to a {@link SignalFxConfig}.
*
* @author Jon Schneider
* @since 2.0.0
* @deprecated since 3.5.0 for removal in 3.7.0
*/
@Deprecated(since = "3.5.0", forRemoval = true)
@SuppressWarnings("removal")
public class SignalFxPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter<SignalFxProperties>
implements SignalFxConfig {

Expand Down Expand Up @@ -61,7 +63,7 @@ public boolean publishCumulativeHistogram() {
}

private boolean isPublishCumulativeHistogram(SignalFxProperties properties) {
return HistogramType.CUMULATIVE == properties.getPublishedHistogramType();
return SignalFxProperties.HistogramType.CUMULATIVE == properties.getPublishedHistogramType();
}

@Override
Expand All @@ -70,7 +72,7 @@ public boolean publishDeltaHistogram() {
}

private boolean isPublishDeltaHistogram(SignalFxProperties properties) {
return HistogramType.DELTA == properties.getPublishedHistogramType();
return SignalFxProperties.HistogramType.DELTA == properties.getPublishedHistogramType();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
Expand Down Expand Up @@ -34,6 +34,7 @@
*
* @author Andy Wilkinson
*/
@SuppressWarnings("removal")
class SignalFxMetricsExportAutoConfigurationTests {

private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
Expand All @@ -19,7 +19,6 @@
import org.junit.jupiter.api.Test;

import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryPropertiesConfigAdapterTests;
import org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxProperties.HistogramType;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -28,6 +27,7 @@
*
* @author Mirko Sobeck
*/
@SuppressWarnings("removal")
class SignalFxPropertiesConfigAdapterTests
extends StepRegistryPropertiesConfigAdapterTests<SignalFxProperties, SignalFxPropertiesConfigAdapter> {

Expand Down Expand Up @@ -70,15 +70,15 @@ void whenPropertiesSourceIsSetAdapterSourceReturnsIt() {
@Test
void whenPropertiesPublishHistogramTypeIsCumulativeAdapterPublishCumulativeHistogramReturnsIt() {
SignalFxProperties properties = createProperties();
properties.setPublishedHistogramType(HistogramType.CUMULATIVE);
properties.setPublishedHistogramType(SignalFxProperties.HistogramType.CUMULATIVE);
assertThat(createConfigAdapter(properties).publishCumulativeHistogram()).isTrue();
assertThat(createConfigAdapter(properties).publishDeltaHistogram()).isFalse();
}

@Test
void whenPropertiesPublishHistogramTypeIsDeltaAdapterPublishDeltaHistogramReturnsIt() {
SignalFxProperties properties = createProperties();
properties.setPublishedHistogramType(HistogramType.DELTA);
properties.setPublishedHistogramType(SignalFxProperties.HistogramType.DELTA);
assertThat(createConfigAdapter(properties).publishDeltaHistogram()).isTrue();
assertThat(createConfigAdapter(properties).publishCumulativeHistogram()).isFalse();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
Expand All @@ -20,7 +20,6 @@
import org.junit.jupiter.api.Test;

import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryPropertiesTests;
import org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxProperties.HistogramType;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -29,6 +28,7 @@
*
* @author Stephane Nicoll
*/
@SuppressWarnings("removal")
class SignalFxPropertiesTests extends StepRegistryPropertiesTests {

@Test
Expand All @@ -43,7 +43,7 @@ void defaultValuesAreConsistent() {
// histogram type should be published.
assertThat(config.publishCumulativeHistogram()).isFalse();
assertThat(config.publishDeltaHistogram()).isFalse();
assertThat(properties.getPublishedHistogramType()).isEqualTo(HistogramType.DEFAULT);
assertThat(properties.getPublishedHistogramType()).isEqualTo(SignalFxProperties.HistogramType.DEFAULT);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
Expand Down Expand Up @@ -32,7 +32,6 @@
import org.springframework.boot.actuate.autoconfigure.metrics.export.newrelic.NewRelicMetricsExportAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.export.otlp.OtlpMetricsExportAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.export.prometheus.PrometheusMetricsExportAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxMetricsExportAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.export.statsd.StatsdMetricsExportAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
Expand All @@ -47,6 +46,7 @@
* @author Jon Schneider
* @author Phillip Webb
*/
@SuppressWarnings("removal")
public final class MetricsRun {

private static final Set<Class<?>> EXPORT_AUTO_CONFIGURATIONS;
Expand All @@ -63,7 +63,8 @@ public final class MetricsRun {
implementations.add(OtlpMetricsExportAutoConfiguration.class);
implementations.add(PrometheusMetricsExportAutoConfiguration.class);
implementations.add(SimpleMetricsExportAutoConfiguration.class);
implementations.add(SignalFxMetricsExportAutoConfiguration.class);
implementations.add(
org.springframework.boot.actuate.autoconfigure.metrics.export.signalfx.SignalFxMetricsExportAutoConfiguration.class);
implementations.add(StatsdMetricsExportAutoConfiguration.class);
EXPORT_AUTO_CONFIGURATIONS = Collections.unmodifiableSet(implementations);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,6 @@
* xref:reference:actuator/metrics.adoc#actuator.metrics.export.otlp[#actuator.metrics.export.otlp]
* xref:reference:actuator/metrics.adoc#actuator.metrics.export.prometheus[#actuator.metrics.export.prometheus]
* xref:reference:actuator/metrics.adoc#actuator.metrics.export.prometheus[#production-ready-metrics-export-prometheus]
* xref:reference:actuator/metrics.adoc#actuator.metrics.export.signalfx[#actuator.metrics.export.signalfx]
* xref:reference:actuator/metrics.adoc#actuator.metrics.export.signalfx[#production-ready-metrics-export-signalfx]
* xref:reference:actuator/metrics.adoc#actuator.metrics.export.simple[#actuator.metrics.export.simple]
* xref:reference:actuator/metrics.adoc#actuator.metrics.export.simple[#production-ready-metrics-export-simple]
* xref:reference:actuator/metrics.adoc#actuator.metrics.export.stackdriver[#actuator.metrics.export.stackdriver]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Spring Boot Actuator provides dependency management and auto-configuration for {
- xref:actuator/metrics.adoc#actuator.metrics.export.newrelic[]
- xref:actuator/metrics.adoc#actuator.metrics.export.otlp[]
- xref:actuator/metrics.adoc#actuator.metrics.export.prometheus[]
- xref:actuator/metrics.adoc#actuator.metrics.export.signalfx[]
- xref:actuator/metrics.adoc#actuator.metrics.export.simple[] (in-memory)
- xref:actuator/metrics.adoc#actuator.metrics.export.stackdriver[]
- xref:actuator/metrics.adoc#actuator.metrics.export.statsd[]
Expand Down Expand Up @@ -573,34 +572,6 @@ For advanced configuration, you can also provide your own javadoc:org.springfram



[[actuator.metrics.export.signalfx]]
=== SignalFx

SignalFx registry periodically pushes metrics to {url-micrometer-docs-implementations}/signalFx[SignalFx].
To export metrics to https://www.signalfx.com[SignalFx], you must provide your access token:

[configprops,yaml]
----
management:
signalfx:
metrics:
export:
access-token: "YOUR_ACCESS_TOKEN"
----

You can also change the interval at which metrics are sent to SignalFx:

[configprops,yaml]
----
management:
signalfx:
metrics:
export:
step: "30s"
----



[[actuator.metrics.export.simple]]
=== Simple

Expand Down

0 comments on commit 58cc3a0

Please sign in to comment.