Documentation ¶
Index ¶
- func New(ctx context.Context, res *resource.Resource, opt ...Option) (*otlplog.Exporter, error)
- func NewClient(opts ...Option) otlplog.Client
- type Option
- func WithCompressor(compressor string) Option
- func WithDialOption(opts ...grpc.DialOption) Option
- func WithEndpoint(endpoint string) Option
- func WithGRPCConn(conn *grpc.ClientConn) Option
- func WithHeaders(headers map[string]string) Option
- func WithInsecure() Option
- func WithReconnectionPeriod(rp time.Duration) Option
- func WithRetry(settings RetryConfig) Option
- func WithServiceConfig(serviceConfig string) Option
- func WithTLSCredentials(creds credentials.TransportCredentials) Option
- func WithTimeout(duration time.Duration) Option
- type RetryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option applies an option to the gRPC driver.
func WithCompressor ¶
WithCompressor will set the compressor for the gRPC client to use when sending requests. It is the responsibility of the caller to ensure that the compressor set has been registered with google.golang.org/grpc/encoding. This can be done by encoding.RegisterCompressor. Some compressors auto-register on import, such as gzip, which can be registered by calling `import _ "google.golang.org/grpc/encoding/gzip"`.
func WithDialOption ¶
func WithDialOption(opts ...grpc.DialOption) Option
WithDialOption opens support to any grpc.DialOption to be used. If it conflicts with some other configuration the GRPC specified via the collector the ones here will take preference since they are set last.
func WithEndpoint ¶
WithEndpoint allows one to set the endpoint that the exporter will connect to the collector on. If unset, it will instead try to use connect to DefaultCollectorHost:DefaultCollectorPort.
func WithGRPCConn ¶
func WithGRPCConn(conn *grpc.ClientConn) Option
WithGRPCConn allows reusing existing gRPC connection when it has already been established for other services. When set, other dial options will be ignored.
func WithHeaders ¶
WithHeaders will send the provided headers with gRPC requests.
func WithInsecure ¶
func WithInsecure() Option
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. Note, by default, client security is required unless WithInsecure is used.
func WithReconnectionPeriod ¶
WithReconnectionPeriod allows one to set the delay between next connection attempt after failing to connect with the collector.
func WithRetry ¶
func WithRetry(settings RetryConfig) Option
WithRetry configures the retry policy for transient errors that may occurs when exporting traces. An exponential back-off algorithm is used to ensure endpoints are not overwhelmed with retries. If unset, the default retry policy will retry after 5 seconds and increase exponentially after each error for a total of 1 minute.
func WithServiceConfig ¶
WithServiceConfig defines the default gRPC service config used.
func WithTLSCredentials ¶
func WithTLSCredentials(creds credentials.TransportCredentials) Option
WithTLSCredentials allows the connection to use TLS credentials when talking to the server. It takes in grpc.TransportCredentials instead of say a Certificate file or a tls.Certificate, because the retrieving of these credentials can be done in many ways e.g. plain file, in code tls.Config or by certificate rotation, so it is up to the caller to decide what to use.
func WithTimeout ¶
WithTimeout tells the driver the max waiting time for the backend to process each spans batch. If unset, the default will be 10 seconds.
type RetryConfig ¶
RetryConfig defines configuration for retrying batches in case of export failure using an exponential backoff.