Dabz / ccloudexporter

Prometheus exporter for Confluent Cloud API metric
https://docs.confluent.io/current/cloud/metrics-api.html
87 stars 53 forks source link

Enable Topic Exclusion #57

Open abraham-leal opened 3 years ago

abraham-leal commented 3 years ago

Resolves #54.

What changed?

The query will now be optimized to either:

To filter results of a query, excludeTopicsRegex is now supported to not display results in the /metrics endpoint if it matches the regex provided. This regex field is a list, allowing the matching of multiple regex.

NOTE: Regex filtering does NOT improve the query, just removes the output.

Is there any testing?

Yes, unit testing has been implemented in modified classes, namely:

Why is this a Draft PR?

The Confluent Metrics API currently is having some trouble with the Unary operator (used to optimize the query filtering). This PR is not ready for merging until that filter quality is resolved and some more testing can happen.

Open for discussion

First time contributing, so please critique my variable naming / style to conform to some other codebase implied standards. I tried to adhere to them, hopefully there aren't that many hiccups. Some files are changed just because I found some typos.

abraham-leal commented 3 years ago

Alright, please let me know if you have any comments on the latest commit. If not, I'll still wait until the Metrics API can handle the Unary Filter well to open it for merging.

abraham-leal commented 3 years ago

Merged with v2 branch, should be ready for merge after v2 is on master.

abraham-leal commented 3 years ago

Hey @Dabz, this PR is ready for review when you have time. I'm still doing some perf testing to make sure the new functionality doesn't slow down the exporter much, but the logic will probably stay the same if I do any performance improvements. :)