diff --git a/opentelemetry/ecs-ec2/CHANGELOG.md b/opentelemetry/ecs-ec2/CHANGELOG.md index 444b9cc3..c59cd36b 100644 --- a/opentelemetry/ecs-ec2/CHANGELOG.md +++ b/opentelemetry/ecs-ec2/CHANGELOG.md @@ -1,4 +1,7 @@ # Changelog +### 0.0.12 / 2024-05-16 +- Added validation using operator route to default otel config for ecs-ec2 config + ### 0.0.11 / 2024-04-05 - Remove deprecated PrivateKey Param from ecs-ec2 otel deployment diff --git a/opentelemetry/ecs-ec2/template.yaml b/opentelemetry/ecs-ec2/template.yaml index 39d96a94..1e8d6c4a 100644 --- a/opentelemetry/ecs-ec2/template.yaml +++ b/opentelemetry/ecs-ec2/template.yaml @@ -120,24 +120,35 @@ Mappings: include_file_path: true # add log.file.path to resource attributes operators: + - type: router + id: docker_log_json_parser + routes: + - output: json_parser + expr: 'body matches "^\\{\"log\".*\\}"' + default: move_log_file_path + - type: json_parser parse_from: body parse_to: body + output: recombine timestamp: parse_from: body.time layout: '%Y-%m-%dT%H:%M:%S.%fZ' + default: move_log_file_path # handle logs split by docker - type: recombine id: recombine + output: move_log_file_path combine_field: body.log source_identifier: attributes["log.file.path"] is_last_entry: body.log endsWith "\n" force_flush_period: 10s - on_error: drop + on_error: send combine_with: "" - type: move + id: move_log_file_path from: attributes["log.file.path"] to: resource["log.file.path"] @@ -261,28 +272,38 @@ Mappings: include_file_path: true # add log.file.path to resource attributes operators: + - type: router + id: docker_log_json_parser + routes: + - output: json_parser + expr: 'body matches "^\\{\"log\".*\\}"' + default: move_log_file_path + - type: json_parser parse_from: body parse_to: body + output: recombine timestamp: parse_from: body.time layout: '%Y-%m-%dT%H:%M:%S.%fZ' + default: move_log_file_path # handle logs split by docker - type: recombine id: recombine + output: move_log_file_path combine_field: body.log source_identifier: attributes["log.file.path"] is_last_entry: body.log endsWith "\n" force_flush_period: 10s - on_error: drop + on_error: send combine_with: "" - type: move + id: move_log_file_path from: attributes["log.file.path"] to: resource["log.file.path"] - - # add metrics + awsecscontainermetricsd: processors: