OpenTelemetry Collector Contrib
The following document describes how to natively configure the OpenTelemetry Collector Contrib distribution with the Middleware platform.
Use the OpenTelemetry Collector Contrib to build your own custom distributions with the OpenTelemetry Collector Builder, send host data without using the Middleware Host Agent, or send host data from a technology that doesnt have a native Middleware Integration.
The Kubernetes OpenTelemetry Collector Contrib distribution is not available and in development.
Linux Installation
Step 1: Install DEB or RPM
Download the opentelemetry-collector with the same package manager you used to install the MW Agent.
Step 2: Use otelcol-contrib
Use the otelcol-contrib (opentelemetry-collector-contrib) distribution instead of the otelcol (opentelemetry-collector) for the OpenTelemetry Collector.
When prompted to download otelcol, download one of the following instead:
1# AMD64
2otelcol-contrib_0.92.0_linux_amd64.deb
3# ARM64
4otelcol-contrib_0.92.0_linux_arm64.deb1# AMD64
2otelcol-contrib_0.92.0_linux_amd64.rpm
3# ARM64
4otelcol-contrib_0.92.0_linux_arm64.rpmStep 3: Follow OTel Config
Once you have installed Linux, proceed to the Configuration Section.
Docker Installation
Step 1: Install DockerHub or ghcr.io
Download the opentelemetry-collector with the same container registry you used to install the MW Agent.
Step 2: Use otelcol-contrib
Ensure the container image refers to the opentelemetry-collector-contrib and not core opentelemetry-collector.
Check your container image with the following commands:
1otelcol --version
2# and
3opentelemetry-collector-contrib --versionStep 3: Follow OTel Config
Once you have installed Docker, proceed to the Configuration Section.
Configuration
Step 1: Configure Collector
Follow the OTel Configuration Instructions to configure the opentelemetry-collector-contrib
You must fully configure the OTel Collector before adding more code to the processors, exporters and service section.
Step 2: Add to Processors
Add the following code to the processors section:
1processors:
2 resourcedetection:
3 detectors: [ env, system ]
4 timeout: 2s
5 system:
6 hostname_sources: [ os ]
7 resource/middleware:
8 attributes:
9 - action: upsert
10 key: mw.account_key
11 value: "<MW_API_KEY>"
12 - action: upsert
13 from_attribute: host.name
14 key: host.idStep 3: Add to Exporters
Add the following code to the exporters section:
1exporters:
2 otlp/middleware:
3 endpoint: "https://<MW_UID>.middleware.io:443"
4 headers:
5 authorization: "<MW_API_KEY>"
6 sending_queue:
7 enabled: true
8 num_consumers: 100
9 queue_size: 10000Step 4: Add to Service
Add the following code within the pipelines section:
1service:
2 pipelines:
3 traces:
4 receivers: [ <your-receivers-list-for-traces> ]
5 processors: [ resourcedetection, resource/middleware,
6 <your-processor-list-for-traces> ]
7 exporters: [ otlp/middleware, <your-exporters-list-for-traces> ]
8 metrics:
9 receivers: [ <your-receivers-list-for-metrics> ]
10 processors: [ resourcedetection, resource/middleware ]
11 exporters: [ otlp/middleware, <your-exporters-list-for-metrics> ]
12 logs:
13 receivers: [ <your-receivers-list-for-logs> ]
14 processors: [ resourcedetection, resource/middleware,
15 <your-processors-list-for-logs> ]
16 exporters: [otlp/middleware, <your-exporters-list-for-logs>]Limitations
Metrics such as bandwidth and disk speed are not currently collected by the OpenTelemetry Collector and will contain 0 in those fields. This will impact the Infrastructure page as well as any custom dashboard containing these metrics.
Need assistance or want to learn more about Middleware? Contact our support team at [email protected] or join our Slack channel.