Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[extension/healthcheckv2] Add HTTP service (#33528)
**Description:** This PR is the third in a series to decompose #30673 into more manageable pieces for review. This PR introduces the HTTP service which builds upon the aggregation logic added in the [previous PR](#32695). Following this will be a PR to add a gRPC health check service. A summary of the changes is below: - http service based on component status - supports legacy behavior and config; to be deprecated - overall collector health can be monitored as well as pipeline health - additionally the verbosity of the response can be controlled by passing a `verbose` query parameter - adds optional endpoint to retrieve the config of the running collector - this is currently unredacted JSON and is opt-in Note, that there will be a follow up PR to add the gRPC service. This will be relevant when reviewing the extension code. It is setup to manage a slice of subcomponents. The HTTP and gRPC services are the subcomponents to be managed, and both implement the `Component` interface. See the [reference PR](#30673) for details. I've provided some examples below to help get an idea of what the responses look like when serialized as JSON. **Collector Health Example Response** Below is an example verbose response for the overall collector health. Note, the top level fields correspond to the collector overall, the next level corresponds to the pipelines, and the level below that is the health of the individual components in each pipeline. ```json { "start_time": "2024-01-18T17:27:12.570394-08:00", "healthy": true, "status": "StatusRecoverableError", "error": "rpc error: code = ResourceExhausted desc = resource exhausted", "status_time": "2024-01-18T17:27:32.572301-08:00", "components": { "extensions": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.570428-08:00", "components": { "extension:healthcheckv2": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.570428-08:00" } } }, "pipeline:metrics/grpc": { "healthy": true, "status": "StatusRecoverableError", "error": "rpc error: code = ResourceExhausted desc = resource exhausted", "status_time": "2024-01-18T17:27:32.572301-08:00", "components": { "exporter:otlp/staging": { "healthy": true, "status": "StatusRecoverableError", "error": "rpc error: code = ResourceExhausted desc = resource exhausted", "status_time": "2024-01-18T17:27:32.572301-08:00" }, "processor:batch": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571132-08:00" }, "receiver:otlp": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571576-08:00" } } }, "pipeline:traces/http": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571625-08:00", "components": { "exporter:otlphttp/staging": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571615-08:00" }, "processor:batch": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571621-08:00" }, "receiver:otlp": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571625-08:00" } } } } } ``` **Pipeline Health Example Response** This is an example verbose response for the `traces/http` pipeline. The top level corresponds to the health of the pipeline, and the second level contains the health of the individual components that make up the pipeline. ```json { "start_time": "2024-01-18T17:27:12.570394-08:00", "healthy": true, "status": "StatusRecoverableError", "error": "rpc error: code = ResourceExhausted desc = resource exhausted", "status_time": "2024-01-18T17:27:32.572301-08:00", "components": { "extensions": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.570428-08:00", "components": { "extension:healthcheckv2": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.570428-08:00" } } }, "pipeline:metrics/grpc": { "healthy": true, "status": "StatusRecoverableError", "error": "rpc error: code = ResourceExhausted desc = resource exhausted", "status_time": "2024-01-18T17:27:32.572301-08:00", "components": { "exporter:otlp/staging": { "healthy": true, "status": "StatusRecoverableError", "error": "rpc error: code = ResourceExhausted desc = resource exhausted", "status_time": "2024-01-18T17:27:32.572301-08:00" }, "processor:batch": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571132-08:00" }, "receiver:otlp": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571576-08:00" } } }, "pipeline:traces/http": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571625-08:00", "components": { "exporter:otlphttp/staging": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571615-08:00" }, "processor:batch": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571621-08:00" }, "receiver:otlp": { "healthy": true, "status": "StatusOK", "status_time": "2024-01-18T17:27:12.571625-08:00" } } } } } ``` **Link to tracking Issue:** #26661 **Testing:** Units / manual **Documentation:** Comments, etc --------- Signed-off-by: Alex Boten <[email protected]> Co-authored-by: Alex Boten <[email protected]>
- Loading branch information