[#146] node: Add trace_id to logs #697
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#697
Loading…
Reference in a new issue
No description provided.
Delete branch "achuprov/frostfs-node:traceid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Before
After
Signed-off-by: Alexander Chuprov a.chuprov@yadro.com
32fca98a91
tof668c0142c
WIP: [#146] node: Add trace_id to logsto [#146] node: Add trace_id to logs[#146] node: Add trace_id to logsto WIP: [#146] node: Add trace_id to logsWIP: [#146] node: Add trace_id to logsto [#146] node: Add trace_id to logs@ -4,6 +4,7 @@ import (
"context"
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
traceUtils "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/trace"
I suggest changing the package name:
git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/trace
->git.frostfs.info/TrueCloudLab/frostfs-node/pkg/trace
Everything can be
util
, so in some time we will drop this package i hope.How about
ExtractTraceIDFromContext
->GetTraceID
I missed that in frostfs-observability the package is called tracing.
So
tracingPkg "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/tracing"
i think is better.Not resolved: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/trace -> git.frostfs.info/TrueCloudLab/frostfs-node/pkg/tracing
Misunderstood the essence of the correction). Fixed
f668c0142c
to14fd729ed6
@ -0,0 +15,4 @@
}
spanContext := span.SpanContext()
traceID := spanContext.TraceID()
return traceID.String()
Is it possible to squash three lines in one?
14fd729ed6
to861d48e6e4
861d48e6e4
to180a6737da
And what is the difference?
180a6737da
tocc6f42f704
From test logs:
Why there are zeros?
Can we replace zeros with empty string?
cc6f42f704
to9dc489e8f5
Not resolved git.frostfs.info/TrueCloudLab/frostfs-node/pkg/trace -> git.frostfs.info/TrueCloudLab/frostfs-node/pkg/tracing
9dc489e8f5
to2958bf6880
@ -0,0 +10,4 @@
// It returns an empty string if no trace ID is found.
func GetTraceID(ctx context.Context) string {
span := trace.SpanFromContext(ctx)
if span == nil || span.SpanContext().TraceID() == [16]byte{} {
Should we move
[16]byte{}
to const?@ -376,1 +387,3 @@
zap.String("tree", treeID))
zap.String("tree", treeID),
zap.String("trace_id", tracingPkg.GetTraceID(ctx)),
zap.String("trace_id", tracingPkg.GetTraceID(ctx)))
Remove second
2958bf6880
todc6ae885f2
dc6ae885f2
toc1e4130020