Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
XSAM and MrAlias committed Jun 18, 2024
1 parent c34fd24 commit 905fcb7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Document instrument name requirements in `go.opentelemetry.io/otel/metric`. (#5435)
- Prevent random number generation data-race for experimental rand exemplars in `go.opentelemetry.io/otel/sdk/metric`. (#5456)
- Fix counting number of dropped attributes of `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5464)
- Correct comments for the priority of options and environments in `WithEndpoint` and `WithEndpointURL` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5508)
- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their coresponding environment variables in in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5508)

## [1.27.0/0.49.0/0.3.0] 2024-05-21

Expand Down
12 changes: 12 additions & 0 deletions exporters/otlp/otlptrace/otlptracegrpc/client_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,18 @@ func TestWithEndpointWithEnv(t *testing.T) {
},
want: "foo",
},
{
name: "both options and envs",
envs: map[string]string{
"OTEL_EXPORTER_OTLP_ENDPOINT": "foo2",
"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "bar2",
},
options: []Option{
WithEndpoint("foo"),
WithEndpointURL("http://bar:8080/path"),
},
want: "bar:8080",
},
}

for _, tc := range testCases {
Expand Down
4 changes: 2 additions & 2 deletions exporters/otlp/otlptrace/otlptracegrpc/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func WithInsecure() Option {
// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
// environment variable is set, and this option is not passed, that variable
// value will be used. If both environment variables are set,
// OTEL_EXPORTER_OTLP_TRACES_ENDPOINT will take precedence. If the environment
// OTEL_EXPORTER_OTLP_TRACES_ENDPOINT will take precedence. If an environment
// variable is set, and this option is passed, this option will take precedence.
//
// If both this option and WithEndpointURL are used, the last used option will
Expand All @@ -81,7 +81,7 @@ func WithEndpoint(endpoint string) Option {
// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
// environment variable is set, and this option is not passed, that variable
// value will be used. If both environment variables are set,
// OTEL_EXPORTER_OTLP_TRACES_ENDPOINT will take precedence. If the environment
// OTEL_EXPORTER_OTLP_TRACES_ENDPOINT will take precedence. If an environment
// variable is set, and this option is passed, this option will take precedence.
//
// If both this option and WithEndpoint are used, the last used option will
Expand Down

0 comments on commit 905fcb7

Please sign in to comment.