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

Update OTEL instrumentation scope #630

Open
mariomac opened this issue Feb 19, 2024 · 2 comments · May be fixed by #660
Open

Update OTEL instrumentation scope #630

mariomac opened this issue Feb 19, 2024 · 2 comments · May be fixed by #660
Labels
good first issue Good for newcomers

Comments

@mariomac
Copy link
Contributor

According to:

https://opentelemetry.io/docs/specs/otel/common/mapping-to-non-otlp/#instrumentationscope

otel.library.name is deprecated in favour of otel.scope.name

@grcevski grcevski added the good first issue Good for newcomers label Feb 20, 2024
@carrbs
Copy link

carrbs commented Feb 29, 2024

I'm curious if this is reference to the test files? (That's the only place I see the otel.library.name show up):

➜  grep -r "otel.library.name" . --exclude-dir=./vendor
./test/integration/red_test_rust.go:            {Key: "otel.library.name", Type: "string", Value: "github.com/grafana/beyla"},
./test/integration/traces_test.go:              {Key: "otel.library.name", Type: "string", Value: "github.com/grafana/beyla"},
./test/integration/traces_test.go:              {Key: "otel.library.name", Type: "string", Value: "github.com/grafana/beyla"},
./test/integration/traces_test.go:              {Key: "otel.library.name", Type: "string", Value: "github.com/grafana/beyla"},
./test/integration/components/jaeger/jaeger_test.go:            `:[{"key":"otel.library.name","type":"string","value":"github.com/grafana/beyla"},{"key":"span.kind"`+
./test/integration/components/jaeger/jaeger_test.go:            `1eef766536d58ec8"}],"startTime":1686641491455316,"duration":476,"tags":[{"key":"otel.library.name","type":"string`+
./test/integration/components/jaeger/jaeger_test.go:            `artTime":1686641491452470,"duration":3322,"tags":[{"key":"otel.library.name","type":"string","value":"github.com/`+
./test/integration/components/jaeger/jaeger_test.go:            `a","references":[],"startTime":1686641494868532,"duration":1108,"tags":[{"key":"otel.library.name","type":"string`+
./test/integration/components/jaeger/jaeger_test.go:            `6641494869530,"duration":109,"tags":[{"key":"otel.library.name","type":"string","value":"github.com/grafana/ebpf-`+
./test/integration/components/jaeger/jaeger_test.go:            `otel.library.name","type":"string","value":"github.com/grafana/beyla"},{"key":"span.kind","type":"s`+

If so, it seems like the definitions from semconv (example) might be useful?

Maybe something like this:

Existing

//  ... test/integration/traces_test.go
// ...
	jaeger.Diff([]jaeger.Tag{
		{Key: "otel.library.name", Type: "string", Value: "github.com/grafana/beyla"},
		{Key: "telemetry.sdk.language", Type: "string", Value: "go"},
		{Key: "telemetry.sdk.name", Type: "string", Value: "beyla"},
		{Key: "service.namespace", Type: "string", Value: "integration-test"},
		serviceInstance,
	}, process.Tags)

Leveraging the semconv definitions

// ..
	jaeger.Diff([]jaeger.Tag{
		keyValueToJaegerTag(semconv.OTelScopeName("github.com/grafana/beyla")),
		keyValueToJaegerTag(semconv.TelemetrySDKLanguageGo),
		keyValueToJaegerTag(semconv.TelemetrySDKName("beyla")),
		keyValueToJaegerTag(semconv.ServiceNamespace("integration-test")),
		serviceInstance,
	}, process.Tags)
	assert.Empty(t, sd, sd.String())
// ...

// .. likely in some other helper location: 

func keyValueToJaegerTag(kv attribute.KeyValue) jaeger.Tag {
	return jaeger.Tag{
		Key:   string(kv.Key),
		Type:  kv.Value.Type().String(),
		Value: kv.Value.AsInterface(),
	}
}

(My thought is since semconv gets autogenerated using the semantic-conventions repo, the deprecation info would be more readily available.)

@carrbs carrbs linked a pull request Mar 2, 2024 that will close this issue
@mariomac
Copy link
Contributor Author

mariomac commented Mar 4, 2024

Hi @carrbs ! This actually references the generation of this value by the OTEL library, which is not explicit. Fixing this issue would probably require to the OpenTelemetry library and managing any breaking changes we could get.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants