-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[otel] Add basic configuration samples (#5002)
- Loading branch information
1 parent
21781d7
commit 9861bf1
Showing
9 changed files
with
648 additions
and
0 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
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,73 @@ | ||
receivers: | ||
# Receiver for platform specific log files | ||
filelog/platformlogs: | ||
include: [ /var/log/*.log ] | ||
# start_at: beginning | ||
|
||
# Receiver for CPU, Disk, Memory, and Filesystem metrics | ||
hostmetrics/system: | ||
collection_interval: 30s | ||
scrapers: | ||
disk: | ||
filesystem: | ||
cpu: | ||
memory: | ||
|
||
processors: | ||
elasticinframetrics: | ||
resourcedetection: | ||
detectors: ["system"] | ||
system: | ||
hostname_sources: ["os"] | ||
resource_attributes: | ||
host.name: | ||
enabled: true | ||
host.id: | ||
enabled: false | ||
host.arch: | ||
enabled: true | ||
host.ip: | ||
enabled: true | ||
host.mac: | ||
enabled: true | ||
host.cpu.vendor.id: | ||
enabled: true | ||
host.cpu.family: | ||
enabled: true | ||
host.cpu.model.id: | ||
enabled: true | ||
host.cpu.model.name: | ||
enabled: true | ||
host.cpu.stepping: | ||
enabled: true | ||
host.cpu.cache.l2.size: | ||
enabled: true | ||
os.description: | ||
enabled: true | ||
os.type: | ||
enabled: true | ||
|
||
exporters: | ||
elasticsearch: | ||
endpoints: ["${env:ELASTIC_ENDPOINT}"] | ||
api_key: ${env:ELASTIC_API_KEY} | ||
mapping: | ||
mode: ecs | ||
logs_dynamic_index: | ||
enabled: true | ||
metrics_dynamic_index: | ||
enabled: true | ||
traces_dynamic_index: | ||
enabled: true | ||
|
||
service: | ||
pipelines: | ||
metrics/hostmetrics: | ||
receivers: [hostmetrics/system] | ||
processors: [elasticinframetrics, resourcedetection] | ||
exporters: [elasticsearch] | ||
|
||
logs/platformlogs: | ||
receivers: [filelog/platformlogs] | ||
processors: [resourcedetection] | ||
exporters: [elasticsearch] |
102 changes: 102 additions & 0 deletions
102
internal/pkg/otel/samples/darwin/logs_metrics_traces.yml
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,102 @@ | ||
receivers: | ||
|
||
# Receiver for platform specific log files | ||
filelog/platformlogs: | ||
include: [ /var/log/*.log ] | ||
# start_at: beginning | ||
|
||
# Receiver for CPU, Disk, Memory, and Filesystem metrics | ||
hostmetrics/system: | ||
collection_interval: 30s | ||
scrapers: | ||
disk: | ||
filesystem: | ||
cpu: | ||
memory: | ||
|
||
# Receiver for logs, traces, and metrics from SDKs | ||
otlp/fromsdk: | ||
protocols: | ||
grpc: | ||
http: | ||
|
||
processors: | ||
elasticinframetrics: | ||
resourcedetection: | ||
detectors: ["system"] | ||
system: | ||
hostname_sources: ["os"] | ||
resource_attributes: | ||
host.name: | ||
enabled: true | ||
host.id: | ||
enabled: false | ||
host.arch: | ||
enabled: true | ||
host.ip: | ||
enabled: true | ||
host.mac: | ||
enabled: true | ||
host.cpu.vendor.id: | ||
enabled: true | ||
host.cpu.family: | ||
enabled: true | ||
host.cpu.model.id: | ||
enabled: true | ||
host.cpu.model.name: | ||
enabled: true | ||
host.cpu.stepping: | ||
enabled: true | ||
host.cpu.cache.l2.size: | ||
enabled: true | ||
os.description: | ||
enabled: true | ||
os.type: | ||
enabled: true | ||
|
||
exporters: | ||
|
||
otlp/apm: | ||
endpoint: "${env:APM_ENDPOINT}" | ||
headers: | ||
# Elastic APM Server secret token or API key | ||
Authorization: "Bearer ${env:APM_SECRET_KEY}" | ||
|
||
elasticsearch: | ||
endpoints: ["${env:ELASTIC_ENDPOINT}"] | ||
api_key: ${env:ELASTIC_API_KEY} | ||
mapping: | ||
mode: ecs | ||
logs_dynamic_index: | ||
enabled: true | ||
metrics_dynamic_index: | ||
enabled: true | ||
traces_dynamic_index: | ||
enabled: true | ||
|
||
service: | ||
pipelines: | ||
traces/fromsdk: | ||
receivers: [otlp/fromsdk] | ||
processors: [] | ||
exporters: [otlp/apm] | ||
|
||
metrics/fromsdk: | ||
receivers: [otlp/fromsdk] | ||
processors: [] | ||
exporters: [otlp/apm] | ||
|
||
metrics/hostmetrics: | ||
receivers: [hostmetrics/system] | ||
processors: [elasticinframetrics, resourcedetection] | ||
exporters: [elasticsearch] | ||
|
||
logs/fromsdk: | ||
receivers: [otlp/fromsdk] | ||
processors: [] | ||
exporters: [otlp/apm] | ||
|
||
logs/platformlogs: | ||
receivers: [filelog/platformlogs] | ||
processors: [resourcedetection] | ||
exporters: [elasticsearch] |
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,66 @@ | ||
receivers: | ||
# Receiver for platform specific log files | ||
filelog/platformlogs: | ||
include: [ /var/log/*.log ] | ||
# start_at: beginning | ||
|
||
|
||
processors: | ||
resourcedetection: | ||
detectors: ["system"] | ||
system: | ||
hostname_sources: ["os"] | ||
resource_attributes: | ||
host.name: | ||
enabled: true | ||
host.id: | ||
enabled: false | ||
host.arch: | ||
enabled: true | ||
host.ip: | ||
enabled: true | ||
host.mac: | ||
enabled: true | ||
host.cpu.vendor.id: | ||
enabled: true | ||
host.cpu.family: | ||
enabled: true | ||
host.cpu.model.id: | ||
enabled: true | ||
host.cpu.model.name: | ||
enabled: true | ||
host.cpu.stepping: | ||
enabled: true | ||
host.cpu.cache.l2.size: | ||
enabled: true | ||
os.description: | ||
enabled: true | ||
os.type: | ||
enabled: true | ||
|
||
exporters: | ||
# Exporter to print the first 5 logs/metrics and then every 1000th | ||
debug: | ||
verbosity: detailed | ||
sampling_initial: 5 | ||
sampling_thereafter: 1000 | ||
|
||
# Exporter to send logs and metrics to Elasticsearch | ||
elasticsearch: | ||
endpoints: ["${env:ELASTIC_ENDPOINT}"] | ||
api_key: ${env:ELASTIC_API_KEY} | ||
mapping: | ||
mode: ecs | ||
logs_dynamic_index: | ||
enabled: true | ||
metrics_dynamic_index: | ||
enabled: true | ||
traces_dynamic_index: | ||
enabled: true | ||
|
||
service: | ||
pipelines: | ||
logs/platformlogs: | ||
receivers: [filelog/platformlogs] | ||
processors: [resourcedetection] | ||
exporters: [debug, elasticsearch] |
78 changes: 78 additions & 0 deletions
78
internal/pkg/otel/samples/darwin/platformlogs_hostmetrics.yml
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,78 @@ | ||
receivers: | ||
# Receiver for platform specific log files | ||
filelog/platformlogs: | ||
include: [ /var/log/*.log ] | ||
# start_at: beginning | ||
|
||
# Receiver for CPU, Disk, Memory, and Filesystem metrics | ||
hostmetrics/system: | ||
collection_interval: 30s | ||
scrapers: | ||
disk: | ||
filesystem: | ||
cpu: | ||
memory: | ||
|
||
processors: | ||
resourcedetection: | ||
detectors: ["system"] | ||
system: | ||
hostname_sources: ["os"] | ||
resource_attributes: | ||
host.name: | ||
enabled: true | ||
host.id: | ||
enabled: false | ||
host.arch: | ||
enabled: true | ||
host.ip: | ||
enabled: true | ||
host.mac: | ||
enabled: true | ||
host.cpu.vendor.id: | ||
enabled: true | ||
host.cpu.family: | ||
enabled: true | ||
host.cpu.model.id: | ||
enabled: true | ||
host.cpu.model.name: | ||
enabled: true | ||
host.cpu.stepping: | ||
enabled: true | ||
host.cpu.cache.l2.size: | ||
enabled: true | ||
os.description: | ||
enabled: true | ||
os.type: | ||
enabled: true | ||
|
||
exporters: | ||
# Exporter to print the first 5 logs/metrics and then every 1000th | ||
debug: | ||
verbosity: detailed | ||
sampling_initial: 5 | ||
sampling_thereafter: 1000 | ||
|
||
# Exporter to send logs and metrics to Elasticsearch | ||
elasticsearch: | ||
endpoints: ["${env:ELASTIC_ENDPOINT}"] | ||
api_key: ${env:ELASTIC_API_KEY} | ||
mapping: | ||
mode: ecs | ||
logs_dynamic_index: | ||
enabled: true | ||
metrics_dynamic_index: | ||
enabled: true | ||
traces_dynamic_index: | ||
enabled: true | ||
|
||
service: | ||
pipelines: | ||
metrics/hostmetrics: | ||
receivers: [hostmetrics/system] | ||
processors: [resourcedetection] | ||
exporters: [debug, elasticsearch] | ||
logs/platformlogs: | ||
receivers: [filelog/platformlogs] | ||
processors: [resourcedetection] | ||
exporters: [debug, elasticsearch] |
Oops, something went wrong.