-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add otel agent to collect bacalhau telemetry
- agent currently logs telemetry. later can be configured to pusblish to an endpoint: either one we host, or something like google stackdriver
- Loading branch information
Showing
6 changed files
with
152 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
#cloud-config | ||
|
||
write_files: | ||
# bacalhau config | ||
- path: /etc/config.yaml | ||
encoding: b64 | ||
owner: root:root | ||
permissions: "0600" | ||
content: | | ||
${bacalhau_config_file} | ||
# bacalhau service file | ||
- path: /etc/systemd/system/bacalhau.service | ||
encoding: b64 | ||
owner: root:root | ||
permissions: "0600" | ||
content: | | ||
${bacalhau_service_file} | ||
${bacalhau_service_file} | ||
# otel config file | ||
- path: /etc/otel-collector.yaml | ||
encoding: b64 | ||
owner: root:root | ||
permissions: "0600" | ||
content: | | ||
${otel_config_file} | ||
# otel service file | ||
- path: /etc/systemd/system/otel.service | ||
encoding: b64 | ||
owner: root:root | ||
permissions: "0600" | ||
content: | | ||
${otel_service_file} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
receivers: | ||
# gather telemetry from host machine | ||
hostmetrics: | ||
scrapers: | ||
cpu: | ||
disk: | ||
load: | ||
filesystem: | ||
memory: | ||
network: | ||
paging: | ||
# gather telemetry from bacalhau process (from otel sdk) | ||
otlp: | ||
protocols: | ||
http: | ||
# gather telemetry from otel collector process | ||
prometheus: | ||
config: | ||
scrape_configs: | ||
- job_name: 'otel-collector' | ||
scrape_interval: 5s | ||
static_configs: | ||
- targets: [ '0.0.0.0:8888' ] | ||
|
||
# modify the collection of telemetry data before exporting | ||
processors: | ||
batch: | ||
memory_limiter: | ||
check_interval: 5s | ||
limit_mib: 4000 | ||
spike_limit_mib: 500 | ||
resourcedetection/gcp: | ||
detectors: [ env, gcp ] | ||
timeout: 2s | ||
override: false | ||
resource: | ||
attributes: | ||
- key: service.namespace | ||
value: bacalhau | ||
action: insert | ||
# TODO why is this here? | ||
attributes/metrics: | ||
actions: | ||
- pattern: net\.sock.+ | ||
action: delete | ||
|
||
# export telemetry gathered to stderr of otel process | ||
exporters: | ||
logging: | ||
loglevel: debug | ||
|
||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [memory_limiter, resourcedetection/gcp, resource, attributes/metrics, batch] | ||
exporters: [logging] | ||
metrics: | ||
receivers: [otlp, hostmetrics] | ||
processors: [memory_limiter, resourcedetection/gcp, resource, attributes/metrics, batch] | ||
exporters: [logging] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=otel collector | ||
Documentation=https://opentelemetry.io/docs/collector/ | ||
Wants=network-online.target | ||
After=network-online.target | ||
|
||
[Service] | ||
User=root | ||
Group=root | ||
Type=simple | ||
ExecStart=/usr/local/bin/otelcol --config=/etc/otel-collector.yaml | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters