-
Notifications
You must be signed in to change notification settings - Fork 652
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
Add support for OTLP Exporter Protobuf over HTTP #1868
Conversation
@lonewolf3739 is this still work in progress? |
@codeboten there were some gaps b/w collector specification and collector implementation. I will check it again and get back to this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this back up @lonewolf3739! Will review the code further later today. It would be great if you could also add an integration test here
Sure, block the PR when you review until I add the integration test. |
@codeboten Added the integration test. Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes requested 👍
...porter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py
Show resolved
Hide resolved
...porter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py
Outdated
Show resolved
Hide resolved
...tlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
…hon into otlp-http
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This PR is great, just a few comments.
...pentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/__init__.py
Show resolved
Hide resolved
...porter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py
Show resolved
Hide resolved
...porter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py
Show resolved
Hide resolved
self._shutdown = True | ||
|
||
|
||
def _headers_from_env() -> Optional[Dict[str, str]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to necessarily change this here, but i think we're repeating the pattern of splitting variables by ,
and =
in a few places, might be nice to pull that code into a utility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. Probably some internal only private method in api/sdk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 also what happens if the user wants to put a ,
or =
character in their header/regex whatever. Is an escape sequence documented anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it is documented in the specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue here #1949.
...tlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py
Outdated
Show resolved
Hide resolved
...tlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py
Outdated
Show resolved
Hide resolved
...tlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py
Outdated
Show resolved
Hide resolved
...tlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py
Outdated
Show resolved
Hide resolved
…try/exporter/otlp/proto/http/trace_exporter/encoder/__init__.py
…hon into otlp-http
|
||
|
||
DEFAULT_COMPRESSION = Compression.NoCompression | ||
DEFAULT_ENDPOINT = "http://localhost:55681/v1/traces" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this default defined in the specs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm it's not defined yet but it should be 😅 open-telemetry/opentelemetry-specification#1816
timeout: Optional[int] = None, | ||
compression: Optional[Compression] = None, | ||
): | ||
self._endpoint = endpoint or environ.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why some of these get their own helper functions but others do not for retrieving env vars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big reason except pulling this small piece of code into separate functions is kind of overkill and some values require extra processing.
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, | ||
environ.get(OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_ENDPOINT), | ||
) | ||
self._certificate_file = certificate_file or environ.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to re-use the code in exporter mixin? Seems to be a lot of similarities. Maybe we should extract that code out and share it across all otlp exporters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No that is not possible as of now since both are different packages. When we decided to split the packages we decided we are fine with repetitive code if it is trivial. Probably worth addressing in another PR for all otlp exporters.
platforms = any | ||
license = Apache-2.0 | ||
classifiers = | ||
Development Status :: 5 - Production/Stable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might have to have a discussion on whether or not we can mark this as stable since collector is technically not stable (even though otlp grpc is stable). Will talk about it in the SIG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't get a chance to talk about this in the SIG but I agree w/ @lzchen, we should mark hold off marking this as stable until the port is confirmed. We can then merge this as beta until then.
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
__version__ = "1.4.0.dev0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we mark this as 0.23.dev0 until the port discussion is sorted in the spec open-telemetry/opentelemetry-specification#1816
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue on collector repo open-telemetry/opentelemetry-collector#3617. I think it will take some to get the port fixed. I will change this to 0.23.dev0.
Marked as 0.23.dev0 and changed status to beta. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for addressing my comments
...opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/version.py
Outdated
Show resolved
Hide resolved
@lonewolf3739 please take a look at the failing test and we can get this merged! |
@codeboten will update this once #1985 gets merged. |
@codeboten All tests are passing now. |
@lonewolf3739 nice thank you! |
Description
Fixes #1106