Skip to content

Transport - move contentType from ::send() argument to transport property#831

Merged
brettmc merged 1 commit into
open-telemetry:mainfrom
Nevay:feature/exporter-cleanup
Oct 11, 2022
Merged

Transport - move contentType from ::send() argument to transport property#831
brettmc merged 1 commit into
open-telemetry:mainfrom
Nevay:feature/exporter-cleanup

Conversation

@Nevay

@Nevay Nevay commented Sep 24, 2022

Copy link
Copy Markdown
Contributor

Move content type from ::send() argument to property.

Also adds OTLP exporters that support protobuf and json format, based on the ::contentType() of the provided transport.

- move content type from `::send()` to transport property
- move otlp exporter to `Otlp\` namespace
final class GrpcTransportFactory implements TransportFactoryInterface
{
/**
* @psalm-param "application/x-protobuf" $contentType

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't find a solution that works with template type on TransportFactoryInterface.

Comment thread src/Contrib/OtlpHttp/Exporter.php
Comment thread Makefile
*/
interface SpanExporterInterface
{
public static function fromConnectionString(string $endpointUrl, string $name, string $args);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use a SpanExporterFactoryInterface instead to allow injecting dependencies.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable thing to do.

@Nevay Nevay changed the title Refactor transport layer Transport - move contentType from ::send() argument to transport property Sep 24, 2022
@Nevay
Nevay marked this pull request as ready for review September 24, 2022 21:58
@Nevay
Nevay requested a review from a team September 24, 2022 21:58
@codecov

codecov Bot commented Oct 2, 2022

Copy link
Copy Markdown

Codecov Report

Merging #831 (a2dcd5d) into main (215731f) will decrease coverage by 1.04%.
The diff coverage is 18.11%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #831      +/-   ##
============================================
- Coverage     82.54%   81.50%   -1.05%     
- Complexity     1877     1894      +17     
============================================
  Files           232      234       +2     
  Lines          4893     4919      +26     
============================================
- Hits           4039     4009      -30     
- Misses          854      910      +56     
Flag Coverage Δ
7.4 81.50% <18.11%> (-1.06%) ⬇️
8.0 81.53% <18.11%> (-1.05%) ⬇️
8.1 81.68% <19.49%> (-0.90%) ⬇️

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

Impacted Files Coverage Δ
src/Contrib/Otlp/MetricExporter.php 0.00% <0.00%> (ø)
src/Contrib/Otlp/ProtobufSerializer.php 0.00% <0.00%> (ø)
src/Contrib/Otlp/SpanExporter.php 0.00% <0.00%> (ø)
src/Contrib/OtlpHttp/MetricExporter.php 0.00% <0.00%> (ø)
src/SDK/Common/Export/Http/PsrTransportFactory.php 100.00% <ø> (ø)
src/SDK/Common/Export/Stream/StreamTransport.php 0.00% <0.00%> (ø)
...DK/Common/Export/Stream/StreamTransportFactory.php 0.00% <0.00%> (ø)
src/Contrib/Grpc/GrpcTransport.php 50.00% <33.33%> (-6.67%) ⬇️
src/SDK/Common/Export/Http/PsrTransport.php 95.16% <60.00%> (-3.15%) ⬇️
src/Contrib/Grpc/GrpcTransportFactory.php 55.55% <100.00%> (+2.06%) ⬆️
... and 6 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 215731f...a2dcd5d. Read the comment docs.

@brettmc brettmc linked an issue Oct 3, 2022 that may be closed by this pull request
@brettmc
brettmc merged commit 3866a82 into open-telemetry:main Oct 11, 2022
@Nevay
Nevay deleted the feature/exporter-cleanup branch April 19, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants