You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kafkareceiver: connect async, report status (#40705)
#### Description
Make consumer group creation asynchronous (i.e. move it to background
goroutine), and report component status.
This change ensures that the collector can start up if the Kafka cluster
is not available or the consumer group creation fails due to some other
transient, retryable error. We also now report the component status to
indicate if and when the consumer group has been successfully created,
and whether the receiver is ready to consume messages. This can be
observed via the healthcheckv2 extension, e.g. for health/readiness
probes.
#### Link to tracking issue
Fixes#40516
#### Testing
First, I set up the collector with the following config:
```yaml
extensions:
healthcheckv2:
use_v2: true
component_health:
include_permanent_errors: true
include_recoverable_errors: true
recovery_duration: 30s
http:
endpoint: localhost:13133
status:
enabled: true
path: /health/status
config:
enabled: true
path: /health/config
receivers:
kafka:
brokers: [localhost:9092]
exporters:
debug:
verbosity: detailed
service:
extensions: [healthcheckv2]
pipelines:
metrics/kafka:
receivers: [kafka]
exporters: [debug]
```
Then:
1. Without Kafka running locally, start the collector
2. Running `curl 'http://localhost:13133/health/status?verbose' | jq .`,
note that the receiver's status moves to StatusRecoverableError and
reports an error like "kafka: client has run out of available brokers to
talk to: dial tcp ..."
3. Start Kafka: `docker run --rm -p 9092:9092 --name broker
apache/kafka:4.0.0`
4. Continue curling the status, and observe it moves to StatusOK
5. Stop Kafka, observe status moves back to StatusRecoverableError
#### Documentation
No changes
---------
Co-authored-by: Sean Marciniak <[email protected]>
0 commit comments