Documentation
¶
Overview ¶
Provides OTLP connection configuration types and utilities for the OpenTelemetry Collector (see https://opentelemetry.io/docs/collector/).
Index ¶
Constants ¶
const ( // Default protocol for telemetry collection (gRPC). DefaultProtocol = GRPC // Default otlp endpoint. DefaultEndpoint = "localhost:4317" )
Variables ¶
This section is empty.
Functions ¶
func Defaults ¶
Defaults returns a map of default configuration values for the otlp package. It sets a default protocol and endpoint address.
func TLSConfig ¶
TLSConfig generates a tls.Config from the provided Config structure. It loads the client certificate, key, and CA certificate to configure mutual TLS authentication.
func TLSCredentials ¶
func TLSCredentials( config Config, ) (credentials.TransportCredentials, error)
TLSCredentials creates gRPC transport credentials using TLS settings from the provided Config. It loads the TLS configuration and returns transport credentials or an error if loading fails.
Types ¶
type Config ¶
type Config struct {
// Protocol to use for telemetry collection - GRPC (default), HTTP.
Protocol Protocol `json:"protocol" yaml:"protocol" mapstructure:"protocol"`
// Endpoint for OTLP protocol.
Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"`
// Whether to use an insecure endpoint (without TLS).
Insecure bool `json:"insecure" yaml:"insecure" mapstructure:"insecure"`
// Path to the client certificate file.
ClientCertificate string `json:"clientCertificate" yaml:"clientCertificate" mapstructure:"clientCertificate"`
// Path to the client private key file.
ClientKey string `json:"clientKey" yaml:"clientKey" mapstructure:"clientKey"`
// Path to the Certificate Authority (CA) file.
Certificate string `json:"certificate" yaml:"certificate" mapstructure:"certificate"`
}
Config represents the configuration settings for a OTEL protocol. It includes details about the protocol, endpoint settings, security options, and TLS configuration.