Documentation
¶
Overview ¶
Package otel provides functionality for managing OpenTelemetry collector processes.
Index ¶
Constants ¶
const ( // DefaultCollectorBinary is the default path to the otel-collector binary DefaultCollectorBinary = "/bin/otel-collector" // DefaultLogsDir is the default directory for logs DefaultLogsDir = "/var/log/apoxy" // CollectorStdoutLogFile is the name of the collector stdout log file CollectorStdoutLogFile = "otel-collector.stdout.log" // CollectorStderrLogFile is the name of the collector stderr log file CollectorStderrLogFile = "otel-collector.stderr.log" // DefaultConfigPath is the default path to the otel-collector config file DefaultConfigPath = "/etc/otelcol/config.yaml" // Default collector port DefaultCollectorPort = 4317 )
Variables ¶
This section is empty.
Functions ¶
func RenderConfigTemplate ¶
func RenderConfigTemplate(vars TemplateVars) (string, error)
RenderConfigTemplate renders the OpenTelemetry collector config template with the provided variables
Types ¶
type Collector ¶
type Collector struct {
// CollectorBinary is the path to the otel-collector binary
CollectorBinary string
// LogsDir is the directory where logs will be written
LogsDir string
// ConfigPath is the path to the otel-collector config file
ConfigPath string
// Args are additional arguments to pass to the otel-collector
Args []string
// ClickHouseOpts are the options for the ClickHouse exporter
ClickHouseOpts *clickhouse.Options
// contains filtered or unexported fields
}
Collector manages the OpenTelemetry collector process.
func (*Collector) Status ¶
func (c *Collector) Status() CollectorStatus
Status returns the current status of the otel-collector process.
type CollectorStatus ¶
type CollectorStatus struct {
StartedAt time.Time
Running bool
ProcState *os.ProcessState
}
CollectorStatus represents the status of the otel-collector process.
type Option ¶
type Option func(*Collector)
Option configures a Collector.
func WithCollectorBinary ¶
WithCollectorBinary sets the path to the otel-collector binary.
func WithConfig ¶
WithConfig sets the configuration file path for the otel-collector.
func WithLogsDir ¶
WithLogsDir sets the directory where logs will be written.
type TemplateVars ¶
type TemplateVars struct {
OTLPPort int
ClickHouseAddr string
ClickHouseDatabase string
EnableClickHouse bool
OTLPTracesEndpoint string
OTLPTracesProtocol string
OTLPTracesInsecure bool
OTLPTracesCertificate string
OTLPTracesClientKey string
OTLPTracesClientCertificate string
}
TemplateVars represents the variables used in the OpenTelemetry collector config template