common

package
v0.112.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 14 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,
	insecureSkipVerify bool,
) (credentials.TransportCredentials, error)

func GetTLSCredentialsForHTTPExporter added in v0.93.0

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

func ValidateSpanID added in v0.102.0

func ValidateSpanID(spanID string) error

func ValidateTraceID added in v0.102.0

func ValidateTraceID(traceID string) 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                  float64
	TotalDuration         time.Duration
	ReportingInterval     time.Duration
	SkipSettingGRPCLogger bool

	// OTLP config
	CustomEndpoint      string
	Insecure            bool
	InsecureSkipVerify  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) GetHeaders added in v0.107.0

func (c *Config) GetHeaders() map[string]string

func (*Config) GetTelemetryAttributes added in v0.87.0

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

type KeyValue

type KeyValue map[string]any

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