-
Notifications
You must be signed in to change notification settings - Fork 1k
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
otlploggrpc: Remove unnecessary grpc client setup options #5273
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ import ( | |
"time" | ||
|
||
"google.golang.org/grpc" | ||
"google.golang.org/grpc/credentials" | ||
) | ||
|
||
// Option applies an option to the Exporter. | ||
|
@@ -36,92 +35,6 @@ type RetryConfig struct { | |
// TODO: implement. | ||
} | ||
|
||
// WithInsecure disables client transport security for the Exporter's gRPC | ||
// connection, just like grpc.WithInsecure() | ||
// (https://pkg.go.dev/google.golang.org/grpc#WithInsecure) does. | ||
// | ||
// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | ||
// environment variable is set, and this option is not passed, that variable | ||
// value will be used to determine client security. If the endpoint has a | ||
// scheme of "http" or "unix" client security will be disabled. If both are | ||
// set, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT will take precedence. | ||
// | ||
// By default, if an environment variable is not set, and this option is not | ||
// passed, client security will be used. | ||
// | ||
// This option has no effect if WithGRPCConn is used. | ||
func WithInsecure() Option { | ||
// TODO: implement. | ||
return nil | ||
} | ||
|
||
// WithEndpoint sets the target endpoint the Exporter will connect to. | ||
// | ||
// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | ||
// environment variable is set, and this option is not passed, that variable | ||
// value will be used. If both are set, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | ||
// will take precedence. | ||
// | ||
// If both this option and WithEndpointURL are used, the last used option will | ||
// take precedence. | ||
// | ||
// By default, if an environment variable is not set, and this option is not | ||
// passed, "localhost:4317" will be used. | ||
// | ||
// This option has no effect if WithGRPCConn is used. | ||
func WithEndpoint(endpoint string) Option { | ||
// TODO: implement. | ||
return nil | ||
} | ||
|
||
// WithEndpointURL sets the target endpoint URL the Exporter will connect to. | ||
// | ||
// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | ||
// environment variable is set, and this option is not passed, that variable | ||
// value will be used. If both are set, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | ||
// will take precedence. | ||
// | ||
// If both this option and WithEndpoint are used, the last used option will | ||
// take precedence. | ||
// | ||
// If an invalid URL is provided, the default value will be kept. | ||
// | ||
// By default, if an environment variable is not set, and this option is not | ||
// passed, "localhost:4317" will be used. | ||
// | ||
// This option has no effect if WithGRPCConn is used. | ||
func WithEndpointURL(u string) Option { | ||
// TODO: implement. | ||
return nil | ||
} | ||
|
||
// WithReconnectionPeriod set the minimum amount of time between connection | ||
// attempts to the target endpoint. | ||
// | ||
// This option has no effect if WithGRPCConn is used. | ||
func WithReconnectionPeriod(rp time.Duration) Option { | ||
// TODO: implement. | ||
return nil | ||
} | ||
|
||
// WithCompressor sets the compressor the gRPC client uses. | ||
// Supported compressor values: "gzip". | ||
// | ||
// If the OTEL_EXPORTER_OTLP_COMPRESSION or | ||
// OTEL_EXPORTER_OTLP_LOGS_COMPRESSION environment variable is set, and | ||
// this option is not passed, that variable value will be used. That value can | ||
// be either "none" or "gzip". If both are set, | ||
// OTEL_EXPORTER_OTLP_LOGS_COMPRESSION will take precedence. | ||
// | ||
// By default, if an environment variable is not set, and this option is not | ||
// passed, no compressor will be used. | ||
// | ||
// This option has no effect if WithGRPCConn is used. | ||
func WithCompressor(compressor string) Option { | ||
// TODO: implement. | ||
return nil | ||
} | ||
|
||
// WithHeaders will send the provided headers with each gRPC requests. | ||
// | ||
// If the OTEL_EXPORTER_OTLP_HEADERS or OTEL_EXPORTER_OTLP_LOGS_HEADERS | ||
|
@@ -138,44 +51,6 @@ func WithHeaders(headers map[string]string) Option { | |
return nil | ||
} | ||
|
||
// WithTLSCredentials sets the gRPC connection to use creds. | ||
// | ||
// If the OTEL_EXPORTER_OTLP_CERTIFICATE or | ||
// OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE environment variable is set, and | ||
// this option is not passed, that variable value will be used. The value will | ||
// be parsed the filepath of the TLS certificate chain to use. If both are | ||
// set, OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE will take precedence. | ||
// | ||
// By default, if an environment variable is not set, and this option is not | ||
// passed, no TLS credentials will be used. | ||
// | ||
// This option has no effect if WithGRPCConn is used. | ||
func WithTLSCredentials(_ credentials.TransportCredentials) Option { | ||
// TODO: implement. | ||
return nil | ||
} | ||
|
||
// WithServiceConfig defines the default gRPC service config used. | ||
// | ||
// This option has no effect if WithGRPCConn is used. | ||
func WithServiceConfig(serviceConfig string) Option { | ||
// TODO: implement. | ||
return nil | ||
} | ||
|
||
// WithDialOption sets explicit grpc.DialOptions to use when establishing a | ||
// gRPC connection. The options here are appended to the internal grpc.DialOptions | ||
// used so they will take precedence over any other internal grpc.DialOptions | ||
// they might conflict with. | ||
// The [grpc.WithBlock], [grpc.WithTimeout], and [grpc.WithReturnConnectionError] | ||
// grpc.DialOptions are ignored. | ||
// | ||
// This option has no effect if WithGRPCConn is used. | ||
func WithDialOption(_ ...grpc.DialOption) Option { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should consider keeping DialOptions: #5248 (comment) |
||
// TODO: implement. | ||
return nil | ||
} | ||
|
||
// WithGRPCConn sets conn as the gRPC ClientConn used for all communication. | ||
// | ||
// This option takes precedence over any other option that relates to | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 must remember to document all the env vars in
Expoter
type doc comments or package documentation.This can be handled as a separate issue.