rkhachatryan commented on code in PR #27989:
URL: https://github.com/apache/flink/pull/27989#discussion_r3148665667
##########
flink-metrics/flink-metrics-otel/src/main/java/org/apache/flink/metrics/otel/OpenTelemetryReporterOptions.java:
##########
@@ -132,6 +132,71 @@ private OpenTelemetryReporterOptions() {}
"Timeout in milliseconds for
waiting on async export completion.")
.build());
+ /** Prefix key used to identify attribute value length limit configuration
entries. */
+ public static final String ATTRIBUTE_VALUE_LENGTH_LIMITS_PREFIX_KEY =
+ "transform.attribute-value-length-limits.";
+
+ /**
+ * Config option for attribute value length limits. Only used for
documentation purposes — the
+ * actual option is prefix-based and parsed by {@link
MetricAttributeTransformer}.
+ *
+ * <p>For example, to limit the {@code task_name} attribute to 60
characters set {@code
+ *
metrics.reporter.otel.transform.attribute-value-length-limits.task_name: 60} in
the Flink
+ * configuration. The special key {@code *} defines a global limit for all
attributes not
+ * explicitly listed. {@code 0} drops an attribute; negative values
disable the limit for that
+ * attribute (useful to override a global cap).
+ */
+ @PublicEvolving
+ public static final ConfigOption<Integer> ATTRIBUTE_VALUE_LENGTH_LIMITS =
+ ConfigOptions.key(ATTRIBUTE_VALUE_LENGTH_LIMITS_PREFIX_KEY +
"<attribute-name>")
+ .intType()
+ .noDefaultValue()
+ .withDescription(
+ Description.builder()
+ .text(
+ "Limits of the exported attribute
values length. Only applies to the metric "
+ + "reporter; ignored by
the trace and event reporters. "
+ + "Configuration is prefix
based, "
+ + "for example to limit
`task_name` attribute set "
+ +
"`metrics.reporter.otel.transform.attribute-value-length-limits.task_name: 60` "
+ + "in the config for OTel
reporter. "
+ + "A special key '*' can
be used to define a global limit for all attributes not "
+ + "explicitly listed. "
+ + "For example
`metrics.reporter.otel.transform.attribute-value-length-limits.*: 1024` "
+ + "will limit all
attributes to attributeValue.substring(0, 1024). "
+ + "Global limit defaults
to Integer.MAX_VALUE if not set. Individual attribute "
+ + "limits always override
the global limit and are verified by exact match on the "
+ + "attribute name. "
+ + "0 can be used to drop
an attribute. Negative values are interpreted as no limit "
+ + "for the attribute (can
be used for global limit overrides).")
+ .build());
+
+ /** Config key for the collision tracker's maximum size. */
+ public static final String COLLISION_TRACKING_MAX_SLOTS_KEY =
+ "transform.collision-tracking-max-slots";
Review Comment:
> They are prefixed with: ConfigConstants.METRICS_REPORTER_PREFIX
Ok, that should be enough 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]