update semconv generation to use the new tooling. This is fairly close to a 1:1 of what we have now,
although I noted a couple of TODOs which we might consider in future to align with what Java is
doing: split attribute up into file-per-type, and split stable/unstable.
* 8.4: fixing some implicit nullable params
* fix withspan handler nullable + example (#1377)
- class is nullable for pre hooks
- add phpt tests for withspan and its interaction with auto root span
* fix: update references to logging exporter (#1383)
This exporter has been replaced by the debug exporter and will be removed soon. Related to https://github.com/open-telemetry/opentelemetry-collector/pull/11037
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
* fix: Update collector tag in example to latest (#1384)
Follow-up from #1383. Debug exporter isn't available until v0.86.0, so this new configuration throws an error when trying to run the collector. `Error: cannot unmarshal the configuration: unknown exporters type "debug" for "debug"` Instead of setting to v0.86.0, I noticed the other docker files omitted the tag (so latest is pulled). I just updated this to match.
* Remove `MeterInterface::isEnabled()` and fix meter config re-enabling (#1387)
* Update SPI dependency to v1. (#1388)
* Fix README badges. (#1389)
* add phpDocumentor instructions to Makefile (#1385)
* add phpDocumentor instructions to Makefile
Signed-off-by: svrnm <neumanns@cisco.com>
* update DEVELOPMENT.md
Signed-off-by: svrnm <neumanns@cisco.com>
---------
Signed-off-by: svrnm <neumanns@cisco.com>
* Update README.md (#1344)
* Fix `IncompatibleReturnValueException` in `MessageFactoryTest` (#1392)
PSR7 `RequestInterface::getUri()` must return `UriInterface`, not `string`; explicit typehint was added in `2.0`.
* more implicit nulls
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Signed-off-by: svrnm <neumanns@cisco.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
Co-authored-by: Tobias Bachert <git@b-privat.de>
Co-authored-by: Chris Lightfoot-Wild <github-clw@wild.me.uk>
Co-authored-by: Severin Neumann <neumanns@cisco.com>
Co-authored-by: Oleg <142805497+devactivity-team@users.noreply.github.com>
Follow-up from #1383. Debug exporter isn't available until v0.86.0, so this new configuration throws an error when trying to run the collector. `Error: cannot unmarshal the configuration: unknown exporters type "debug" for "debug"` Instead of setting to v0.86.0, I noticed the other docker files omitted the tag (so latest is pulled). I just updated this to match.
adding WithSpan and SpanAttribute attributes to the API. These attributes
are used by an upcoming feature in auto-instrumentation which allows users
to add attributes to their code to enable auto-instrumentation.
implement recent additions to the otel spec re: config provider. Config provider should return a
ConfigProperties, but we were already returning a ConfigurationRegistry. Added a ConfigProperties
interface for ConfigurationRegistry to implement, which gets us pretty close to spec.
We don't make ConfigProvider globally available, instead passing the ConfigurationRegistry in to
each instrumentation as we register it. The spec allows for this.
* auto root span creation
proof of concept for automatically creating a root span on startup.
the obvious deficiencies are:
- no idea of response values (status code etc)
- does not capture exceptions
* deptrac
* adding LocalRootSpan class
this is based on Java's implementation, https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/v2.3.0/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/LocalRootSpan.java
and adds the ability to identify and locate the "local root span" in a trace. The local root span is the top-level active span which has either
an invalid or remote parent.
It's tracked automatically as part of making a span active, either via `Span::activate()` or `Span::storeInContext()`, and can be retrieved in
a couple of ways, but most easily via `LocalRootSpan::current()`.
* remove redundant local root span check
* move context key to api
* internal
* adding example
* mark LocalRootSpan as experimental
* adding an example of local root span usage
* style, fix broken build
* [WIP] Add instrumentation configuration
* add autoloading for auto-instrumentations using SPI
* allow autoloading and non-autoloading to work
* fix attribute
* experimental config file
* fixing invalid dependencies
- deptrac was rightly complaining that API (indirectly) depended on SDK through config/sdk. For now,
remove usage of Config\SDK\Configuration\Context
- update deptrac config to allow some new dependencies
* dont register hook manager globally or in sdk
* remove unused function, psalm ignore missing extension function
* possibly fixing type-hint
psalm doesn't complain now, so that should be good
* load config files relative to cwd
* fixing hook manager enable/disable + psalm complaints
* fixing 8.1 psalm error
* use context to pass providers to instrumentations
- make "register global" a function of Sdk, but keep the sdk builder's interface intact
- invent an API instrumentation context, similar to the one in config/sdk, to pass providers
to instrumentations
- add an initial test of autoloading from a config file
* adding tests for sdk::registerGlobal
in passing, remove some dead code for handling invalid booleans - config already handles this correctly
* linting
* test coverage for globals
* add opentelemetry extension to developer image and actions
* always register instrumentations via SPI
* register globals initializer for file-config sdk
allow SDK created from config file to coexist with components using globals initializer
* linting
* remove globals init function
* fix phan warning
* simplify hook manager
- drop storage from hook manager: can't guarantee that something else, eg swoole, won't modify storage
- drop context from hook manager: we must lazy-load globals via initializers, because not all instrumentations use SPI (although that may change in future)
- default hook manager to enabled
* add todo to deprecate Registry in future
* autoload instrumentations without config
if no config provided, still try to load them. wrap registration in a try/catch/log
* fixing phan ref, update doc
* remove phan suppress
* fix example
* bump SPI to 0.2.1
* adding late-binding tracer+provider
per review from Nevay, this will allow instrumentations to get things from Globals as late as possible
* adding late binding logger and meter providers
* more late binding test coverage
* tidy
* dont use CoversMethod yet
not available in phpunit 10, so comment out and leave a todo
* kitchen sink, remove unused var
* instrumentation config as a map, per config file spec
* adding general config
* move general config into sdk
* test config caching
* move general instrumentation config to api
* avoid bad version of sebastian/exporter
* bump config yaml files to 0.3
* fix tests
* disable hook manager during file-based init
* cleanup
* support multiple config files in autoloader
* move hook manager enable/disable out of extension hook manager
The most obvious place to do this is in a class named HookManager, which _was_ an
interface for hook managers. Rename existing HookManager to HookManagerInterface,
then re-purpose HookManager for globally enabling/disabling hook managers as well
as determining the disabled status.
* update spi config
---------
Co-authored-by: Tobias Bachert <git@b-privat.de>
note that `messaging.client_id` was renamed to `messaging.client.id`, which causes a conflict in const name.
The recommendation from semconv maintainers is to replace the old value, `messaging.client_id`.
The SDK should log a warning once if there are any dropped span attributes, links, link attributes, events or event attributes.
The SDK should log a warning once if there are any dropped LogRecord attributes.
at least one otel backend product sends an empty response with a gzip encoding, which we fail to decode (because
an empty string is not valid). Work around this by not trying to decode an empty value.
* run unit tests in random order
running in random order highlights some interference between tests (mostly logging being enabled), and is a requirement for
mutation testing (ie, all tests must pass when executed in a random order).
* adding infection mutation testing
this adds the ability to run infection. It generates a lot of output, which is an exercise for another PR...
* replace assertwell/phpunit-global-state
the package was not compatible with phpunit 11. create out own test Trait, which handles
env vars, as well as general cleanup of the usual suspects of state that our tests mess up
* remove redundant tearDown functions
there's an after annotation on the trait to handle this
* use rector to upgrade tests for phpunit 11
* fixing CoversFunction for namespaced functions
* use FQNs in test attributes
* run unit tests in random order
running in random order highlights some interference between tests (mostly logging being enabled), and is a requirement for
mutation testing (ie, all tests must pass when executed in a random order).
* adding infection mutation testing
this adds the ability to run infection. It generates a lot of output, which is an exercise for another PR...
* infection max threads