Skip to content

Comments

feat: set 'static_value' per metric config#335

Merged
burningalchemist merged 1 commit intomasterfrom
feat/static-value-metric
Sep 27, 2023
Merged

feat: set 'static_value' per metric config#335
burningalchemist merged 1 commit intomasterfrom
feat/static-value-metric

Conversation

@burningalchemist
Copy link
Owner

@burningalchemist burningalchemist commented Sep 23, 2023

Description

There are situations when we want to return some string data from the query (to re-process it later on the Prometheus side), and there's no value columns that could represent float64 number as a metric value. Even though we can solve it with some SQL adjustments, it's not always clear, when we look at SQL statements alone. It's also possible, that we simply cannot add a additional dummy value column due to different constraints (e.g. stored procedures we can't change) to point values parameter to.

To address this problem, we introduce metric configuration field static_value which can be set to a fixed number. The result is that we focus on the information mapped to key_labels instead, the value itself doesn't need to mean anything (although, the commonly used value would be 1) and can be ignored later on.

values and static_value are mutually exclusive parameters.

References

@burningalchemist burningalchemist added this to the v0.13 milestone Sep 23, 2023
@burningalchemist burningalchemist added the enhancement New feature or request label Sep 23, 2023
@burningalchemist burningalchemist marked this pull request as ready for review September 23, 2023 12:28
@burningalchemist burningalchemist merged commit f815668 into master Sep 27, 2023
@burningalchemist burningalchemist deleted the feat/static-value-metric branch September 27, 2023 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant