Skip to content

[WIP] OTLP Exporter support for http/protobuf #1615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

robwknox
Copy link
Contributor

@robwknox robwknox commented Feb 17, 2021

Description

Adds support for the http/protobuf protocol. Code structure has been refactored to introduce the notions of Encoders (e.g. Protobuf) and Senders (e.g. GRPC, HTTP) akin to the recent refactoring of the Zipkin Exporter. This was done to decouple the functionality to allow for the introduction of additional implementations of each and, as importantly, for easier and cleaner testing. The structure is also well suited for handling the re-introduction of metric signals when the code becomes stable (I initially had the metric code refactored and included ;) but pulled it out when it was moved to experimental status).

Breaking Changes
OTLPSpanExporter:

  • moved from opentelemetry.exporter.otlp.exporter => opentelemetry.exporter.otlp
  • __init__ signature argument changes:
    • protocol: new and required
    • compression: type changed from string to enum
    • headers: type changed from Sequence to Dict for more apt structure. Headers, whether passed in or retrieved from env vars, are now parsed into a common dict structure before being passed into the Senders.
    • credentials: changed to certificate_file (optional string). This aligns with the spec and is necessary since http/protobuf can not make use of a ChannelCredentials object - which is what the type was for credentials.

Fixes #1106

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • unit tests
  • manual testing against local OTLP server:
    • http/protobuf support
    • grpc regression testing
    • http/protobuf & grpc output comparison

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@robwknox robwknox requested review from a team, lzchen and hectorhdzg and removed request for a team February 17, 2021 05:02
@owais
Copy link
Contributor

owais commented Mar 11, 2021

Does this conflict with #1604 ?

HeadersInput = Union[Dict[str, str], str, None]
Headers = Dict[str, str]


Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Do any of the following really belong in utils? May be constants.py or symbols.py would be better if not types

from typing import Dict, Union

HeadersInput = Union[Dict[str, str], str, None]
Headers = Dict[str, str]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: these should be defined either in the module that is consuming them or in a exporter.otlp.types.

@lzchen
Copy link
Contributor

lzchen commented Mar 11, 2021

@owais

Does this conflict with #1604 ?

I think if we can get this PR in quickly, we can do the splitting work afterwards. If we can't get it in as quickly, I don't want this to block the splitting up of the package work, so @robwknox would have to rebase.

@lzchen
Copy link
Contributor

lzchen commented Apr 9, 2021

@robwknox
Are you still working on this?

@robwknox
Copy link
Contributor Author

@lzchen apologies for not dropping a note earlier but I don't have time to continue working on this due to a personal issue that has come up.

@lzchen
Copy link
Contributor

lzchen commented Apr 12, 2021

@robwknox
No worries. Thanks for your time on this.

Closing for now.

@lzchen lzchen closed this Apr 12, 2021
@codeboten
Copy link
Contributor

Thanks for your help @robwknox!

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.

Support protobuf over HTTP in OTLP exporter
4 participants