-
Notifications
You must be signed in to change notification settings - Fork 2.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
[processor]: aggregate_on_attributes function in transform processor not working as expected in conjunction with keep_matching_keys #36517
Comments
Hi @Shindek77 ! I just looked into this - If I understood this correctly, then the desired behavior might work with the following config, that first removes the
Hope this helps - if not, please let me know and I will continue to look into this |
Pinging code owners for processor/transform: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label. |
Hello @bacherfl ,
After that all remaining processor works .it means at the end aggregate_on_attributes on these above three time series so final ans comes as
Just Idea: as per above Example: moves all resource attributes to datapoint attributes first. i.e. both
|
Thanks for the feedback @Shindek77 - one possibility to move all resource attributes to the datapoints to make them available for the
Note: the |
Hello @bacherfl , I tried with below approach
With this firstly it making all resource attributes as datapoints with same name region and service_name as I can see in otel logs...after that another processor needed to delete actual all resource attributes...but then while aggregation we are getting only two time series as expected but value is not aggregated properly..
|
Hello @bacherfl , As you know we are getting lot of metrics data with many labels/attributes (resources/datapoint attributess) on our otel collector which is deployed as deployment on our k8s cluster. We have tested it to reduce the number metrics labels which are not required in our metric time series, and the output time series should have only required labels and the aggregated value. receivers: processors: exporters: services: With the above configuration we have tested two cases: By keeping otel-collector replicas=1 By keeping otel-collector replicas=6 could you please help on this what is going wrong and how can we set?? |
Hi @Shindek77 and thanks for the update - I will look into this today and try to see what is happening here. Do you also have some example payload that can be sent to the otlp receiver to reproduce this behavior? Also, if you are using multiple replicas, keep in mind that metrics that should be grouped together need to be sent to the same instance of the collector - is there currently any mechanism in place that ensures that? |
Component(s)
processor/transformprocessor
Describe the issue you're reporting
Hello,
Our Goal: we want to reduce the number metrics labels which are not required in our metric time series, as a output its should the number of time series but the new reduces metrics time series should values aggregated from the time series which was coming before drop of labels
Example:
Input Metrics Data
**Goal:
Resource Attributes: region, service_name
Datapoint Attributes: method, status
Keep:
region (resource attribute)
method (datapoint attribute)
Drop:
service_name (resource attribute)
status (datapoint attribute)**
Final Results:
Solution: After analysis we got to know that we can use transform processor in conjuction with aggregate_on_attributes function…
as per docs aggregate_on_attributes function aggregates all datapoints in the metric based on the supplied attributes as well as removes all attributes that are present in datapoints except the ones that are specified in the attributes parameter.
But after testing we got know that it is working only on datapoint attributes but not on the resource attributes which are present in our metrics.
So then as per docs The aggregate_on_attributes function can also be used in conjunction with keep_matching_keys or delete_matching_keys.
Then we have tried with the same so that with keep_matching_keys we will keep only required resource attributes and drop others and with aggregate_on_attributes will give the list of datapoint attributes with we want to keep and it will aggregation also.
Configuration For Same:
But when keep_matching_keys(resource.attributes, "^(region).*")
This keeps only region from the resource attributes and removes service_name.
The intermediate result coming as
Then aggregate_on_attributes("sum", ["method"]) works
which give final results as:
But as per docs it should give results as as both works at once:
So please help on this how we can get the results are we wanted....
We are getting it as expected if we use only aggregate_on_attributes but it works only on datapoint attributes as well as we have to us only one replica of Opentelemetry
So how use only aggregate_on_attributes also with many replicas of OTEL. And why its working like this??
The text was updated successfully, but these errors were encountered: