common

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLogger

func CreateLogger(skipSettingGRPCLogger bool) (*zap.Logger, error)

CreateLogger creates a logger for use by telemetrygen

func GetTLSCredentialsForGRPCExporter added in v0.93.0

func GetTLSCredentialsForGRPCExporter(caFile string, cAuth ClientAuth) (credentials.TransportCredentials, error)

func GetTLSCredentialsForHTTPExporter added in v0.93.0

func GetTLSCredentialsForHTTPExporter(caFile string, cAuth ClientAuth) (*tls.Config, error)

Types

type ClientAuth added in v0.93.0

type ClientAuth struct {
	Enabled        bool
	ClientCertFile string
	ClientKeyFile  string
}

type Config

type Config struct {
	WorkerCount           int
	Rate                  int64
	TotalDuration         time.Duration
	ReportingInterval     time.Duration
	SkipSettingGRPCLogger bool

	// OTLP config
	CustomEndpoint      string
	Insecure            bool
	UseHTTP             bool
	HTTPPath            string
	Headers             KeyValue
	ResourceAttributes  KeyValue
	TelemetryAttributes KeyValue

	// OTLP TLS configuration
	CaFile string

	// OTLP mTLS configuration
	ClientAuth ClientAuth
}

func (*Config) CommonFlags

func (c *Config) CommonFlags(fs *pflag.FlagSet)

CommonFlags registers common config flags.

func (*Config) Endpoint

func (c *Config) Endpoint() string

Endpoint returns the appropriate endpoint URL based on the selected communication mode (gRPC or HTTP) or custom endpoint provided in the configuration.

func (*Config) GetAttributes

func (c *Config) GetAttributes() []attribute.KeyValue

func (*Config) GetTelemetryAttributes added in v0.87.0

func (c *Config) GetTelemetryAttributes() []attribute.KeyValue

type KeyValue

type KeyValue map[string]string

func (*KeyValue) Set

func (v *KeyValue) Set(s string) error

func (*KeyValue) String

func (v *KeyValue) String() string

func (*KeyValue) Type

func (v *KeyValue) Type() string

Jump to

Keyboard shortcuts

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