What Grafana version and what operating system are you using?
10.2.2 Fedora Workstation 39
What are you trying to achieve?
I am trying to show http response status of some systems using http_response telegraf input plugin.
How are you trying to achieve it?
I added system URL into telegraf.conf file, and test it in Influxdb to only fetch result_code, after that I copied the flux query to grafana panel selecting influxdb as data source. Here is the flux query
Your above function did not match that shown in your screenshot (where it showed fn: mean), but nevertheless, I do not think that will resolve your issue.
Can you try this? Maybe fiddle around with the fields box?
Your above function did not match that shown in your screenshot (where it showed fn: mean), but nevertheless, I do not think that will resolve your issue.
Yeah, I was trying to change mean to last and vise-versa just to check if it works, unfortunately it doesn’t.
I have tried changing the reducer function options as you suggested, but in all case it shows two stats at the same time.
I have configured a outputs.prometheus_client.
If I scrape the prometheus endpoint during a transition of the http_response endpoint, I get two states at a time:
=> START
# HELP animals_http_response_code Telegraf collected metric
# TYPE animals_http_response_code untyped
animals_http_response_code{host="telegraf-polling-service",method="GET",result="response_status_code_mismatch",result_type="response_status_code_mismatch",server="http://localhost:3000/animals",status_code="201"} 201
=> after next polling (10s)
# HELP animals_http_response_code Telegraf collected metric
# TYPE animals_http_response_code untyped
animals_http_response_code{host="telegraf-polling-service",method="GET",result="response_status_code_mismatch",result_type="response_status_code_mismatch",server="http://localhost:3000/animals",status_code="201"} 201
animals_http_response_code{host="telegraf-polling-service",method="GET",result="success",result_type="success",server="http://localhost:3000/animals",status_code="200"} 200
=> after about 1min
# HELP animals_http_response_code Telegraf collected metric
# TYPE animals_http_response_code untyped
animals_http_response_code{host="telegraf-polling-service",method="GET",result="success",result_type="success",server="http://localhost:3000/animals",status_code="200"} 200
@lormey could this be a problem with the input plugin it self? I am not getting it, this thing works fine on my other Grafana server, but not on current system.
Finally, it worked for me, and the issue was not with Grafana, my telegraf and influxdb config was incorrect. I defined [[outputs.influxdb_v2]] twice and used two different buckets with that, that was the reason why I was seeing two results at the same time.