Skip to content

Commit 96fe676

Browse files
authored
cds-1099 add recomine configuration to default ecs-ec2 otel configuration (#123)
* changelog * changelog * add recombine operator to default configuration for opentelemetry ecs-ec2 integration
1 parent 2017b5a commit 96fe676

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

opentelemetry/ecs-ec2/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
### 0.0.9 / 2024-03-15
3+
- [cds-1099] add recombine operator to default configuration for opentelemetry ecs-ec2 integration
4+
- reverted previous fix for ECS EC2 default Otel configuration filelog receiver include statement to match the new mount scope
25

36
### 0.0.8 / 2024-03-13
47
- Fixed ECS EC2 default Otel configuration filelog receiver include statement to match the new mount scope

opentelemetry/ecs-ec2/template.yaml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,27 @@ Mappings:
122122
filelog:
123123
start_at: end
124124
include:
125-
- /hostfs/containers/*/*.log
125+
- /hostfs/var/lib/docker/containers/*/*.log
126126
include_file_path: true
127127
# add log.file.path to resource attributes
128128
operators:
129+
- type: json_parser
130+
parse_from: body
131+
parse_to: body
132+
timestamp:
133+
parse_from: body.time
134+
layout: '%Y-%m-%dT%H:%M:%S.%fZ'
135+
136+
# handle logs split by docker
137+
- type: recombine
138+
id: recombine
139+
combine_field: body.log
140+
source_identifier: attributes["log.file.path"]
141+
is_last_entry: body.log endsWith "\n"
142+
force_flush_period: 10s
143+
on_error: drop
144+
combine_with: ""
145+
129146
- type: move
130147
from: attributes["log.file.path"]
131148
to: resource["log.file.path"]
@@ -245,10 +262,27 @@ Mappings:
245262
filelog:
246263
start_at: end
247264
include:
248-
- /hostfs/containers/*/*.log
265+
- /hostfs/var/lib/docker/containers/*/*.log
249266
include_file_path: true
250267
# add log.file.path to resource attributes
251268
operators:
269+
- type: json_parser
270+
parse_from: body
271+
parse_to: body
272+
timestamp:
273+
parse_from: body.time
274+
layout: '%Y-%m-%dT%H:%M:%S.%fZ'
275+
276+
# handle logs split by docker
277+
- type: recombine
278+
id: recombine
279+
combine_field: body.log
280+
source_identifier: attributes["log.file.path"]
281+
is_last_entry: body.log endsWith "\n"
282+
force_flush_period: 10s
283+
on_error: drop
284+
combine_with: ""
285+
252286
- type: move
253287
from: attributes["log.file.path"]
254288
to: resource["log.file.path"]

0 commit comments

Comments
 (0)