Skip to content

Commit

Permalink
Update config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
royfur authored Dec 13, 2023
1 parent 2c351b1 commit 11aad61
Showing 1 changed file with 42 additions and 16 deletions.
58 changes: 42 additions & 16 deletions otel-agent/ecs-ec2/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ receivers:
http:
endpoint: "0.0.0.0:4318"

prometheus:
config:
scrape_configs:
- job_name: otel-collector-metrics
scrape_interval: 60s
static_configs:
- targets: ['localhost:8888']

filelog:
start_at: end
include:
- /hostfs/var/lib/docker/containers/*/*.log

include_file_path: true

# add log.file.name to resource attributes
# add log.file.path to resource attributes
operators:
- type: move
from: attributes["log.file.name"]
to: resource["log.file.name"]
from: attributes["log.file.path"]
to: resource["log.file.path"]

# add metrics
awsecscontainermetricsd:
Expand All @@ -32,16 +40,7 @@ processors:
ecsattributes:
container_id:
sources:
- "log.file.name"

# only allow logs with container.name label
filter/ecslogs:
logs:
include:
match_type: regexp
resource_attributes:
- key: aws.ecs.container.name
value: '.*'
- "log.file.path"

transform/logs:
error_mode: ignore
Expand All @@ -54,7 +53,13 @@ processors:
- delete_key(attributes, "image.id")

batch:


# otel-collector resource detection for collector
resourcedetection/otel-collector:
detectors: [ecs, ec2]
timeout: 2s
override: false

exporters:
logging:
coralogix:
Expand All @@ -63,20 +68,28 @@ exporters:
application_name: "$APP_NAME"
subsystem_name: "$SUB_SYS"
application_name_attributes:
- "aws.ecs.cluster"
- "aws.ecs.cluster.name"
- "aws.ecs.task.definition.family"
subsystem_name_attributes:
- "aws.ecs.container.name"
- "aws.ecs.docker.name"
- "docker.name"
timeout: 30s

extensions:
health_check:

service:
extensions:
- health_check
pipelines:
logs:
receivers:
- filelog
processors:
- resourcedetection
- ecsattributes
- filter/ecslogs
- transform/logs
exporters:
- coralogix
Expand All @@ -95,4 +108,17 @@ service:
processors:
- batch
exporters:
- coralogix
- coralogix

metrics/otel-collector:
receivers:
- prometheus
processors:
- resourcedetection/otel-collector
exporters:
- coralogix

telemetry:
metrics:
address: 0.0.0.0:8888
level: detailed

0 comments on commit 11aad61

Please sign in to comment.