Skip to content
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

Use the grpc.ClientConn to handle connections for the otlptracegrpc client #2329

Merged
merged 37 commits into from Nov 25, 2021

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Oct 27, 2021

  • In the otlptracegrpc Client use the underlying gRPC ClientConn to handle name resolution, TCP connection establishment (with retries and backoff) and TLS handshakes, and handling errors on established connections by re-resolving the name and reconnecting.
  • Deprecate configuration options for the otlptracegrpc Client that configure a grpc.ClientConn managed by the Client itself. Instead favor the caller passing an already configured grpc.ClientConn.

This does not include changes to the otlpmetricgrpc Client. A similar PR is planned as a follow-on to address those changes.

Resolve #1527
Resolve #2384

@codecov
Copy link

codecov bot commented Oct 27, 2021

Codecov Report

Merging #2329 (5c9bcc3) into main (1ea6ee3) will increase coverage by 0.9%.
The diff coverage is 74.7%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2329     +/-   ##
=======================================
+ Coverage   73.3%   74.3%   +0.9%     
=======================================
  Files        174     173      -1     
  Lines      12243   12174     -69     
=======================================
+ Hits        8986    9049     +63     
+ Misses      3019    2888    -131     
+ Partials     238     237      -1     
Impacted Files Coverage Δ
...ters/otlp/otlptrace/internal/otlpconfig/options.go 52.9% <0.0%> (-20.1%) ⬇️
...rs/otlp/otlptrace/internal/otlptracetest/client.go 0.0% <0.0%> (ø)
exporters/otlp/otlptrace/otlptracegrpc/client.go 97.7% <97.5%> (+3.9%) ⬆️
exporters/otlp/otlptrace/otlptracegrpc/options.go 78.2% <100.0%> (+3.2%) ⬆️

@MadVikingGod
Copy link
Contributor

Looks like a good start.

@MrAlias MrAlias force-pushed the poc-grpc-clientconn branch 3 times, most recently from 19b8f86 to 30c61db Compare November 18, 2021 17:13
@MrAlias MrAlias changed the title [POC] Use the grpc.ClientConn to handle connections for the otlptracegrpc client Use the grpc.ClientConn to handle connections for the otlptracegrpc client Nov 18, 2021
@MrAlias MrAlias marked this pull request as ready for review November 18, 2021 17:57
@MrAlias
Copy link
Contributor Author

MrAlias commented Nov 22, 2021

I'm not 100% sure we can deprecated the options that are deprecated in this PR. We support the configuration of the exporter via environment variables, and they configure the deprecated options. In order to keep this support, I think we will need to persist the options.

Use the internals of the client to explicit cancel the context returned
from exportContext. This gets around the bug where the select in Stop
may randomly choose the non-context Done case and avoid returning an
error (also failing to cancel the context).
To configure the client/exporter with environment variables these
options are used. There is no way to fully remove these options without
removing support for configuration with environment variables. Leave
that decision and strategy determination to a separate PR.
@MrAlias
Copy link
Contributor Author

MrAlias commented Nov 22, 2021

I've removed the deprecation for now. Leaving the decision and strategy determination for a separate Issue/PR.

Copy link
Member

@XSAM XSAM left a comment

Choose a reason for hiding this comment

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

👍

@MrAlias MrAlias merged commit f1971b3 into open-telemetry:main Nov 25, 2021
@MrAlias MrAlias deleted the poc-grpc-clientconn branch November 25, 2021 16:06
@Aneurysm9 Aneurysm9 mentioned this pull request Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants