Skip to content

Commit 5de91b9

Browse files
committed
extending otel config
1 parent 31589e2 commit 5de91b9

File tree

1 file changed

+91
-4
lines changed
  • docs/use-cases/observability/clickstack/ingesting-data

1 file changed

+91
-4
lines changed

docs/use-cases/observability/clickstack/ingesting-data/collector.md

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,96 @@ With Docker Compose, modify the collector configuration using the same environme
100100
101101
### Advanced configuration {#advanced-configuration}
102102
103-
Currently, the ClickStack distribution of the OTel collector does not support modification of its configuration file. If you need a more complex configuration e.g. [configuring TLS](#securing-the-collector), or modifying the batch size, we recommend copying and modifying the [default configuration](https://github.com/hyperdxio/hyperdx/blob/main/docker/otel-collector/config.yaml) and deploying your own version of the OTel collector using the ClickHouse exporter documented [here](/observability/integrating-opentelemetry#exporting-to-clickhouse) and [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/clickhouseexporter/README.md#configuration-options).
103+
The ClickStack distribution of the OTel collector supports extending the base configuration by mounting a custom configuration file and setting an environment variable. The custom configuration is merged with the base configuration managed by HyperDX via OpAMP.
104104
105-
The default ClickStack configuration for the OpenTelemetry (OTel) collector can be found [here](https://github.com/hyperdxio/hyperdx/blob/main/docker/otel-collector/config.yaml).
105+
#### Extending the collector configuration {#extending-collector-config}
106+
107+
To add custom receivers, processors, or pipelines:
108+
109+
1. Create a custom configuration file with your additional configuration
110+
2. Mount the file at `/etc/otelcol-contrib/custom.config.yaml`
111+
3. Set the environment variable `CUSTOM_OTELCOL_CONFIG_FILE=/etc/otelcol-contrib/custom.config.yaml`
112+
113+
**Example custom configuration:**
114+
115+
```yaml
116+
receivers:
117+
# Collect logs from local files
118+
filelog:
119+
include:
120+
- /var/log/**/*.log
121+
- /var/log/syslog
122+
- /var/log/messages
123+
start_at: beginning
124+
125+
# Collect host system metrics
126+
hostmetrics:
127+
collection_interval: 30s
128+
scrapers:
129+
cpu:
130+
metrics:
131+
system.cpu.utilization:
132+
enabled: true
133+
memory:
134+
metrics:
135+
system.memory.utilization:
136+
enabled: true
137+
disk:
138+
network:
139+
filesystem:
140+
metrics:
141+
system.filesystem.utilization:
142+
enabled: true
143+
144+
service:
145+
pipelines:
146+
# Logs pipeline
147+
logs/host:
148+
receivers: [filelog]
149+
processors:
150+
- memory_limiter
151+
- transform
152+
- batch
153+
exporters:
154+
- clickhouse
155+
156+
# Metrics pipeline
157+
metrics/hostmetrics:
158+
receivers: [hostmetrics]
159+
processors:
160+
- memory_limiter
161+
- batch
162+
exporters:
163+
- clickhouse
164+
```
165+
166+
**Deploy with the all-in-one image:**
167+
```bash
168+
docker run -d --name clickstack \
169+
-p 8080:8080 -p 4317:4317 -p 4318:4318 \
170+
-e CUSTOM_OTELCOL_CONFIG_FILE=/etc/otelcol-contrib/custom.config.yaml \
171+
-v "$(pwd)/custom-config.yaml:/etc/otelcol-contrib/custom.config.yaml:ro" \
172+
docker.hyperdx.io/hyperdx/hyperdx-all-in-one:latest
173+
```
174+
175+
**Deploy with the standalone collector:**
176+
```bash
177+
docker run -d \
178+
-e CUSTOM_OTELCOL_CONFIG_FILE=/etc/otelcol-contrib/custom.config.yaml \
179+
-e OPAMP_SERVER_URL=${OPAMP_SERVER_URL} \
180+
-e CLICKHOUSE_ENDPOINT=${CLICKHOUSE_ENDPOINT} \
181+
-e CLICKHOUSE_USER=default \
182+
-e CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD} \
183+
-v "$(pwd)/custom-config.yaml:/etc/otelcol-contrib/custom.config.yaml:ro" \
184+
-p 4317:4317 -p 4318:4318 \
185+
docker.hyperdx.io/hyperdx/hyperdx-otel-collector
186+
```
187+
188+
:::note
189+
You only define new receivers, processors, and pipelines in the custom config. The base processors (`memory_limiter`, `batch`) and exporters (`clickhouse`) are already defined—reference them by name. The custom configuration is merged with the base configuration and cannot override existing components.
190+
:::
191+
192+
For more complex configurations, refer to the [default ClickStack collector configuration](https://github.com/hyperdxio/hyperdx/blob/main/docker/otel-collector/config.yaml) and the [ClickHouse exporter documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/clickhouseexporter/README.md#configuration-options).
106193

107194
#### Configuration structure {#configuration-structure}
108195

@@ -120,7 +207,7 @@ To further secure your deployment, we recommend:
120207

121208
- Configuring the collector to communicate with ClickHouse over HTTPS.
122209
- Create a dedicated user for ingestion with limited permissions - see below.
123-
- Enabling TLS for the OTLP endpoint, ensuring encrypted communication between SDKs/agents and the collector. **Currently, this requires users to deploy a default distribution of the collector and manage the configuration themselves**.
210+
- Enabling TLS for the OTLP endpoint, ensuring encrypted communication between SDKs/agents and the collector. This can be configured via [custom collector configuration](#extending-collector-config).
124211

125212
### Creating an ingestion user {#creating-an-ingestion-user}
126213

@@ -276,7 +363,7 @@ However, if you require high delivery guarantees or the ability to replay data (
276363
In this case, OTel agents can be configured to send data to Kafka via the [Kafka exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/kafkaexporter/README.md). Gateway instances, in turn, consume messages using the [Kafka receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/kafkareceiver/README.md). We recommend the Confluent and OTel documentation for further details.
277364

278365
:::note OTel collector configuration
279-
The ClickStack OpenTelemetry collector distribution cannot be used with Kafka as it requires a configuration modification. Users will need to deploy a default OTel collector using the ClickHouse exporter.
366+
The ClickStack OpenTelemetry collector distribution can be configured with Kafka using [custom collector configuration](#extending-collector-config).
280367
:::
281368

282369
## Estimating resources {#estimating-resources}

0 commit comments

Comments
 (0)