-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Design: proposing new metricsgenerationprocessor #2722
Comments
In addition to the above mentioned approach, I was exploring to see if we can support expressions like Prometheus Recording Rules. Recording rules and pretty generic and roubust. However, considering the complexity and amount of effort required to make something generic like this, I prefer not to go for it right now. We discussed this on last Wednesday's (03/24) Prometheus SIG meeting, and I believe from the meeting we decided to explore/ move with above mentioned simple approach. The configuration is not final, expecting more opinions/suggestions on the configuration. @bogdandrutu @jmacd @jrcamp Would you please have a look to share your thoughts. Thanks in advance. |
@hossain-rayhan Maybe take a look at how we (@dmitryax) did something similar inside the signalfxexporter. It operates on our own datapoints instead of OTLP so can't really be reused but might provide some inspiration: I think it was discussed but I've already forgotten and don't see it in meeting notes. Would this replace metricstransformprocessor? Edit: or the reverse, why can't this be added to MTP? |
@jrcamp thanks, I will look into the signalfxexporter implementation.
I added this in the Open Question section in the description. Thanks. We discussed this in our SIG meeting. @bogdandrutu suggested to create this feature as a new processor. The existing metricstransformprocessor works with old OpenCensus metrics types. We have a plan to rewrite the whole thing and don't want to more code on top of it. |
Thanks for following up, here. The proposal indeed looks simple and well justified, given how much more powerful and free-form the Prometheus recording rules. |
@jrcamp , I looked into signalFx code (following example). I like their idea about naming the metrics like - action: calculate_new_metric
metric_name: memory.utilization
operand1_metric: memory.used
operand2_metric: memory.total
operator: / |
@bogdandrutu @alolita @punya can you review and give you comments / suggestions? |
05/05 Collector SIG meeting discussion notes:
|
Questions that are not answered:
|
Thanks @bogdandrutu . Here are my thoughts-
It does not do specifc calculation on selected metrics. For example, we need to define exact two specific metrics for calculating the
It's the same question where do we want to put this. Another thing this PR only has power to multiply a value with a constant I believe- but not a big deal.
Its updating the units as well as values. User may not want to change the units always. Sometimes they may want to keep two metrics in two different units for the sake of their Dashboard/Console. So, thats my understanding.
I can think of the follwing two options-
I am expecting your guidance here. |
The experimental processor is now available in the contrib repo. |
…alculations (#35428) **Description:** The metrics generation processor would previously hit a panic when the calculation rule was operating on a `sum` metric, instead of a `gauge`. The [component proposal](#2722), [initial implementation](#3433), nor the [README](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricsgenerationprocessor) state that it's a requirement for the metric to be a `gauge`, nor do I think this requirement makes sense. I've updated the logic to account for sum metrics being used and added a test. **Testing:** Added a test for this situation, the test panics before the change and passes after.
…alculations (open-telemetry#35428) **Description:** The metrics generation processor would previously hit a panic when the calculation rule was operating on a `sum` metric, instead of a `gauge`. The [component proposal](open-telemetry#2722), [initial implementation](open-telemetry#3433), nor the [README](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricsgenerationprocessor) state that it's a requirement for the metric to be a `gauge`, nor do I think this requirement makes sense. I've updated the logic to account for sum metrics being used and added a test. **Testing:** Added a test for this situation, the test panics before the change and passes after.
This project supports an important requirement for EKS Fargate Container Insights metrics
Doc update history
Issue Created: 03/17
1st update: 04/28
2nd update: 05/05
SIG meeting discussion
1st discussion: SIG meeting 03/17
2nt discussion: SIG meeting 03/24
3rd discussion: SIG meeting 04/28
4th discussion: SIG meeting 05/05
metricstransformprocessor
.experimental_
. Likeexperimental_resourcegeneration
. We discussed this earlier and Bogdan mentioned today again.Decision: On slack channel discussion, Punya and Josh agreed to move forward with
experimental_
prefix and they both looked into the first PR. Josh approved the PR and waiting for Bogdan's to get it merged.5th discussion: SIG meeting 05/12
Can you explain the use case?
We need to create a new metric from existing metrics. In the new metric, the metric value (Datapoint value) will be different from the existing metric values. Say for example, we have two existing metrics-
pod.memory.usage
andnode.memory.limit
. Now we need to create a new metricpod.memory.utilization
which follows the following equation-pod.memory.utilization
= (pod.memory.usage.bytes
/node.memory.limit
)Another use case is, we need to change the metric values to match the units. Say for example, we have
pod.memory.usage
in Megabytes. But we want to report it in Bytes. So we want to create a new metric which has memory usage in Bytes, likepod.memory.usage.bytes
=pod.memory.usage
* 1048576.Why the existing
metricstransformprocessor
does not support your use case?Existing
metricstransformprocessor
does not have a way to generate a new metric from existing metrics following a given calculation. It has the following functionalities which does not cover our use case-How is it different from existing
metricstransformprocessor
?metricstransformprocessor
, we don't have a way to calculate a new metric from two different existing metrics.metricstransformprocessor
, we don't do any operation which creates a new metric with new value (calculated datapoint values). Though we have options for agreegating same metric values over level set which we are not looking for.Why can't it be part of
metricstransformprocessor
?metricstransformprocessor
works with old OpenCensus metrics types. We have a plan to rewrite the whole thing and don't want to more code on top of it.Design Description:
The metrics generation processor (
metricsgenerationprocessor
) can be used to create new metrics using existing metrics following a given rule. In the beginning, it may support following two approaches for creating a new metric.pod.memory.utilization
metric like the following equation-pod.memory.utilization
= (pod.memory.usage.bytes
/node.memory.limit
)pod.memory.usage
metric values from Megabytes to Bytes (multiply the existing metric's value by 1048576)Configuration
Configuration is specified through a list of generation rules. Generation rules find the metrics which
matche the given metric names and apply the operation to those metrics.
Example Configurations
Create a new metric using two existing metrics
Create a new metric scaling the value of an existing metric
In-Scope
Exception
Open Questions
The text was updated successfully, but these errors were encountered: