* adding a configuration for disabling auto-instrumentations
addressing review feedback from pdelewski, provide a mechanism that can be used to disable auto-instrumentation packages
without actually uninstalling them.
A new variable, OTEL_PHP_DISABLED_INSTRUMENTATIONS, has been added which accepts a list of instrumentation names to be disabled.
Each instrumentation can call Instrumentation::isDisabled to determine if they should bail without registering hooks.
* moving instrumentation disabled into Sdk class
* allow OTEL_SDK_DISABLED to disable sdk autoloading
* review feedback
- test for sdk disabled in initializer
- sdk disabled does not disable propagator, per spec
Rather than log nothing by default, log warnings and greater to console.
By providing a psr-3 logger, users can gain greater control over logging, including disabling it (via NullLogger)
- remove baggage TODOs which have since been done.
- implement TODOs from tracestate to log warnings.
- tidy up tracestate code, simplify some const names.
* create text map propagators from registry
removing undocumented dependency between sdk and extension by adding text map propagators to a registry
as part of composer autoloading, similar to how exporters, transports etc are treated.
* remove TextMapPropagatorFactory instances and register the singletons directly
* rename FactoryRegistry to just Registry
* fixing some sdk/default resource values
- default service name should contain runtime name if available; java just appends ":java" so I did the same
Co-authored-by: Tobias Bachert <git@b-privat.de>
moving exporter examples up one directory, where I think they are more obvious to find.
remove some old and broken grpc examples.
remove unused interface.
when creating a stream from an endpoint string, the factory wasn't returning the stream. fix and add tests.
Co-authored-by: Tobias Bachert <git@b-privat.de>
* update grpc gitsplit destination
match the gitsplit destination repo to match package name: 'transport-grpc'
* adding missing autoload files for exporters
- remove Mocker mocks, which were contributing extra time, and replace with no-op implementations
- adding extra benchmarks (batch vs simple, protobuf vs json)
* adding exporter + transport registry
to remove the hidden dependency between SDK and contrib, move all of the exporter knowledge out of
exporter factory, and invent a registry to hold those values. The registry can be added to by contrib
modules as part of composer autoloading.
This also allows users to override things like transports (eg, provide their own grpc transport).
Remove exporter's fromConnectionString as it's not in spec, and I couldn't get it to work nicely with the
registry idea.
* fixing up examples
* allow callables to be registered as factories
adding an example of replacing a registered transport factory with another implementation
* Registry to FactoryRegistry
* new relic exporter factory, tests
* review suggestions
* tidy
* change fromEnvironment() to create() in factories
refactoring Environment access to allow configuration from multiple sources. Initially, the sources are env ($_SERVER) and php.ini, but this should allow us to add more sources in future without changing the API.
do not modify OTEL_EXPORTER_OTLP_TRACES_PROTOCOL
allow resolvers to return mixed
* merge otlp exporters
continuing on from Nevay's work, this removes the individual OtlpHttp and OtlpGrpc exporters, and replaces with
Otlp\Exporter using a transport to manage grpc and http/protobuf complexity.
* tidy
* use mockery overload instead of prototype clone
* making all smoke-test examples work
* removing startBatch
verified that the call attributes have the same values when using TraceServiceClient
* tidy
* tidy
* Revert "use mockery overload instead of prototype clone"
This reverts commit bbb685b4d1.
Mocking proto-generated files segfaults with ext-protobuf (which is harder to diagnose when running in a child process, which
was required for fancy mockery mocking of "new". So, back to the prototype approach, and skip the tests if ext-protobuf enabled.
* tests without mocking protobuf
* test
* typo
* reverting FromConnectionStringInterface
* grpc headers
* revert to dumb transports, handle multiple protocols
* tidy, adding initial otlp json support
* self-review
* linting
* remove redundant interface
* Revert "remove redundant interface"
This reverts commit 350d40cdfe.
* fix getFloat
Co-authored-by: Tobias Bachert <git@b-privat.de>
* move withSignal into otlp-specific interface
* moving exporter/transport env handling into a new factory
* linting
* remove unused code
* tidy
* moving OtlpHttp into Otlp
* removing OtlpTransportFactoryInterface
* fix style
* fixing psalm error
* addressing review feedback
* replacing removed code
* fixing example
Co-authored-by: Tobias Bachert <git@b-privat.de>
* refactor: provide EnvironmentVariables static class for friendly-typed access
utilizes Accessor and Variables under the hood to provide consistent default values
* removing event dispatcher
discussed in SIG to remove this unused code. It was going to be infrastructure for emitting metrics from other parts of the code, but that's been done in a better way now.
* remove EventContextIntegrationTest
* Add alternative instrumentation abstraction
* Provide global access to providers
Remove logs for now, will be replaced with `LoggerProvider` in the future.
* resolve deptrac baseline
Nevay found that an @internal annotation in NonRecordingSpan was the cause of the violation, so
remove it.
* make psalm happy