Skip to content
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

Add support for aggregations. #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tcolgate
Copy link

This adds support for setting an aggregation. This aggregation is used
for all metrics collection by the exporter. It adjust the resulting
metric names into prometheus recording rule style to allow for
different exporters to collect different aggregations.

We add support for passing the fields, reducer, aligner and align
duration as per other options.

resulting metrics look as follows

'''target_proxy_name_response_code:stackdriver_https_lb_rule_loadbalancing_googleapis_com_https_backend_latencies:sum_bucket{...}```

This adds support for setting an aggregation. This aggregation is used
for all metrics collection by the exporter. It adjust the resulting
metric names into prometheus recording rule style to allow for
different exporters to collect different aggregations.

We add support for passing the fields, reducer, aligner and align
duration as per other options.

resulting metrics look as follows

'''target_proxy_name_response_code:stackdriver_https_lb_rule_loadbalancing_googleapis_com_https_backend_latencies:sum_bucket{...}```
@tcolgate
Copy link
Author

This is just work in progress to see if you would be interested in this, and if so, to discuss the overall design. Issues with this implementaiton:

  • The aggregation is applied to the entire exporter, not per metrics prefix (it would make more sense, but the resulting UI could be a big gnarly)
  • The metrics names aren't quite right, this could be fixed by manuall producing the const histsogram metrics.
  • Not fixed up the tests as yet.

@SuperQ
Copy link
Contributor

SuperQ commented May 1, 2020

This is an interesting idea. It looks like the change needs to be rebaesd.

One comment, exporters should not use : in metric names, since this is reserved for recording rules.

@tcolgate
Copy link
Author

@SuperQ so, my thinking here was that the metric is already aggregated so that the names attempt to match what you'd get if you created a recording rule for the same purpose. Other than replacing with an underscore, do you have any other ideas regarding naming?

@tcolgate
Copy link
Author

FWIW, we never used this code, because I didn't really ant to maintain yet another fork in house, but I'd be happy to polish this PR , since it does seem like useful functionality. May not have time in the next two weeks though.

@SuperQ
Copy link
Contributor

SuperQ commented Jun 28, 2020

I think we can just close this. I think aggregating in the exporter might be a bit more than we want to support.

@SuperQ SuperQ closed this Jun 28, 2020
@SuperQ
Copy link
Contributor

SuperQ commented Jun 29, 2020

After having a discussion on Slack, and looking at some of the use of Stackdriver data we have, this is more useful than I previously thought.

@SuperQ SuperQ reopened this Jun 29, 2020
@SuperQ
Copy link
Contributor

SuperQ commented Aug 27, 2020

Any interest in reviving this?

@SuperQ
Copy link
Contributor

SuperQ commented Aug 27, 2020

I experimented with this a bit, I think there needs to be some changes.

In order for this to be useful generally, we need to supply per-metrics-prefix aggregation requests. Otherwise it will try and apply aggregations to prefixes that don't make sense.

I'm thinking something along the lines of this:

networking.googleapis.com/vm_flow/egress_bytes_count|fields=metric.label.remote_subnetwork;aligner=ALIGN_DELTA;reducer=REDUCE_SUM;period=1m

Part of the problem here, is we still accept ENV vars for input. This makes command line parsing much more difficult, as we need a lot of string separators.

IMO, I think we need to drop the ENV vars, and change the --monitoring.metrics-type-prefixes to a single input, multi-flag.

@tcolgate
Copy link
Author

tcolgate commented Sep 2, 2020

Sorry for the late response, I'll need to take some time to get my head around this again.

@SuperQ
Copy link
Contributor

SuperQ commented Sep 2, 2020

@tcolgate No worries. I had some more thoughts about this, and I think the best way forward would be to move the metrics prefixes to a config file. I've filed #106 to track this idea.

Basically, it would be more like the balckbox/snmp exporters. Rather than just a list of "metrics prefixes", there would be scrape modules with different prefixes and aggregations.

@priximmo
Copy link

priximmo commented Dec 4, 2020

Hi, @tcolgate have you find another solution to collect stackdriver_https_lb_rule_loadbalancing_googleapis_com_https_backend_latencies. I search to scrape the same metric with prometheus. Cardinalities of this metric don't help us.

Maybe have you found another solution ?

Thank you for your help.

@yyzh1
Copy link

yyzh1 commented Apr 21, 2023

sorry for digging up an old thread. is this still being worked on?

Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants