Class StatsDPayloadBuilder
java.lang.Object
org.nuxeo.runtime.metrics.reporter.patch.StatsDPayloadBuilder
Builds metric payload lines in StatsD / DogStatsD protocol format.
Format: metric.name:value|g|#dim1:val1,dim2:val2
- Since:
- 2025.15
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendMetricLine(StringBuilder sb, String metricName, Map<String, String> metricTags, double value) Appends a single metric line to the given StringBuilder in StatsD / DogStatsD format.static StringformatValue(double value) Formats a numeric value for the metric payload (integer when possible, otherwise decimal with trailing zeros removed).static StringSanitizes dimension/tag keys and values for StatsD protocol.static StringSanitizes metric names for StatsD protocol.
-
Constructor Details
-
StatsDPayloadBuilder
-
-
Method Details
-
appendMetricLine
public void appendMetricLine(StringBuilder sb, String metricName, Map<String, String> metricTags, double value) Appends a single metric line to the given StringBuilder in StatsD / DogStatsD format. -
sanitizeMetricName
Sanitizes metric names for StatsD protocol.Common rules: letters, numbers, underscores, hyphens, dots (1-250 chars), must start with a letter.
-
sanitize
Sanitizes dimension/tag keys and values for StatsD protocol.Common rules: letters, numbers, underscores, hyphens, dots, slashes; cannot start with hyphen, dot, or slash; colons are reserved as key:value separators.
-
formatValue
Formats a numeric value for the metric payload (integer when possible, otherwise decimal with trailing zeros removed).
-