lburgazzoli opened a new issue, #3967:
URL: https://github.com/apache/camel-k/issues/3967
When a pod fails, camel-k scrapes the health endpoint to extract a some
meaningful information about the failure, as example:
```yaml
status:
conditions:
- lastTransitionTime: "2023-01-09T09:42:52Z"
lastUpdateTime: "2023-01-09T09:43:24Z"
message: "[Pod http-sink-9dd696db6-xwlsf runtime is not ready:
map[bootstrap.servers:kafka.acme.com:443
check.kind:READINESS error.message:Failed to construct kafka
consumer error.stacktrace:org.apache.kafka.common.KafkaException:
Failed to construct kafka consumer\n\tat
org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:825)\n\tat
org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:666)\n\tat
org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:647)\n\tat
org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:627)\n\tat
org.apache.camel.component.kafka.DefaultKafkaClientFactory.getConsumer(DefaultKafkaClientFactory.java:34)\n\tat
org.bf2.cos.connector.camel.kafka.ClientFactory.getConsumer(ClientFactory.java:84)\n\tat
org.apache.camel.component.kafka.KafkaFetchRecords.createConsumer(KafkaFetchRecords.java:241)\n\tat
org.apache.camel.component.kafka.KafkaFetchRecords.createConsumerTask(KafkaFetchRecords.java:201)\n\tat
org.apache.camel.support.task.ForegroundTask.run(ForegroundTask.java:123)\n\tat
org.apache.camel.component.kafka.KafkaFetchRecords.run(KafkaFetchRecords.java:125)\n\tat
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat
java.base/java.lang.Thread.run(Thread.java:829)\nCaused by:
org.apache.kafka.common.config.ConfigException:
No resolvable bootstrap urls given in bootstrap.servers\n\tat
org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:89)\n\tat
org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:48)\n\tat
org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:732)\n\t...
14 more\n group.id:9bsv0s5m28kg02ogi9h0
route.id:9bsv0s5m28kg02ogi9h0-source
topic:demo]]"
reason: Error
status: "False"
type: Ready
```
However the error is added as a map which make it not easy to parse for
tools.
I think it would be nice if we add an option to render the `message`
property as JSON or to add an additional condition property like `details` to
include a JSON formatted output, something like:
```yaml
status:
conditions:
- lastTransitionTime: "2023-01-09T09:42:52Z"
lastUpdateTime: "2023-01-09T09:43:24Z"
message: "Pod http-sink-9dd696db6-xwlsf runtime is not ready"
details: '{ "bootstrap.servers": "kafka.acme.com:443", "check.kind":
"READINESS", "error.message": "Failed to construct kafka consumer ..." }'
reason: Error
status: "False"
type: Ready
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]