* port Nevay/otel-sdk-configuration into opentelemetry-php
This is a lift-and-shift, except for:
- changing namespaces
- fixes or ignore rules required to make static analysis tools happy
- commenting out one part of yaml test (unquoted hex value from env var)
* fix psalm on php81
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.
* 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
* Create and move namespaces into `src/` directory
* Update `composer.json`
Move test helpers outside of `SDK` namespace into `Tests`
* Follow PSR naming conventions for interfaces
* Follow PSR naming conventions for abstract classes and traits
* Do a pass on CI configs
* Add examples directory to cs-fixer config
* Fix some erroneously renamed type names
* First pass at updating Span API
* First pass at updated Span implementation
* Update SDK Span return types to `ReadWriteSpan`
Drop support for PHP 7.3
* Finish initial implementation
* Implement `SpanData`
* Implement `StatusData`
* Re-implement and rename `NoopSpan` to `NonRecordingSpan`
* Updates to support `SpanData` in exporters/span processors
* Add timestamp conversion helper methods
Update Exporters to use `SpanData`
Start updating Exporter tests
Implement non immutable `SpanData` test helper class
* Finish updating exporters/converters
* Fix next batch of tests
* First pass at `Tracer` refactor
Leverage a `SpanBuilder` to create the span
Use a dedicated object to share state
* Just use `NonRecordingSpan` constructor versus `create`
Start of adding tests for new Tracer implementation
* Remove some unneeded `max`
Make `Sampler` the 2nd arg to `TraceProvider`
Fix Integration tests
* Add `NoopSpanProcessor`
Continue updating/adding tests
* Install mockery
Ensure span processor is called with expected contexts/spans
* Update `SpanData` to directly return dropped amounts
Make `SpanProcessor#onStart` take a `ReadWriteSpan`
Update empty span fallback name
* Revamp `Clock` interface/implementation
* Add some additional doc comments
Continued work on updating test coverage
* Add more `Span` tests
* Get tests to a passing state
* Fix type errors
* Make CI happy
* Apply limits within `Span` constructor and `SpanBuilder` logic
Add test coverage for these cases
* Adding Proto to opentelemetry-php
Signed-off-by:Ritick Gautam <riticksinghrajput@gmail.com>
* Updated the script for generating proto folder in root
* Moved shell file in script folder
updated .gitignore
* Removed opentelemetry-proto
* Bug fixed
* added docker-compose.proto.yaml
updated script file
updated Makefile
* Update docker-compose.proto.yaml
* Updated README.md
* OtlpGrpc
* Added Request-response
* Example Updated
* Updated Span Converter
* small fixes
* modified: SpanConvertor.php
* (WIP): Partially working OTLP/GRPC Exporter
What's working?
* Sends spans to the Otel Collector
* Spans contain: Attributes, Status Code, Kind, Start/End timestamp, Lib Version
* Sucessfully sent OTLP to Honeycomb.io
What's not working?
* Need to rebase main onto this branch
* Trace ID and Span ID are too long, and have been fudged to trim them.
* No tests. Unit/Integ
* Events on spans haven't been tested
* Child spans haven't been tested
* Example code needs to be updated (been testing with laravel-otel)
* Need to check the status returned
* Links not implemented
* Generally just unfinished
Anything more to add?
* Thank you to the Ruby OTLP Exporter, lots of inspiration was taken from there
* Fixed traceid and spanid hacks; Now supports Events
* Use localhost:4317 for the default host; + cleanup
* Split code between Exporter.php and SpanConverter.php; Beginnings of tests
* More progress on tests, array's now correctly get converted. Also ran `make style` to format the code
* * Ironed out passing in headers. Could not figure out how best to validate the format php grpc wants the metadata to be in so accepting just the required string format now.
* Beginnings of tests for the Exporter
* Compression now configurable, not tested
* Removed ServiceName from being passed to the Exporter, I believe this should be set as an Attribute on a Resource in the TracerProvider
* Checking the status code coming back from GRPC client, Otel Spec says transient errors MUST be retried, retries not yet implemented: ffc85ddfd9/specification/protocol/exporter.md (retry)
* Add (failing) test for converting SDK Span to OTLP Span
* I'm struggling to set (or even get) an end timestamp for the span.
* Attributes not implemented on Events
* Further progress on Tests for the Exporter
* SpanConverter now translates attrs on Events
* Add opentelemtry-proto files
* Ran `make style' on proto. Do we want this?
I pushed the proto files and build is complaining, not sure if we want to exclude this dir from linting or not?
Testing it formatted so I can try to get this build green.
* Few changes in this one..
1. Moved out ResourcesSpans into the SpanConverter
2. Time is almost fixed, well tests pass but... I learned the clock didn't work as I expected it to. Wall clock and monotonic clock are entirely unrelated. I still think this needs more work but I _think_ it tests that the duration is correctly set on the otlp span.
3. ResourceInfo is now populated on otlp ResourceSpans.
* Fix some of the complaints from static analysis
* Revert "Ran `make style' on proto. Do we want this?"
No, we do not want generated code to be formatted with php-cs-fixer
This reverts commit 996b473ad3.
* make style
* Static analysis fixes
* Hopefully this adds the grpc extension
* Hopefully this adds the grpc extension
* Some Psalm fixes
* Added a few comments; disable testing of InstrumentationLibrary until it's implemented
Co-authored-by: Ritick Gautam <riticksinghrajput@gmail.com>
Co-authored-by: Ritick Gautam <41835832+riticksingh@users.noreply.github.com>
* Add W3C trace context test service
* Add README
* style formatting
* Update test service to use local files
* fix phpstan suppression
* ignore phpstan and psalm errors
* lock symfony version to 5.2
* cleanup
* more cleanup