* 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.
* 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
* OTLP/HTTP First Pass
This PR Implements OTLP/HTTP (Protobuf)
As it stands the AlwaysOnOTLPExample works sending Traces to the Collector. The SpanConverter was pulled directly from the GRPC implementation.
OTLP/HTTP (Json) has an interesting history behind it and looks harder to support:
https://github.com/open-telemetry/opentelemetry-specification/issues/786
TODO:
- [ ] Tests
- [ ] Support all config params from the constructor (compression, timeout, headers)
- [ ] Endpoint validation
* Fixes Phan Error
* OTLP/HTTP: The wait is over
* Tests tests tests
* Add headers supports
* Supports 4 of 6 Env Vars
* Rejects otlp/json (for now)
* Might support gzip (needs testing)
* Unrelated psalm fixes
* chore: make style
* OTLP/HTTP: Copy/paste SpanConverter Tests
I feel like the OTLP/HTTP and OTLP/GRPC Classes could be more integrated since their SpanConverters are identical
* OTLP/HTTP: Request body should actually send the payload!
* Return InvalidArgumentException when invalid headers are passed rather than silently fail
* Re work process headers function so it\'s called in the constructor rather than later at export
* This fixes a number of test with the span converter, basic types work: string, int, float, bool.
* This fixes converting arrays passed into attributes; and adds tests too
* * Added grpc capabilities to the PHP container dockerfile.
* Added an otel collector (exports to `logging`) to `docker-compose.yaml` to exercise the OTLPGrpc Exporter.
* Edited Makefile to call the OTLPGrpc example.
* Added a file needed to configure the otel collector to send traces directly to logging.
* Backends can add their example blocks to make it easy for users to switch.
* Errant `i`.
* created `docker-compose-collector.yaml` so the php service in `docker-compose.yaml` won't be dependent on otel collector.
* Formatting.