Description
Schema Url's are part of the InstrumentationScope that a Tracer uses as an identity.
Each instrumentation library in -contrib is written against a version of the opentelemetry_semantic_conventions
app which has the conventions corresponding to a specific Schema Url.
The version the library is written against may be different than the version it is built with.
For automatic Tracer creation on startup we need a way to get the version of the semantic conventions that the library was built with. Right now there is a hack to allow the developer to specify the semconv url used for a library because the startup code does, SchemaUrl = application:get_env(Name, otel_schema_url, undefined),
, when creating the Tracer.
The issue with requiring a otel_schema_url
from each library is both that it is likely to get out of sync and even if the dev always updated the value to reflect what was used at development time this doesn't mean its what is used at compile time.
A solution would be for there to somehow be an attribute on the library that is set at compile time by the semconv library.
How could this be done?
The best I can come up with is each library exporting schema_url() -> ?SCHEMA_URL.
from a module of the same name as the application so that the SDK knows where to look.