We are using OpenTelemetry's httpcheckreceiver like this:
receivers:
httpcheck:
targets:
- endpoint: https://www.example.com/status
method: GET
But we also want to check if the body contains a specific string, for example "ok".
Is this possible via configuration in the httpcheckreceiver? Or by using another receiver? Or do you have any other ideas/solutions?
I can't find anything about it in httpcheckreceiver's docs.
I've found an issue and a PR related to it, but it haven't been merged: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/24913 https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/27015/
I'm afraid this is not currently possible as of writing this answer in March 2024, at Otelcol version 0.96.0.
The pull request https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/27015/ was indeed aiming to add the possibility to check the body of the response for specific string, but unfortunately after some discussion got closed as inactive. Hopefully this will be picked up again and implemented soon.
I don't know of any other way to do this at this time with the OpenTelemetry Collector.