Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix instrumentation lib version in spanDataToThrift #1037

Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -12,6 +12,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Renamed `go.opentelemetry.io/otel/api/standard` package to `go.opentelemetry.io/otel/semconv` to avoid the ambiguous and generic name `standard` and better describe the package as containing OpenTelemetry semantic conventions. (#1016)

### Fixed

- Correct instrumentation version tag in Jaeger exporter. (#1037)

## [0.10.0] - 2020-07-29

This release migrates the default OpenTelemetry SDK into its own Go module, decoupling the SDK from the API and reducing dependencies for instrumentation packages.
Expand Down
2 changes: 1 addition & 1 deletion exporters/trace/jaeger/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func spanDataToThrift(data *export.SpanData) *gen.Span {
if il := data.InstrumentationLibrary; il.Name != "" {
tags = append(tags, getStringTag("instrumentation.name", il.Name))
if il.Version != "" {
tags = append(tags, getStringTag("instrumentation.version", il.Name))
tags = append(tags, getStringTag("instrumentation.version", il.Version))
}
}

Expand Down
9 changes: 9 additions & 0 deletions exporters/trace/jaeger/jaeger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
gen "go.opentelemetry.io/otel/exporters/trace/jaeger/internal/gen-go/jaeger"
ottest "go.opentelemetry.io/otel/internal/testing"
export "go.opentelemetry.io/otel/sdk/export/trace"
"go.opentelemetry.io/otel/sdk/instrumentation"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
)
Expand Down Expand Up @@ -373,6 +374,8 @@ func Test_spanDataToThrift(t *testing.T) {
spanKind := "client"
rv1 := "rv11"
rv2 := int64(5)
instrLibName := "instrumentation-library"
instrLibVersion := "semver:1.0.0"

tests := []struct {
name string
Expand Down Expand Up @@ -410,6 +413,10 @@ func Test_spanDataToThrift(t *testing.T) {
StatusMessage: statusMessage,
SpanKind: apitrace.SpanKindClient,
Resource: resource.New(kv.String("rk1", rv1), kv.Int64("rk2", rv2)),
InstrumentationLibrary: instrumentation.Library{
Name: instrLibName,
Version: instrLibVersion,
},
},
want: &gen.Span{
TraceIdLow: 651345242494996240,
Expand All @@ -423,6 +430,8 @@ func Test_spanDataToThrift(t *testing.T) {
{Key: "key", VType: gen.TagType_STRING, VStr: &keyValue},
{Key: "uint", VType: gen.TagType_LONG, VLong: &uintValue},
{Key: "error", VType: gen.TagType_BOOL, VBool: &boolTrue},
{Key: "instrumentation.name", VType: gen.TagType_STRING, VStr: &instrLibName},
{Key: "instrumentation.version", VType: gen.TagType_STRING, VStr: &instrLibVersion},
{Key: "status.code", VType: gen.TagType_LONG, VLong: &statusCodeValue},
{Key: "status.message", VType: gen.TagType_STRING, VStr: &statusMessage},
{Key: "span.kind", VType: gen.TagType_STRING, VStr: &spanKind},
Expand Down