apache_exporter icon indicating copy to clipboard operation
apache_exporter copied to clipboard

Set User-Agent to something more meaningful

Open theS1LV3R opened this issue 1 year ago • 1 comments

At the moment Apache exporter uses the default Go HTTP User-Agent (Go-http-client/1.1), spamming HTTP request logs with the following:

::1 - - [03/Jan/2024:09:44:01 +0100] "GET /server-status?auto HTTP/1.1" 403 6865 "-" "Go-http-client/1.1"
::1 - - [03/Jan/2024:09:45:31 +0100] "GET /server-status?auto HTTP/1.1" 403 6865 "-" "Go-http-client/1.1"
::1 - - [03/Jan/2024:09:47:01 +0100] "GET /server-status?auto HTTP/1.1" 403 6865 "-" "Go-http-client/1.1"
::1 - - [03/Jan/2024:09:48:31 +0100] "GET /server-status?auto HTTP/1.1" 403 6865 "-" "Go-http-client/1.1"
::1 - - [03/Jan/2024:09:50:01 +0100] "GET /server-status?auto HTTP/1.1" 403 6865 "-" "Go-http-client/1.1"

Is it possible to change the User-Agent that is used, like Prometheus did a while ago? I suggest using something like Apache-Exporter/<version>, in the same way they did: https://github.com/prometheus/prometheus/pull/2447/files

theS1LV3R avatar Jan 03 '24 11:01 theS1LV3R

@theS1LV3R sounds good to me, would you like to submit a PR?

blkperl avatar Jan 10 '24 00:01 blkperl

Thanks @theS1LV3R for the contribution!

blkperl avatar Jan 30 '24 22:01 blkperl