configgrpc

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 79

Documentation

Overview

Package configgrpc defines the gRPC configuration settings.

Index

Constants

View Source
const (
	CompressionUnsupported = ""
	CompressionGzip        = "gzip"
)

Compression gRPC keys for supported compression types within collector

Variables

This section is empty.

Functions

func GetGRPCCompressionKey

func GetGRPCCompressionKey(compressionType string) string

GetGRPCCompressionKey returns the grpc registered compression key if the passed in compression key is supported, and CompressionUnsupported otherwise

func GrpcSettingsToDialOptions

func GrpcSettingsToDialOptions(settings GRPCClientSettings) ([]grpc.DialOption, error)

GrpcSettingsToDialOptions maps configgrpc.GRPCClientSettings to a slice of dial options for gRPC

Types

type GRPCClientSettings

type GRPCClientSettings struct {
	// The headers associated with gRPC requests.
	Headers map[string]string `mapstructure:"headers"`

	// The target to which the exporter is going to send traces or metrics,
	// using the gRPC protocol. The valid syntax is described at
	// https://github.com/grpc/grpc/blob/master/doc/naming.md.
	Endpoint string `mapstructure:"endpoint"`

	// The compression key for supported compression types within
	// collector. Currently the only supported mode is `gzip`.
	Compression string `mapstructure:"compression"`

	// TLSSetting struct exposes TLS client configuration.
	TLSSetting configtls.TLSClientSetting `mapstructure:",squash"`

	// The keepalive parameters for client gRPC. See grpc.WithKeepaliveParams
	// (https://godoc.org/google.golang.org/grpc#WithKeepaliveParams).
	KeepaliveParameters *KeepaliveConfig `mapstructure:"keepalive"`

	// WaitForReady parameter configures client to wait for ready state before sending data.
	// (https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md)
	WaitForReady bool `mapstructure:"wait_for_ready"`
}

GRPCClientSettings defines common settings for a gRPC client configuration.

type KeepaliveConfig

type KeepaliveConfig struct {
	Time                time.Duration `mapstructure:"time,omitempty"`
	Timeout             time.Duration `mapstructure:"timeout,omitempty"`
	PermitWithoutStream bool          `mapstructure:"permit_without_stream,omitempty"`
}

KeepaliveConfig exposes the keepalive.ClientParameters to be used by the exporter. Refer to the original data-structure for the meaning of each parameter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL