-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Per #142, recent PRs had otel-cli deviate from the OTel standards for selecting OTLP exporter protocol. This PR revises the protocol handling for `--endpoint` and adds `--protocol` to more closely or exactly follow the spec. Matching envvars `OTEL_EXPORTER_OTLP_PROTOCOL` and `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` have been added as well. From the README.md: otel-cli deviates from the OTel specification for endpoint URIs. Mainly, otel-cli supports bare host:port for grpc endpoints and continues to default to gRPC. The optional http/json is not supported by opentelemetry-go so otel-cli does not support it. To use gRPC with an http endpoint, set the protocol with --protocol or the envvar. * bare host:port endpoints are assumed to be gRPC and are not supported for HTTP * http:// and https:// are assumed to be HTTP unless --protocol is set to grpc. * loopback addresses without an https:// prefix are assumed to be unencrypted * go mod tidy seems to be cruft leftover from the renovate bot merge * add --protocol flag & envvar + failing tests Adds the flag & envvars along with a bunch of tests that mostly fail at this point. Once these all pass it should be good to ship. * set correct test server protocol on new tests * minor improvements to failure testing Don't try to parse JSON output when command is expected to fail. Initialize empty maps in results so they don't come back as nil in failure tests. * tune up tests, get them to pass Lots of little adjustments all over. gRPC with http endpoints now works when protocol is grpc. Protocol flag & envvars seem to be fully implemented. Removed mentions of http/json since opentelemetry-go doesn't support it. Updated README to reflect new functionality. * fix up README text * remove OtelError from tests It doesn't work anyways, will revisit when/if it's needed.
- Loading branch information
Showing
8 changed files
with
180 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters