- apply TC review feedback to move Globals to top-level.
it was suggested to move Instrumentation into its own package, but I chose instead to just move that dir
up to the top level of API
- added a BC layer to alias the moved classes
- added some more examples
* initial work on logs signal
* supressing psalm error
* "fixing" 7.4 segfault
through trial and error, I found that it was consistently segfaulting in the sdk autoloader
tests, but by running them in a different order, the failures went away.
* adding logs tests
* rename example per feedback
* move log context injection into processors, per spec
* correctly set context on logs
* update logger name per feedback
* adding variables, map psr3 to otel severity, fix timestamp
* psr-3 loggers
* tests, psr3 v3 fix
* remove LogRecordDate and refactor SDK log record classes
* tests, tidy, improvements
* remove todos
* documentation
* check for valid span context
* removing psr-3 compatibility, per spec and feedback
* use InstrumentationScopeFactoryInterface
* apply attribute limits on readablelogrecord creation
per feedback, this should be more memory efficient for the processors
* group log record by resource/scope
* remove psr3 references from readme
* ignoring psalm error
* add trace context in Logger rather than processors
per feedback, and following the example in java and python SIGs, we
can add trace context to logs once, in the logger, rather than having
processors do it. The Context passed to processors is no longer used,
but retained for spec compliance.
if an empty tracestate header was passed, we were emitting a warning (discovered in the demo app after enabling logging).
to fix this, check for empty string as well as null.
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.
* 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.
* Otel-php:632 Move stack trace formatting out of Span class
* added function usages
* fix linting errors
* Added documentation for adding Span Attributes
* removing TracingUtl class
* Refactor TraceState's __toString method
* Added path with @covers to remove warnings
* Added @coversDefaultClass annotation
* fix to check if iterable is empty
* fixed for faling test case
* unit test
* Resolved review Comments
* reverting changes
* removing check for empty iterable span list
* review changes for SpanProcessor incorrect calls to SpanExporter::forceFlush()
* updated test case
* resolved review comments
* reverted changes for batch span processors
* reverting changes for batch span proccessor
* merge upstream and changes
* updating changes
* Refactoring SpanContext
* updating changes
* updated test cases
* updated changes suggested after review
* Revert "Reverting back to previous commit"
This reverts commit 941f368da3.
* updating changes after review
* unused use statement
* added unit test and resolved review comments
* Removed Double underscores from constant variables
* Removed constants from SpanContext.php to remove duplicacy
* updated failing test
* Moving Factory Methods back into SpanContext.php
* modified constructor of SpanContext
* updated SpanContext
* Modified use of additional if statement
* corrected parsing error
* Added B3Propagator Class to handle two configurations and storing debug flag in the returned context
* Updated B3Propagator extract according to the clarification in the specs; updated test cases
* Add metrics implementation
* Apply cs-fixer
* Downgrade to php 7.4
* [TODO] Suppress phan for now
* Add basic example
* [TODO] Remove outdated prometheus example for now
* Add otlp metric converter
* Add metric stream tests
* Downgrade to php 7.4 - fix asynchronous counter instrument type
* Add missing psalm-suppress annotations
* Add `ext-gmp` to composer suggest
* Fix `Sdk` -> `SDK`
* Remove `_bridge.php`
* Add array typehints
* Add `Interface` suffix to interfaces
* Add aggregation / attribute processor / staleness handler tests
* Apply rector
* Simplify filtered attribute processor
* Move instrument deduplication to meter
Allows removing view registry dependency from `MetricFactory`.
Should ideally turn of staleness handling for asynchronous instruments with permanently registered callbacks (drop all `::onStale()` callbacks and prevent addition of new callbacks).
* Allow injecting metric factory
* Release `::onStale()` callbacks if permanent observer callback registered
* Add `MultiObserver` tests
* Add php-doc for exporter temporality
* Resolve phan issues
* Add note about forward compatibility
* Add exemplar tests
* Remove special handling for callbacks being registered multiple times
Was mainly a side-effect of using `spl_object_id()`; lead to inconsistent behavior between providing same and identical callbacks; reverting back to incrementing index, keyspace is large enough.
* Add basic `Meter` / `MeterProvider` tests
* Add view `SelectionCriteria` tests
* Allow `MetricReader`s to configure default aggregation
- move default aggregation handling to metric reader / metric exporter
- move view registration to meter provider constructor
- move exemplar reservoir creation to aggregation to support user implementations
- remove `AttributeProcessor` from view as baggage access was dropped from spec
- deduplicate metric streams
* Add support for weakening `$this` reference of asynchronous callbacks
* Minor improvements
- add missing `Interface` suffix
- move callback destructors to metric observer to not detach if meter and meter provider are out of scope
- simplify `::viewRegistrationRequests()` by readding fallback view
* Add OTLP metric exporter
* Log export failure
* Minor improvements
- rename `MetricObserver::weakMap()` to `::destructors()` to better reflect usage`
- move `ReferenceCounter::acquire()` call to corresponding `MetricObserver::observe()` call for consistency
- cache instrumentation scope id in `Meter` to avoid repeated calls to `serialize()`
- remove obsolete instrument type check from `ViewProjection`, leftover from supporting aggregation per type
* Suppress `PhanAccessMethodInternal` due to being too strict for our usecase
* Add workaround for observer segfault if destruct is initiated by `WeakMap` key going out of scope
* Mark internal classes as internal
* Add in-memory and stream exporter
* Add metric converter test
* Add metric observer tests
* Add view registry tests
* Add metric reader tests
* Improve stream test coverage
* Improve meter test coverage
* Apply rector
* Add delayed staleness handler
* store root dispatcher in a static var
This seems to be the safest way to store the main dispatcher. Using context to store the main event dispatcher causes a scope to be created: activating the newly-created context which stores dispatcher causes a new scope, and that can break things.
I also looked at storing dispatcher in the root context, but that can't work because contexts are immutable.
* remove useless test
* linting
* Remove `Context::withValue()`
Creates a hidden `Scope` when called without `$parent`.
* Remove `Context::detach(Scope)`
* Remove static `Context::attach()`
* Add missing typehints
* Use loop instead of recursion
* Fix `MultiTextMapPropagator::extract()` clearing context
* Fix `TextMapPropagator::composite()` for named arguments
* Make `Context` constructor non-public
* Make `Context` and `ContextKey` final
* Fix `ArrayAccessGetterSetter`
Resolves inconsistencies in case-insensitive handling.
* Fix psalm
* Fix cannot mock final class `Context`
Revert after introducing ContextInterface?
* Apply feedback and remove obsolete parentheses
* Use psalm-suppress instead of assert
Attempts to fix the W3C test service by updating usage patterns to
match the refactorings and functional changes that have been applied
since it was last updated.
* Added B3MultiPropagater
* Added static self and removed case insensitive getter function
* Added unit tests for B3MultiPropagator class
* Refactored B3MultiPropagator and added tests in B3MultiPropagatorTest
* Added description for B3MultiPropagator
* fixing w3c-tracecontext test startup
make w3c-trace-context was suffering from some bitrot, so this change gets it building and
running again. The tests themselves still fail due to further code-related bitrot.
* silence new phpstan error
* Move Attribute classes to Common namespace
* refactor AttributesTest
* Move Attribute classes to Common namespace in examples
* Introduce AttributeLimitsInterface
* Fix bug in total added values calculation
* Move compare test to correct test-class
* Apply CS
* Refactor Attributes
* Fix attributes in Benchmark
* Move AttributeLimits defaults to interface
* adding covers annotations to all tests
* clock tests
* adding unit tests
* feedback
- cleaning up ValueRecorder tests
- ints are floats, so type-hint ValueRecorder::record and remove some checks
* reorganise tests
moving tests under tests/Unit and tests/Integration, and updating namespaces
changing 'make test' to just run unit tests, and generate coverage off that
adding a 'make test-integration' to run integration tests (without coverage)
adding test-integration to 'make all'
adding a separate github action to run integration tests
* tidy 'make test'
make test is now a combination of test-unit and test-integration
* fixing 'make all'
* adding unit tests for TraceIdRatioBasedSampler
I grabbed a couple of the more unit-tests tests from the integration tests. Also starting to add some @covers
annotations to start to remove false coverage