Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2k stars 574 forks source link

InfluxDB(2)Writer does not fully print error from InfluxDB(2). Maybe it should #10072

Open RincewindsHat opened 3 months ago

RincewindsHat commented 3 months ago

Is your feature request related to a problem? Please describe.

While debugging problems with a spurious bug in the InfluxDB connection of Icinga2 I had some trouble to find the original problem and it would have been helpful if, instead of just printing

[2024-06-06 18:05:26 +0200] warning/Influxdb2Writer: Unexpected response code: Bad Request
Context:
    (0) Processing check result for 'some-host!some-service'

[2024-06-06 18:05:26 +0200] warning/Influxdb2Writer: Unexpected Content-Type: application/json; charset=utf-8
Context:
    (0) Processing check result for 'some-host!some-service'

it would actually print the HTTP body with something like this:

{"code":"invalid","message":"unable to parse blablabalbla,metric=bla value=-inf 1717686350': invalid number"}

Describe the solution you'd like

Printing the full HTTP body would be nice.