logs_to_metric transform should allow for deriving tags field from a field (without specifically listing all the possible keys) #14744
Labels
transform: log_to_metric
Anything `log_to_metric` transform related
type: feature
A value-adding code addition that introduce new functionality.
A note for the community
Use Cases
It appears that the
log_to_metric
transform has no way to support deriving an arbitrary set of tags from a log event ...?A configuration like this will fail because the
tags
configuration property is required to be a map ...Attempted Solutions
I've ended up working around this issue for now with a lua transform ... -- at the moment I only care about supporting
gauge
metrics and so I've only implemented the transform for the gauge type (I suspect there is likely more sophisticated logic needed for some of the other metrics ...)It would really nice if I could instead just point the
logs_to_metric
transform at a field containing all the tags I want defined on the output metric ... To prevent high cardinality metric issues -- I'd use thetag_cardinality_limit
transform ...I'm working around for now with a lua transform. I'm filing this feature request to document a use case where lua transform seems required (as suggested in the lua transform docs)
Proposal
Expand
log_to_metric
with a new parameter that allows deriving all tags for the metric from a particular field in the log. The field in the log will be expected and required to be a map from string -> string.References
Version
vector 0.24.1 (x86_64-apple-darwin 8935681 2022-09-12)
The text was updated successfully, but these errors were encountered: