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

chore: url validation & README to prevent gRPC footguns. #2130

Merged
merged 15 commits into from
May 3, 2021

Conversation

lizthegrey
Copy link
Member

@lizthegrey lizthegrey commented Apr 20, 2021

Fixes issues encountered on an OTel evangelism livestream last week.

Which problem is this PR solving?

  • It is too easy for users to accidentally add /v1/trace or /v1/metrics to url when changing from HTTP to gRPC, causing weird DNS errors.
  • It is too easy to misconfigure exporters and fail to shutdown cleanly.
  • It would be better to ensure the examples are clear and reflect best practices.
  • It is too easy to import the wrong grpc library and get weird typescript errors.
  • It is confusing how to configure non-mutual TLS.

Short description of the changes

  • updates README.md to use shutdown hooks
  • add util warning on / in url field.
  • updates README.md with info on non-mutual TLS.
  • updates README.md with info on hostname:port syntax.

@lizthegrey lizthegrey changed the title [chore] extend README and url validation to avoid footguns. chore: extend README and url validation to avoid footguns. Apr 20, 2021
@lizthegrey lizthegrey changed the title chore: extend README and url validation to avoid footguns. chore: url validation & README to prevent footguns. Apr 20, 2021
@lizthegrey lizthegrey changed the title chore: url validation & README to prevent footguns. chore: url validation & README to prevent gRPC footguns. Apr 20, 2021
@lizthegrey lizthegrey marked this pull request as ready for review April 20, 2021 18:49
@codecov
Copy link

codecov bot commented Apr 20, 2021

Codecov Report

Merging #2130 (85b3dd1) into main (082abf9) will not change coverage.
The diff coverage is n/a.

❗ Current head 85b3dd1 differs from pull request most recent head ea638cc. Consider uploading reports for the commit ea638cc to get more accurate results

@@           Coverage Diff           @@
##             main    #2130   +/-   ##
=======================================
  Coverage   92.80%   92.80%           
=======================================
  Files         140      140           
  Lines        5002     5002           
  Branches     1029     1029           
=======================================
  Hits         4642     4642           
  Misses        360      360           

@lizthegrey lizthegrey requested a review from obecny April 30, 2021 20:15
@dyladan dyladan added the enhancement New feature or request label May 3, 2021
@lizthegrey
Copy link
Member Author

The thought occurs to me we can do one better than this by reading protocol and if http or https, default to port 80 or 443 respectively, to make things like https://api.honeycomb.io/ work seamlessly. But that's for a followup PR (and maybe needs a spec repo question to clarify first)

@dyladan
Copy link
Member

dyladan commented May 3, 2021

From my perspective this looks good to merge but I want to make sure @obecny is ok with that first since he had a comment but hasn't approved yet.

@naseemkullah naseemkullah merged commit cd54a45 into open-telemetry:main May 3, 2021
@lizthegrey lizthegrey deleted the lizf.update-grpc-docs branch May 3, 2021 18:14
@dyladan dyladan mentioned this pull request Jun 2, 2021
lizthegrey added a commit to honeycombio/opentelemetry-js that referenced this pull request Jul 5, 2021
dyladan pushed a commit that referenced this pull request Jul 21, 2021
…n host specified without protocol (#2322)

* fix regression from #2130 when host specified without protocol

* Update util.test.ts

* Apply suggestions from code review

Co-authored-by: Naseem <naseemkullah@gmail.com>

* revert package.json changes

* Update util.ts

* add tests as per @MSNev request

* Update packages/opentelemetry-exporter-collector-grpc/src/util.ts

Co-authored-by: Naseem <naseemkullah@gmail.com>

Co-authored-by: Naseem <naseemkullah@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants