Skip to content

Commit

Permalink
Make span kind prefix uppercase (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
swi-jared authored Apr 19, 2024
1 parent c07536b commit 9cd95ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion internal/exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"strings"
)

type exporter struct {
}

func exportSpan(_ context.Context, s sdktrace.ReadOnlySpan) {
evt := reporter.CreateEntryEvent(s.SpanContext(), s.StartTime(), s.Parent())
layer := fmt.Sprintf("%s:%s", s.SpanKind().String(), s.Name())
layer := fmt.Sprintf("%s:%s", strings.ToUpper(s.SpanKind().String()), s.Name())
evt.SetLayer(layer)
evt.AddKVs([]attribute.KeyValue{
attribute.String("sw.span_name", s.Name()),
Expand Down
4 changes: 2 additions & 2 deletions internal/exporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestExportSpan(t *testing.T) {
"Hostname": host.Hostname(),
"Label": "entry",
"Language": "Go",
"Layer": "internal:foo",
"Layer": "INTERNAL:foo",
"PID": host.PID(),
"Timestamp_u": start.UnixMicro(),
"TransactionName": "foo",
Expand Down Expand Up @@ -145,7 +145,7 @@ func TestExportSpan(t *testing.T) {
"sw.parent_span_id": spanId,
"Hostname": host.Hostname(),
"Label": "exit",
"Layer": "internal:foo",
"Layer": "INTERNAL:foo",
"PID": host.PID(),
"Timestamp_u": end.UnixMicro(),
"X-Trace": exit.GetXTrace(),
Expand Down

0 comments on commit 9cd95ea

Please sign in to comment.