opentelemetry-php icon indicating copy to clipboard operation
opentelemetry-php copied to clipboard

refactor otlp exporter

Open brettmc opened this issue 3 years ago • 2 comments
trafficstars

Remove OtlpHttp and OtlpGrpc exporters, and replace with Otlp\SpanExporter and Otlp\MetricExporter using a transport to manage grpc and http/protobuf complexity. Allow setting signal and protocol on transport factories (particularly for grpc, which uses signal to look up grpc method) Adding BC for OtlpHttp and OtlpGrpc, which will still fail but with a more helpful message. Fix failing examples. Send user-agent header with otlp exports. Allow otlp http/json

brettmc avatar Oct 07 '22 02:10 brettmc

Codecov Report

Merging #838 (0bc286e) into main (ba98992) will decrease coverage by 0.09%. The diff coverage is 39.39%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #838      +/-   ##
============================================
- Coverage     80.90%   80.80%   -0.10%     
+ Complexity     1973     1951      -22     
============================================
  Files           246      248       +2     
  Lines          5173     5122      -51     
============================================
- Hits           4185     4139      -46     
+ Misses          988      983       -5     
Flag Coverage Δ
7.4 80.29% <39.39%> (-0.10%) :arrow_down:
8.0 80.80% <39.39%> (-0.10%) :arrow_down:
8.1 80.94% <39.39%> (-0.10%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/API/Common/Signal/Signals.php 0.00% <0.00%> (ø)
src/Contrib/Grpc/GrpcTransportFactory.php 53.33% <ø> (-2.23%) :arrow_down:
src/Contrib/Otlp/MetricExporter.php 38.70% <ø> (+38.70%) :arrow_up:
src/Contrib/Otlp/ProtobufSerializer.php 0.00% <ø> (ø)
src/Contrib/Otlp/Protocols.php 0.00% <0.00%> (ø)
src/Contrib/Otlp/SpanExporterFactory.php 0.00% <0.00%> (ø)
...DK/Common/Export/Stream/StreamTransportFactory.php 0.00% <0.00%> (ø)
src/SDK/Resource/Detectors/Process.php 100.00% <ø> (ø)
src/SDK/Common/Export/Http/PsrTransportFactory.php 72.22% <16.66%> (-27.78%) :arrow_down:
src/Contrib/Grpc/GrpcTransport.php 53.12% <75.00%> (+3.12%) :arrow_up:
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ba98992...0bc286e. Read the comment docs.

codecov[bot] avatar Oct 07 '22 02:10 codecov[bot]

LGTM sans the conflict.

bobstrecansky avatar Oct 12 '22 15:10 bobstrecansky

Great improvement. Thanks for the effort. I want to try it on a small project to see it in a real-world environment. Do you plan to create a new tag (0.0.16) with the changes?

erdemkose avatar Nov 03 '22 12:11 erdemkose

Hi @erdemkose good idea, we'll get one out soon.

brettmc avatar Nov 03 '22 20:11 brettmc