If the OpenTelemetry project-provided builds of the core collector or the contrib collector are not suitable or complete for use in your environment then you can easily build a custom collector tailored to your needs.
This example uses the ocb
utility to build a custom OpenTelemetry Collector.
The ocb
utility requires a configuration file.
This configuration file acts as the manifest and defines the receivers, processors, extensions, and exporters that you want included in your custom Collector.
Anything not in the core Collector will need to be added to the builder configuration, and with recent changes you may be surprised how minimal the core has become.
An example builder config file is provided with builder-config.yaml
.
Detailed documentation on this file is available here.
The ocb
must be installed on the machine running the build.
The latest version (0.52.0
) of the utility can be obtained from here.
The provided Makefile
's default target will build a custom Collector as described by the builder configuration manifest.
The provided Makefile
can build a minimal Docker image with the docker-build
target. This target does not require that the ocb
utility is installed on the host as the first stage of the Dockerfile obtains the version needed.