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 <[email protected]>
  • Loading branch information
ChrsMark committed May 22, 2024
1 parent ef0e1ac commit b83997a
Show file tree
Hide file tree
Showing 52 changed files with 68 additions and 208 deletions.
2 changes: 1 addition & 1 deletion 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.92.0
version: 0.93.0
description: OpenTelemetry Collector Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 0645dba252fbdc71211d92da4af781943561d9d6343635b45204727eca195e48
checksum/config: fb44ad0757ef118c3fadd994427b0f968c2270003610a96e14218055110fdff4

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand All @@ -25,7 +25,7 @@ spec:
template:
metadata:
annotations:
checksum/config: a32316e7f1106e70882004e9b8bb0bcdb96606da2f45e39582ac4bfe9e47b0f8
checksum/config: ec6797931aef0930b11d0e9ed7b94dd98aa0bcbd3f575171944b567116587eed

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
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,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 75c8df30b8c01632b668b2e5bddeae8410acea6759a10c762d840dc11d4e1889
checksum/config: 28302e07d6b7617cd4efc2990836ec590511ce7794f7ac6299f758bab7d2ead3

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 9ebe2b7aea3a9fad1a9a6f72b4f320d7415aa2d966075a4f2232983f5c5bf3f6
checksum/config: d7a637f2246a2ebfcd332cba10ce90be20bc38c9796bbf31cce6fc9054c751b0

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 491af6061555765df7599a9358fa0291dc6e5c35991af29113d2250da52cf105
checksum/config: fbbd03ad1a8622a07c27a03c99e5a1d230091534ae8006ff260c47f00ffe981f

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 491af6061555765df7599a9358fa0291dc6e5c35991af29113d2250da52cf105
checksum/config: fbbd03ad1a8622a07c27a03c99e5a1d230091534ae8006ff260c47f00ffe981f

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand All @@ -25,7 +25,7 @@ spec:
template:
metadata:
annotations:
checksum/config: a32316e7f1106e70882004e9b8bb0bcdb96606da2f45e39582ac4bfe9e47b0f8
checksum/config: ec6797931aef0930b11d0e9ed7b94dd98aa0bcbd3f575171944b567116587eed

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.92.0
helm.sh/chart: opentelemetry-collector-0.93.0
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.101.0"
Expand All @@ -25,7 +25,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 45d40b093556330c2a07735441697e56a7734bc192b52d2d08f8a6c37b671fc5
checksum/config: dff6f21be1480b37ac2e05a742affac42ed82459734dc0cafad2f2e2ec39da64

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

0 comments on commit b83997a

Please sign in to comment.