Include schema_url in CachedInstrumentation#259
Conversation
|
Thanks for opening your first pull request! If you haven't yet signed our Contributor License Agreement (CLA), then please do so that we can accept your contribution. A link should appear shortly in this PR if you have not already signed one. |
| public static function register(): void | ||
| { | ||
| $instrumentation = new CachedInstrumentation('io.opentelemetry.contrib.php.slim'); | ||
| $instrumentation = new CachedInstrumentation('io.opentelemetry.contrib.php.slim', schemaUrl: TraceAttributes::SCHEMA_URL); |
There was a problem hiding this comment.
Should this be explicitly set as the schema that it was created against?
It may potentially be invalid against future versions of the spec 🤔
There was a problem hiding this comment.
You're right, I hadn't considered this. Since this package (opentelemetry-auto-slim), pulls in open-telemetry/sem-conv, which is the source of TraceAttributes, is it fair to assume that this package is compatible with whatever version of the schema is defined in open-telemetry/sem-conv?
There was a problem hiding this comment.
Apologies for my delayed response to this @sudol
I have had a look through the documentation, and I think this may be the relevant part that was somewhere in the back of my mind: Schema-File Driven Telemetry Producers
I think that we would be at risk of changing the schema version URL in a potentially unsafe way if TraceAttributes::SCHEMA_URL is used as is.
@brettmc did mention in the SIG this week that maybe we could provide a series of constants for these versions instead (tagged for his input/thoughts on this!)
There was a problem hiding this comment.
how does this look? open-telemetry/opentelemetry-php#1301
There was a problem hiding this comment.
Nice @brettmc! I added a comment on there for discussion
There was a problem hiding this comment.
My interpretation of the spec re: schema_url is that we should explicitly set it to the latest schema version (1.25.0), confirm that we're setting the values correctly per that version, then leave it alone.
There was a problem hiding this comment.
@sudol - are you planning on making this update?
There was a problem hiding this comment.
@sudol - use https://opentelemetry.io/schemas/1.25.0, and the version should not change again after that.
There was a problem hiding this comment.
Ah yes. Sorry, I misunderstood. Yes I will get this updated tomorrow.
|
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/telemetry-stability.md#schema-file-driven-telemetry-producers was just pointed out in the spec channel... specifically:
The restrictions aren't any better for instrumentations that don't include a schema URL, though... |
Happy to go with your judgement either way! |
This change is in reference to open-telemetry/opentelemetry-php#1290 and is in line with other Auto Instrumentation implementations.
opentelemetry-php-contrib/src/Instrumentation/Guzzle/src/GuzzleInstrumentation.php
Line 31 in 491827d
opentelemetry-php-contrib/src/Instrumentation/ExtAmqp/src/ExtAmqpInstrumentation.php
Lines 27 to 30 in 491827d