Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically include short git SHA in each log trace #3277

Open
KendallWeihe opened this issue Oct 31, 2024 · 0 comments
Open

Automatically include short git SHA in each log trace #3277

KendallWeihe opened this issue Oct 31, 2024 · 0 comments
Assignees
Labels
dx enhancement New feature or request otel

Comments

@KendallWeihe
Copy link
Contributor

KendallWeihe commented Oct 31, 2024

I'm not familiar with the logging DX with FTL, I'm just now ramping up, so apologies in advance for the incoherence.

In the past, for production debugging, it's been very valuable for each log trace to include the shortened git SHA for which the given code was built at. I've included the SHA as a prefix to a log trace, but if I understand correctly, we may automatically include it as an attribute -- again, not sure of the exact mechanism. When I've done this in the past, it's a build-time environment variable (for example setting an ENV in a Dockerfile) and then in the code at runtime it's read from the env var and included in the log trace.

I'm aware we have this logger:

logger := ftl.LoggerFromContext(ctx)

And I would imagine in our codebase I can make this feature request work, but I'm thinking it would be a good native feature for FTL. Meaning, if I instantiate the logger like I did above, then every log trace will automatically include the shortened git SHA for which the given code was built from.

@KendallWeihe KendallWeihe added dx enhancement New feature or request otel labels Oct 31, 2024
@github-actions github-actions bot added the triage Issue needs triaging label Oct 31, 2024
This was referenced Oct 31, 2024
@stuartwdouglas stuartwdouglas self-assigned this Oct 31, 2024
@github-actions github-actions bot removed the triage Issue needs triaging label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx enhancement New feature or request otel
Projects
None yet
Development

No branches or pull requests

2 participants