Add information in Consul logs for Nomad service checks
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
Hi folks,
When Nomad service registered in Consu fails, the Consul logs lack information regarding the service itself:
```
2020-03-26T20:43:43.067Z [WARN] agent: Check is now critical: check=_nomad-check-0d041aa75f1c0c212e9b037abd9500a95466fd44
2020-03-26T20:43:43.408Z [WARN] agent: Check is now critical: check=_nomad-check-94eeeeb2d63492142d6dd8d5cbf7e260e74cceb8
```
Unfortunately in this scenario, we have no idea which service/task is failing. Would it be possible to add the extra information? I believe it would help a lot with debugging in general.
We noticed that when a service is healthy, we do get a bit of extra information that includes the job and task name:
```
2020-03-26T20:43:45.206Z [INFO] agent: Synced service: service=_nomad-task-30a5f647-7330-c6f3-b145-9921b22f595b-sidekiq-queue-priority-platform-sidekiq-http
```
Let us know if there's a way to map those generic `_nomad-check-UUID` to an actual service.
Thanks in advance!
Contributor guide
Research direction
The issue names no files or tests. Start by tracing the Consul agent log paths that emit failing and healthy service-check messages, then compare the available check metadata. Done means critical-check logs identify the corresponding Nomad service or task, with tests covering the added context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100