open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
686 stars 170 forks source link

Emit schema_url during exports #1290

Closed sudol closed 2 months ago

sudol commented 2 months ago

Can we emit the schema_url for spans/metrics/logs?

I'm using the slim auto instrumentation and schema_url is not included in the export.

I'm happy to help make this change if it's in line with the vision here. Can someone suggest where best to make this change?

brettmc commented 2 months ago

For auto-instrumentation, the place to set this would be instances of new CachedInstrumentation() - the guzzle package sets it based on TraceAttributes::SCHEMA_URL. I can't think of a reason not to apply it to all auto-instrumentations.

sudol commented 2 months ago

I made a PR with the change that I had in mind. Can you let me know if this is in line with the vision for the project and the specifications? https://github.com/open-telemetry/opentelemetry-php/pull/1292/files