Skip to content

Commit

Permalink
Merge branch 'main' of github.com:open-telemetry/opentelemetry-go int…
Browse files Browse the repository at this point in the history
…o release_prep
  • Loading branch information
Aneurysm9 committed Dec 10, 2021
2 parents af8be26 + b46019a commit bf15507
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ We have updated the project minimum supported Go version to 1.16
Any per-signal endpoint set via an `OTEL_EXPORTER_OTLP_<signal>_ENDPOINT` environment variable is now used without modification of the path.
When `OTEL_EXPORTER_OTLP_ENDPOINT` is set, if it contains a path, that path is used as a base path which per-signal paths are appended to. (#2433)
- Basic metric controller updated to use sync.Map to avoid blocking calls (#2381)
- The `go.opentelemetry.io/otel/exporter/jaeger` correctly sets the `otel.status_code` value to be a string of `ERROR` or `OK` instead of an integer code. (#2439, #2440)

### Deprecated

Expand Down
12 changes: 7 additions & 5 deletions exporters/jaeger/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,16 @@ func spanToThrift(ss sdktrace.ReadOnlySpan) *gen.Span {
}

if ss.Status().Code != codes.Unset {
tags = append(tags, getInt64Tag(keyStatusCode, int64(ss.Status().Code)))
switch ss.Status().Code {
case codes.Ok:
tags = append(tags, getStringTag(keyStatusCode, "OK"))
case codes.Error:
tags = append(tags, getBoolTag(keyError, true))
tags = append(tags, getStringTag(keyStatusCode, "ERROR"))
}
if ss.Status().Description != "" {
tags = append(tags, getStringTag(keyStatusMessage, ss.Status().Description))
}

if ss.Status().Code == codes.Error {
tags = append(tags, getBoolTag(keyError, true))
}
}

var logs []*gen.Log
Expand Down
6 changes: 3 additions & 3 deletions exporters/jaeger/jaeger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func Test_spanSnapshotToThrift(t *testing.T) {
eventNameValue := "event-test"
eventDropped := int64(10)
keyValue := "value"
statusCodeValue := int64(1)
statusCodeValue := "ERROR"
doubleValue := 123.456
intValue := int64(123)
boolTrue := true
Expand Down Expand Up @@ -203,7 +203,7 @@ func Test_spanSnapshotToThrift(t *testing.T) {
{Key: keyError, VType: gen.TagType_BOOL, VBool: &boolTrue},
{Key: keyInstrumentationLibraryName, VType: gen.TagType_STRING, VStr: &instrLibName},
{Key: keyInstrumentationLibraryVersion, VType: gen.TagType_STRING, VStr: &instrLibVersion},
{Key: keyStatusCode, VType: gen.TagType_LONG, VLong: &statusCodeValue},
{Key: keyStatusCode, VType: gen.TagType_STRING, VStr: &statusCodeValue},
// Should not have a status message because it was unset
{Key: keySpanKind, VType: gen.TagType_STRING, VStr: &spanKind},
},
Expand Down Expand Up @@ -264,7 +264,7 @@ func Test_spanSnapshotToThrift(t *testing.T) {
{Key: keyError, VType: gen.TagType_BOOL, VBool: &boolTrue},
{Key: keyInstrumentationLibraryName, VType: gen.TagType_STRING, VStr: &instrLibName},
{Key: keyInstrumentationLibraryVersion, VType: gen.TagType_STRING, VStr: &instrLibVersion},
{Key: keyStatusCode, VType: gen.TagType_LONG, VLong: &statusCodeValue},
{Key: keyStatusCode, VType: gen.TagType_STRING, VStr: &statusCodeValue},
{Key: keyStatusMessage, VType: gen.TagType_STRING, VStr: &statusMessage},
{Key: keySpanKind, VType: gen.TagType_STRING, VStr: &spanKind},
},
Expand Down

0 comments on commit bf15507

Please sign in to comment.