samber / samber/slog-betterstack
Add attributes on top level
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 14
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Hey there,
is it possible to add default attributes to the top level of the log record?
This is useful to enable easier querying in betterstack, by e.g. adding the source tag on the top level of the record.
I have tried to add it to the record by using
instance.With("scope", "my-scope")
However this shows up as extra.scope in betterstack.
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how instance.With("scope", "my-scope") is processed by the Betterstack handler and why it becomes extra.scope. Compare that path with the top-level log record structure described in the issue. Done means default attributes appear as top-level fields and remain usable for Betterstack queries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100