Skip to content

Commit

Permalink
Use container parser of stanza for logs collection
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
  • Loading branch information
ChrsMark committed May 21, 2024
1 parent f2ebdd7 commit 3898148
Show file tree
Hide file tree
Showing 52 changed files with 133 additions and 273 deletions.
4 changes: 2 additions & 2 deletions charts/opentelemetry-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: opentelemetry-collector
version: 0.91.0
version: 0.92.0
description: OpenTelemetry Collector Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
Expand All @@ -11,4 +11,4 @@ maintainers:
- name: dmitryax
- name: TylerHelmuth
icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png
appVersion: 0.100.0
appVersion: 0.101.0
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

spec:
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 92be7b24299d17c97aa3f2b661361540d16caedad4f296422a2af8045bcc83d3
checksum/config: 0645dba252fbdc71211d92da4af781943561d9d6343635b45204727eca195e48

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand All @@ -43,7 +43,7 @@ spec:
- --config=/conf/relay.yaml
securityContext:
{}
image: "otel/opentelemetry-collector-k8s:0.100.0"
image: "otel/opentelemetry-collector-k8s:0.101.0"
imagePullPolicy: IfNotPresent
ports:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

spec:
Expand All @@ -25,7 +25,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 7aa25c9ca167fc4075856764b45a1dc518e9ba4db77ac62977b00efdd2686482
checksum/config: a32316e7f1106e70882004e9b8bb0bcdb96606da2f45e39582ac4bfe9e47b0f8

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand All @@ -45,7 +45,7 @@ spec:
- --config=/conf/relay.yaml
securityContext:
{}
image: "otel/opentelemetry-collector-k8s:0.100.0"
image: "otel/opentelemetry-collector-k8s:0.101.0"
imagePullPolicy: IfNotPresent
ports:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

component: standalone-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

data:
Expand All @@ -33,75 +33,8 @@ data:
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
- id: container-parser
type: container
retry_on_failure:
enabled: true
start_at: end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

spec:
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 5edd36b1bf33ebf353b72e17c931aab73aee690d0bc74b313e520942fe72d5b7
checksum/config: 591854462026a1db90be51643e212e82ad4e2e91a9323e9a3cbd99c6cc4900d6

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand All @@ -43,7 +43,7 @@ spec:
- --config=/conf/relay.yaml
securityContext:
{}
image: "otel/opentelemetry-collector-k8s:0.100.0"
image: "otel/opentelemetry-collector-k8s:0.101.0"
imagePullPolicy: IfNotPresent
ports:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

spec:
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 4285c4ecb49f7fac48b7ff203bd884342b71419242bbde4f604068746ed52ed9
checksum/config: 9ebe2b7aea3a9fad1a9a6f72b4f320d7415aa2d966075a4f2232983f5c5bf3f6

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand All @@ -43,7 +43,7 @@ spec:
- --config=/conf/relay.yaml
securityContext:
{}
image: "otel/opentelemetry-collector-k8s:0.100.0"
image: "otel/opentelemetry-collector-k8s:0.101.0"
imagePullPolicy: IfNotPresent
ports:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

spec:
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 854e09daa51b89d33a2b094f238253a3ed393c27bb5d6f8d31b064ea1cf0daf1
checksum/config: 491af6061555765df7599a9358fa0291dc6e5c35991af29113d2250da52cf105

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand All @@ -43,7 +43,7 @@ spec:
- --config=/conf/relay.yaml
securityContext:
{}
image: "otel/opentelemetry-collector-k8s:0.100.0"
image: "otel/opentelemetry-collector-k8s:0.101.0"
imagePullPolicy: IfNotPresent
ports:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.91.0
helm.sh/chart: opentelemetry-collector-0.92.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.100.0"
app.kubernetes.io/version: "0.101.0"
app.kubernetes.io/managed-by: Helm

data:
Expand Down
Loading

0 comments on commit 3898148

Please sign in to comment.