-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Selectively rename metrics #22735
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I am going to share a nuance of the transformprocessor that I think you're running into but I'm not entirely sure. Since you need access to the attributes you're running in the If When debugging transformprocessor statements I find the best solution is to add a loggingexporter with |
We indeed noticed that the final name to which the metrics are renamed is the last one which is outputted by the cassandra exporter. When we skip the rename step, we can verify that the values of "is_rename", "new_name" and "rararandom" (after a couple of days of trying I got a bit tired 😅) are correct. However, skipping the rename or any other step which was provided by datastax generates a ton of errors in the collector because it's not happy with the intermediate state and conflicting data. The biggest problem we're facing with debugging this is the vast amount of metrics which are created by the exporter and the fact that we're not always 100% sure how the exported metrics are supposed to work (we're extremely happy that datastax provided the transformations and an out of the box grafana dashboard that uses these transformed metrics). For now we've settled with having an intermediate prometheus which forwards then forwards the metrics to our managed AWS prometheus instance, though this is far from ideal. |
@PW999 if you can I would recommend debugging locally with a payload that you can trigger manually. This will make it easier to identify how the metric is changing. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I feel confident that the transformprocessor can handle this situation. I am going to close this issue, but ping me if you feel it should remain open. |
Component(s)
processor/transform
Is your feature request related to a problem? Please describe.
Due to open-telemetry/opentelemetry-collector#3410 it is currently impossible to use the
metric_relabel_configs
to rename metrics. A use case we have from https://github.com/datastax/metric-collector-for-apache-cassandra requires us to do a lot of specific renamings (see https://github.com/datastax/metric-collector-for-apache-cassandra/releases/download/v0.3.4/datastax-mcac-dashboards-0.3.4.zip).A simple example is
The regex matches different metrics
collectd_mcac_micros_count_total
,collectd_mcac_micros_sum
,collectd_mcac_micros_bucket_654949
, etc ... However, these are shared by a lot of other different "metrics" which are distinguished by the "mcac" label.E.g.
I've tried a lot of different ways to specifically rename the metrics and limit the amount of impacted metrics, resulting in this ugly piece of (semi-generated) code
The
new_name
attribute is set correctly (even when running all ~30 similar blocks of code), however, theset(metric.name, attributes["new_name"])
renames all metric values.So, taking the above example, the result (without the extra labels) would be
Describe the solution you'd like
I'm not 100% sure what is exactly possible, but preferably it would be great that
where
statements in aset(metric.name, attributes["new_name"])
line could be honored.If that would result in undesirable side-effects when implemented directly into the processor, it would be great if there would be a possibility to do those steps by hand using something like a
copy_metric(from_name, to_name)
. This way we could copy the metric to a new one with as nameattributes["new_name"]
A note in the documentation about these limitations would also be very nice.
Describe alternatives you've considered
The metricstransformprocessor can also rename metrics, but substitution only works on with groups from the metric name and not from the
experimental_match_labels
.I've also thought about using the metricsgenerationprocessor and scale the metrics with 1.0, but with it's development stability level it's a bit too fresh for our tastes.
Additional context
No response
The text was updated successfully, but these errors were encountered: