-
Notifications
You must be signed in to change notification settings - Fork 34
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
Support more tags in prometheus metrics #27
Support more tags in prometheus metrics #27
Conversation
…o all prometheus metrics
and add options to the example json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, but I have some concerns about the memory consumption
this should also affect other exporters if they report the path tag
c419b42
to
2e0a45c
Compare
I've now added both the server and client part. When updating kraken-ce to this, it will be required to change line 50 in |
@PhilippHeuer @kpacha, Hi! What's the status of this PR? The PR looks interesting to me. If I could help something, let me know. |
Co-Authored-By: Oleg Skovpen <oskoi@protonmail.com>
The state is as described above, the only open point is: The client pattern gets reported as I still think we should decide on a common format which will be used to report both server and endpoint metrics. Personally i would prefer I already build a custom kraken ce with the modified opencensus module and it was working fine in my tests - but i didn't do any performance tests so i don't know what kind of performance impact this has. (as i also didn't notice the transport wrapper that was recreated on each request) |
As for me
I think it would be better to use the format that is used in the configuration, i.e.: @PhilippHeuer @kpacha what do you think? |
@oskoi i personally would still prefer to provide the parameters in some kind of defined format regardless of the used router implementation. If the tags change because the used router implementation is changed in the future (gin -> mux) then it would break all dashboards / reporting / whatever you do with those metrics since the same endpoint would suddently have a different path tag. |
@PhilippHeuer yes, I also meant this. I suggested using the agnostic format that is used by krakend in a config file. |
@oskoi thats a good idea, i didnt think about the format used in the config file ... |
@kpacha @PhilippHeuer friendly ping :) what's the status of PR? |
@oskoi , the branch has conflicts and the build is failing... |
My team and I at work could really use this feature as well. What can I do to help get this moving? |
@PhilippHeuer you invested a lot of time in this issue, but unfortunately, it couldn't be merged because of the conflicts. Are you still interested in the contribution? Thanks |
@alombarte yes, i will resolve the open conflicts. I would test everything again first to make sure its still working and look if i can remember any open tasks/todos. |
I resolved the conflicts. While reviewing this again i resolved the following issues:
I also created a pr to kraken-ce as draft for a one-line change that is required after this pr gets accepted. Questions:
I think this is good for a new review. |
Upvote for this PR 👍 Thanks for this amazing work @PhilippHeuer |
http.go
Outdated
@@ -18,15 +20,28 @@ func NewHTTPClient(ctx context.Context) *http.Client { | |||
return defaultClient | |||
} | |||
|
|||
func HTTPRequestExecutor(clientFactory transport.HTTPClientFactory) transport.HTTPRequestExecutor { | |||
func HTTPRequestExecutor(clientFactory transport.HTTPClientFactory, cfg *config.Backend) transport.HTTPRequestExecutor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd create a new function HTTPRequestExecutorFromConfig
so we don't break the interfaces and signatures exposed by the package
internally, the HTTPRequestExecutor
function could just call the new one with a nil configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code for backend path aggregration needs the config though, otherwise it can't access the configured pattern and only the requested url.
So to prevent users of the old method from running into the cardinality issue, i think we could return a empty string as path if no config is available.
@PhilippHeuer this looks pretty good to me. I'm merging it. thanks for the contribution and for your patience with me and the review process!!! |
Hi @PhilippHeuer, let me thank you personally for having followed this PR for a year and a half. I promise it wasn't intentional, neither a test, but if it were you would have passed it with the highest score. The functionality will be incorporated on the next KrakenD release 1.4 (or maybe 2.0). I want to also thank you on behalf of anonymous companies I cannot mention as this merge was really awaited. Let me know if there is anything we can do for you, just ASK (albert AT krakend.io) |
This pull request was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link. |
Implementation for issue #23 to add more tags to the prometheus metrics endpoint.
This adds the following 4 configuration options (tag_*) to the prometheus config:
It will iterate over all client / server metrics and add the tags if they were not present yet, if the value is set to true - does nothing if its
not set
orfalse
, so its not a breaking change for users of the metrics right now.I'm not sure yet if those tags also affect influxdb metrics, if they do the config options might need to be moved into the toplevel of the opencensus config.
I'm open for feedback as i'm not too familiar with opencensus or krakend yet ;)
Are the configuration options fine like that or do we want this configurable on a per metric base? or just a format option which has a few valid values, ie.
normal
/extended
?