-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metrics: support relabel aggregate #2130
base: master
Are you sure you want to change the base?
Conversation
inorder to aggregate metrics to node (or others) level, here add an optional to action, which is "aggregate_label". the usage is similar to action "drop_label". For example: ``` curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '[ \ { \ "source_labels": [ \ "__name__" \ ], \ "action": "aggregate_label", \ "target_label": "shard", \ "regex": "column_family_live_sstable" \ } \ ]' 'http://localhost:10000/v2/metrics-config/' ``` Signed-off-by: qiulijuan2<qiulijuan2_yewu@cmss.chinamobile.com>
I'm not sure if aggregate should be done on a metric level or on a metric family level, see my pr #2121 |
In my opinion, first of all, this way is convenient to set a single metric or a group metrics to be aggregated, so just add a function to relabel_config, secondly, it changes the minimum range of code. |
Most of the time, aggregation is on the metric family level, a single instance cannot be aggregated, which which metrics? Please do not merge |
In prometheus.cc, it seems that aggregate operation is done during http request ? And in registration time, it just sends the aggregate_labels arg to stored in map , right? @amnonh |
Prometheus takes the relabel from the metrics family, that's why it make more sense to put the configuration at that level |
Do u mean that add the aggregate_labels to struct of metric_info makes no sense, even thought send the aggregate_labels value to the metric_family_info ? |
@amnonh Here are three points I'm interested in :
|
ping @amnonh I am eager to receive your reply. |
in order to aggregate metrics to node (or others) level, here add an optional to action, which is "aggregate_label". the usage is similar to action "drop_label". For example:
Signed-off-by: qiulijuan2qiulijuan2_yewu@cmss.chinamobile.com