-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Allow the input plugin http_response
to generate Prometheus friendly metrics
#3803
Comments
If possible, I'm willing to work on this feature |
Maybe we add I suggest not adding There is a fair bit of field duplication going on if we do this, so ultimately we should deprecate the string fields in favor of the tag + int field. This just means we comment it in the README. To further explain the reasoning above, we have been trying to figure out the best way to represent enumerations so that they will look good in Grafana/Chronograf and in multiple databases. I think what we are arriving at is to have a tag with a string description and a field with a numeric representation. The numeric representation is mostly for two reasons:
Let me know what you think of the scheme and how well it works out with prometheus. |
I'm having a hard time following your suggestion. Let me see if I got it right:
In the end we would have a newly added Did I understand you correctly? |
One minor correction, the Here is a diff of what I'm thinking: - http_response,method=GET,server=http://www.github.com http_response_code=200i,response_time=6.223266528,result_type="success" 1459419354977857955
+ http_response,method=GET,server=http://www.github.com,status_code=200,result=success http_response_code=200i,response_time=6.223266528,result_type="success",result_code=0i 1459419354977857955 |
Ok, I understand now. As a whole, as you said, there is a lot of field duplication going on. I guess that is required for the time being to avoid breaking changes, and come 2.0 you will drop the string fields as part of your new philosophy regarding the representation of enumerations. From a prometheus standpoint, the ideal would be only one field with everything else represented in tags, so the extra fields for enumerations ( If possible, I'd like a way to deactivate the generation of these fields to reduce the amount of generated and ingested metrics by Prometheus, and be able to set a default numeric representation of "null" value for the latency. But I understand if this additional feature does not align with the project Now, I haven't used Chronograf/InfluxDB, so take what I'm about to say with a grain of salt. I don't see the usefulness of representing enumerations as an integer value. You mentioned two points:
PS. I'll get working on these changes this weekend |
Feature Request
Right now, the
http_response
plugin sets the HTTP return code (200, 301, 502, etc) as a numeric field. This causes Prometheus (which doesn't have the concept of fields) to generate a new metric wich value is the integer value of the HTTP response.This not only generates another metric to ingest by Prometheus, but also makes it really cumbersome to run queries against this data, as this type of information is better represented as a Tag in Prometheus
Additionally, when a timeout occurs, the plugin setups only one field, the string field
result_type
, which causes the Prometheus output plugin to transform it to a tag (as there are no string values in Prometheus metrics outside of tags). This results in a metric with no fields, which causes de Prometheus output plugin to drop the metric, as Prometheus metrics cannot exist without a value.Proposal:
Add an option to add the
http_response_code
andresult_type
fields as tags, so they can be easily aggregated over in Prometheus databasesAdd an option to always set the
response_time
field, so the plugin always returns a numeric value, with optional options to specify what value to set this field to in case of timeout (-1, 1000, actual time spent waiting for a response, etc)Current behavior:
Currently metrics received from the
http_response
input plugin are not Prometheus friendly. HTTP return codes are difficult to aggregate in Prometheus and no metrics are received when a timeout occursDesired behavior:
Metric received from the
http_response
input plugin by a Prometheus database should be easy to aggregate by HTTP return codes, and metrics should still be received in case of a timeoutUse case: [Why is this important (helps with prioritizing requests)]
Prometheus is currently an important and popular TSDB, and measuring return codes and latency of specific URLs is an important and very useful black box monitoring technique. This feature would make it easier for Prometheus users to keep logs of latency, uptime and incidents of their services using Telegraf
The text was updated successfully, but these errors were encountered: