How signalfx/splunk-otel-collector works
Project type and purpose
• This is an open-source, opinionated distribution of the OpenTelemetry Collector.
• Purpose: receive, process, and export metrics, traces, and logs to Splunk Observability Cloud (and other backends).
File structure
• cmd/otelcol: the main Collector binary and default configs (agent, full, gateway).
• internal/: core libraries—configuration sources, config‐map providers, config conversion, discovery, receivers, settings, versioning.
• pkg/extension & pkg/receiver: SignalFx SmartAgent extension & receiver plugins.
• deployments/: Ansible, Chef, Puppet, Salt, Kubernetes, Nomad, CloudFoundry, etc.
• packaging/: scripts and manifests to produce OS-specific packages (deb, rpm, MSI, Docker images).
• examples/: sample Docker Compose & Helm deployments.
• docs/: architecture, component reference, getting-started guides.
README
• Describes architecture (see docs/architecture.md), deployment modes (agent vs. gateway), and supported configuration sources & exporters.
• Highlights core pipelines: receivers → processors → exporters, plus extensions.
Main components & relationships
a. Core Collector Service (cmd/otelcol binary)
– Configuration Engine
• Config Sources (envvar, file include, etcd2, Vault, Zookeeper)
• Config‐map provider (Kubernetes style)
• Config converter (backward compatibility & normalizations)
– Extensions (e.g., memory_ballast, debug config server)
– Receivers (OTLP/gRPC/HTTP, SmartAgent, Prometheus remote_write gateway, discovery receiver, scripted inputs, etc.)
– Processors (batching, memory limiter, resourcedetection, filters)
– Exporters (signalfx, splunk_hec, otlphttp, logging, etc.)
– Service pipeline definitions (metrics, traces, logs)
b. Deployment & Packaging Layer
– Packaging scripts and platform-specific installers (packaging/fpm, msi, choco, bundle scripts)
– Configuration-management integrations (deployments/ansible, chef, puppet, salt)
– Container images (docker/, k8s/) and orchestration artifacts (Helm, Nomad, CloudFoundry, ECS).
c. Extension & Receiver Plugins
– pkg/extension/smartagentextension: bridges legacy SmartAgent Extensions (Collectd, Python)
– pkg/receiver/smartagentreceiver: loads legacy SmartAgent monitors as OTLP data
Important architectural patterns & principles
• Modular “factory” pattern for adding new receivers, processors, exporters, extensions.
• Pluggable config sources & discovery.
• Single-binary distribution with embedded default configs and platform-specific overrides.
• Backward-compatibility layer (config converter).