open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/
Apache License 2.0
4.99k stars 1.01k forks source link

Consider using go module paths for scope name in demos #5412

Open dashpole opened 1 month ago

dashpole commented 1 month ago

Problem Statement

I noticed the rolldice example has a single-word name for the meter and tracer:

https://github.com/open-telemetry/opentelemetry-go/blob/ca93aae3e9f6922f623d193fac84b13f26dfc0b3/example/dice/rolldice.go#L12-L17

I haven't checked other examples, but IMO we should consider doing this across all of them.

Proposed Solution

Since many users will use this as a starting point for their code, would it make more sense to use a "real" scope name? E.g. go.opentelemetry.io/otel/example/dice?

Alternatives

Keep simpler names for samples

dashpole commented 1 month ago

Also, should we document the convention that the go import path of the library producing the telemetry should be used as the scope name?

MrAlias commented 1 month ago

Also, should we document the convention that the go import path of the library producing the telemetry should be used as the scope name?

SGTM. Only question is where should we document this? Package docs?

MrAlias commented 1 month ago

To complete this, the docs site will need to be updated as well.