Skip to content

Commit

Permalink
Undeprecate 'management.metrics.tags'
Browse files Browse the repository at this point in the history
Closes gh-38583
  • Loading branch information
mhalbritter committed Dec 13, 2023
1 parent 35eba69 commit c50172d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.Map;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

/**
Expand Down Expand Up @@ -79,8 +78,6 @@ public Map<String, Boolean> getEnable() {
return this.enable;
}

@Deprecated(since = "3.2.0", forRemoval = true)
@DeprecatedConfigurationProperty(replacement = "management.observations.key-values", since = "3.2.0")
public Map<String, String> getTags() {
return this.tags;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class PropertiesMeterFilter implements MeterFilter {

private final MeterFilter mapFilter;

@SuppressWarnings("removal")
public PropertiesMeterFilter(MetricsProperties properties) {
Assert.notNull(properties, "Properties must not be null");
this.properties = properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1111,8 +1111,19 @@ These use the global registry that is not Spring-managed.

[[actuator.metrics.customizing.common-tags]]
==== Common Tags
Common tags are generally used for dimensional drill-down on the operating environment, such as host, instance, region, stack, and others.
Commons tags are applied to all meters and can be configured, as the following example shows:

You can configure common tags using the <<actuator#actuator.observability.common-key-values, configprop:management.observations.key-values[] property>>.
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
management:
metrics:
tags:
region: "us-east-1"
stack: "prod"
----

The preceding example adds `region` and `stack` tags to all meters with a value of `us-east-1` and `prod`, respectively.

NOTE: The order of common tags is important if you use Graphite.
As the order of common tags cannot be guaranteed by using this approach, Graphite users are advised to define a custom `MeterFilter` instead.
Expand Down

0 comments on commit c50172d

Please sign in to comment.