166 lines
4.8 KiB
YAML
166 lines
4.8 KiB
YAML
---
|
|
# Source: opentelemetry-collector/templates/configmap-agent.yaml
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: example-opentelemetry-collector-agent
|
|
namespace: default
|
|
labels:
|
|
helm.sh/chart: opentelemetry-collector-0.66.4
|
|
app.kubernetes.io/name: opentelemetry-collector
|
|
app.kubernetes.io/instance: example
|
|
app.kubernetes.io/version: "0.83.0"
|
|
app.kubernetes.io/managed-by: Helm
|
|
data:
|
|
relay: |
|
|
exporters:
|
|
logging: {}
|
|
extensions:
|
|
health_check: {}
|
|
memory_ballast:
|
|
size_in_percentage: 40
|
|
processors:
|
|
batch: {}
|
|
memory_limiter:
|
|
check_interval: 5s
|
|
limit_percentage: 80
|
|
spike_limit_percentage: 25
|
|
receivers:
|
|
filelog:
|
|
exclude: []
|
|
include:
|
|
- /var/log/pods/*/*/*.log
|
|
include_file_name: false
|
|
include_file_path: true
|
|
operators:
|
|
- id: get-format
|
|
routes:
|
|
- expr: body matches "^\\{"
|
|
output: parser-docker
|
|
- expr: body matches "^[^ Z]+ "
|
|
output: parser-crio
|
|
- expr: body matches "^[^ Z]+Z"
|
|
output: parser-containerd
|
|
type: router
|
|
- id: parser-crio
|
|
regex: ^(?P<time>[^ Z]+) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) ?(?P<log>.*)$
|
|
timestamp:
|
|
layout: 2006-01-02T15:04:05.999999999Z07:00
|
|
layout_type: gotime
|
|
parse_from: attributes.time
|
|
type: regex_parser
|
|
- combine_field: attributes.log
|
|
combine_with: ""
|
|
id: crio-recombine
|
|
is_last_entry: attributes.logtag == 'F'
|
|
max_log_size: 102400
|
|
output: extract_metadata_from_filepath
|
|
source_identifier: attributes["log.file.path"]
|
|
type: recombine
|
|
- id: parser-containerd
|
|
regex: ^(?P<time>[^ ^Z]+Z) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) ?(?P<log>.*)$
|
|
timestamp:
|
|
layout: '%Y-%m-%dT%H:%M:%S.%LZ'
|
|
parse_from: attributes.time
|
|
type: regex_parser
|
|
- combine_field: attributes.log
|
|
combine_with: ""
|
|
id: containerd-recombine
|
|
is_last_entry: attributes.logtag == 'F'
|
|
max_log_size: 102400
|
|
output: extract_metadata_from_filepath
|
|
source_identifier: attributes["log.file.path"]
|
|
type: recombine
|
|
- id: parser-docker
|
|
output: extract_metadata_from_filepath
|
|
timestamp:
|
|
layout: '%Y-%m-%dT%H:%M:%S.%LZ'
|
|
parse_from: attributes.time
|
|
type: json_parser
|
|
- id: extract_metadata_from_filepath
|
|
parse_from: attributes["log.file.path"]
|
|
regex: ^.*\/(?P<namespace>[^_]+)_(?P<pod_name>[^_]+)_(?P<uid>[a-f0-9\-]+)\/(?P<container_name>[^\._]+)\/(?P<restart_count>\d+)\.log$
|
|
type: regex_parser
|
|
- from: attributes.stream
|
|
to: attributes["log.iostream"]
|
|
type: move
|
|
- from: attributes.container_name
|
|
to: resource["k8s.container.name"]
|
|
type: move
|
|
- from: attributes.namespace
|
|
to: resource["k8s.namespace.name"]
|
|
type: move
|
|
- from: attributes.pod_name
|
|
to: resource["k8s.pod.name"]
|
|
type: move
|
|
- from: attributes.restart_count
|
|
to: resource["k8s.container.restart_count"]
|
|
type: move
|
|
- from: attributes.uid
|
|
to: resource["k8s.pod.uid"]
|
|
type: move
|
|
- from: attributes.log
|
|
to: body
|
|
type: move
|
|
start_at: beginning
|
|
jaeger:
|
|
protocols:
|
|
grpc:
|
|
endpoint: ${env:MY_POD_IP}:14250
|
|
thrift_compact:
|
|
endpoint: ${env:MY_POD_IP}:6831
|
|
thrift_http:
|
|
endpoint: ${env:MY_POD_IP}:14268
|
|
otlp:
|
|
protocols:
|
|
grpc:
|
|
endpoint: ${env:MY_POD_IP}:4317
|
|
http:
|
|
endpoint: ${env:MY_POD_IP}:4318
|
|
prometheus:
|
|
config:
|
|
scrape_configs:
|
|
- job_name: opentelemetry-collector
|
|
scrape_interval: 10s
|
|
static_configs:
|
|
- targets:
|
|
- ${env:MY_POD_IP}:8888
|
|
zipkin:
|
|
endpoint: ${env:MY_POD_IP}:9411
|
|
service:
|
|
extensions:
|
|
- health_check
|
|
- memory_ballast
|
|
pipelines:
|
|
logs:
|
|
exporters:
|
|
- logging
|
|
processors:
|
|
- memory_limiter
|
|
- batch
|
|
receivers:
|
|
- otlp
|
|
- filelog
|
|
metrics:
|
|
exporters:
|
|
- logging
|
|
processors:
|
|
- memory_limiter
|
|
- batch
|
|
receivers:
|
|
- otlp
|
|
- prometheus
|
|
traces:
|
|
exporters:
|
|
- logging
|
|
processors:
|
|
- memory_limiter
|
|
- batch
|
|
receivers:
|
|
- otlp
|
|
- jaeger
|
|
- zipkin
|
|
telemetry:
|
|
metrics:
|
|
address: ${env:MY_POD_IP}:8888
|