hashicorp / hashicorp/nomad

Enrich logs with metadata

Open
#10,219 3 comments 11 reactions 0 assignees View on GitHub
theme/logging type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal

Nomad logs which are placed inside the `allocs` directory capture the application logs from `stdout/stderr` directly. There are ways to get metadata using the `docker` driver, by using `logging.config.labels` property, thanks to https://github.com/hashicorp/nomad/pull/9885 which was merged recently. However, I am not sure if there's a way to get this metadata for other task drivers and enrich the logs in the same way. Currently Nomad is basically outsourcing the job of enriching the logs to Docker driver's capabilities. Does it make sense for Nomad to have this feature built in?

### Use-cases

Can get logs with additional context like Job ID, Name, Namespace etc for all jobs started with any task execution driver.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the Docker driver's logging.config.labels behavior introduced by PR 9885 and how Nomad writes stdout/stderr logs under the allocs directory. Compare that path with other task drivers and document a concrete cross-driver metadata design. Done requires an agreed implementation scope or an explicit feasibility conclusion.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.