Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Main (unreleased)

- Fix potential goroutine leak in log file tailing in static mode. (@thampiotr)

- Fix incorrect display of trace IDs in the automatic_logging processor of static mode's traces subsystem.
Users of the static mode's service graph processor are also advised to upgrade,
although the bug should theoretically not affect them. (@ptodev)

### Other changes

- Compile journald support into builds of `grafana-agentctl` so
Expand Down
7 changes: 3 additions & 4 deletions pkg/integrations/v2/app_agent_receiver/payload.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app_agent_receiver

import (
"encoding/hex"
"fmt"
"sort"
"strconv"
Expand Down Expand Up @@ -154,11 +153,11 @@ func SpanToKeyVal(s ptrace.Span) *KeyVal {
KeyValAdd(kv, "end_timestamp", s.StartTimestamp().AsTime().String())
}
KeyValAdd(kv, "kind", "span")
KeyValAdd(kv, "traceID", hex.EncodeToString([]byte(s.TraceID().String())))
KeyValAdd(kv, "spanID", hex.EncodeToString([]byte(s.SpanID().String())))
KeyValAdd(kv, "traceID", s.TraceID().String())
KeyValAdd(kv, "spanID", s.SpanID().String())
KeyValAdd(kv, "span_kind", s.Kind().String())
KeyValAdd(kv, "name", s.Name())
KeyValAdd(kv, "parent_spanID", hex.EncodeToString([]byte(s.ParentSpanID().String())))
KeyValAdd(kv, "parent_spanID", s.ParentSpanID().String())
s.Attributes().Range(func(k string, v pcommon.Value) bool {
KeyValAdd(kv, "attr_"+k, fmt.Sprintf("%v", v))
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package automaticloggingprocessor

import (
"context"
"encoding/hex"
"errors"
"fmt"
"strconv"
Expand Down Expand Up @@ -124,7 +123,7 @@ func (p *automaticLoggingProcessor) ConsumeTraces(ctx context.Context, td ptrace
lastTraceID := ""
for k := 0; k < spanLen; k++ {
span := ss.Spans().At(k)
traceID := hex.EncodeToString([]byte(span.TraceID().String()))
traceID := span.TraceID().String()

if p.cfg.Spans {
keyValues := append(p.spanKeyVals(span), p.processKeyVals(rs.Resource(), svc)...)
Expand Down
5 changes: 2 additions & 3 deletions pkg/traces/servicegraphprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package servicegraphprocessor

import (
"context"
"encoding/hex"
"errors"
"fmt"
"time"
Expand Down Expand Up @@ -316,7 +315,7 @@ func (p *processor) consume(trace ptrace.Traces) error {

switch span.Kind() {
case ptrace.SpanKindClient:
k := key(hex.EncodeToString([]byte(span.TraceID().String())), hex.EncodeToString([]byte(span.SpanID().String())))
k := key(span.TraceID().String(), span.SpanID().String())

edge, err := p.store.upsertEdge(k, func(e *edge) {
e.clientService = svc.Str()
Expand All @@ -339,7 +338,7 @@ func (p *processor) consume(trace ptrace.Traces) error {
}

case ptrace.SpanKindServer:
k := key(hex.EncodeToString([]byte(span.TraceID().String())), hex.EncodeToString([]byte(span.ParentSpanID().String())))
k := key(span.TraceID().String(), span.ParentSpanID().String())

edge, err := p.store.upsertEdge(k, func(e *edge) {
e.serverService = svc.Str()
Expand Down