Skip to content

[exporter/awscloudwatchlogs] Unable to use PlaceHolder for Log_stream_name #46202

Description

@DesAWSume

Component(s)

exporter/awscloudwatchlogs

What happened?

Description

I am using aws cloudwatch logs exporter in EKS as daemonset. wanting to lodge the logs in different logstream base on their PodName or serviceName depending what looks better for debugging

But I am not use this placeholder

Version of the collector: 0.139.0 and 0.115.0

It can only set to a static String log_stream_name

Steps to Reproduce

tried on both version 139 and 115, no luck. redeployed daemonset and restart roolout no luck

error message:

env-vars file found. Sourcing it...
Error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):

'exporters' error reading configuration for "awscloudwatchlogs/sydney": decoding failed due to the following error(s):

'log_stream_name' expected type 'string', got unconvertible type 'map[string]interface {}'
'service.telemetry.metrics' decoding failed due to the following error(s):

'' has invalid keys: address
2026/02/19 08:23:53 collector server run finished with error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):

'exporters' error reading configuration for "awscloudwatchlogs/sydney": decoding failed due to the following error(s):

'log_stream_name' expected type 'string', got unconvertible type 'map[string]interface {}'
'service.telemetry.metrics' decoding failed due to the following error(s):

'' has invalid keys: address

Expected Result

Actual Result

Collector version

0.139.0

Environment information

Environment

EKS Cluster

OpenTelemetry Collector configuration

exporters:
  awscloudwatchlogs/sydney:
    region: ap-southeast-2
    endpoint: "logs.ap-southeast-2.amazonaws.com"
    log_group_name: /aws/xxx-xxx-daemonset-dev
    log_stream_name: {PodName}
    raw_log: true
    sending_queue:
      enabled: true
      num_consumers: 10
  nop:

extensions:
  basicauth/client:
    client_auth:
      username: xxxxxxxxxxxxxxxxxxxx
      password: ${env:xxxxxxxxxxx}

processors:
  memory_limiter:
    check_interval: 60s
    limit_percentage: 95
    spike_limit_percentage: 5
  batch:
    send_batch_size: 1000
    send_batch_max_size: 1500
    timeout: 1s
  k8sattributes:
    auth_type: 'serviceAccount'
    extract:
      metadata: # extracted from the pod
      - k8s.namespace.name
      - k8s.pod.name
      - k8s.pod.start_time
      - k8s.pod.uid
      - k8s.deployment.name
      - k8s.node.name
    pod_association: # How to associate the data to a pod (order matters)
    - sources: # First try to use the value of the resource attribute k8s.pod.ip
      - from: resource_attribute
        name: k8s.pod.ip
    - sources: # Then try to use the value of the resource attribute k8s.pod.uid
      - from: resource_attribute
        name: k8s.pod.uid
    - sources: # If neither of those work, use the request's connection to get the pod IP.
      - from: connection
  resourcedetection/system:
    detectors: [system, env, eks, gcp]
    timeout: 5s
    override: false
    system:
      hostname_sources: [os]
      resource_attributes:
        host.name:
          enabled: true
        host.id:
          enabled: true
 

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
      http:
        endpoint: xxxxxxxxxxxxxx
  kubeletstats:
    auth_type: 'serviceAccount'
    collection_interval: 10s
    endpoint: '${env:K8S_NODE_NAME}:10250'
    insecure_skip_verify: true
    metric_groups:
    - node
    - pod
    - container
  k8s_cluster:
    auth_type: 'serviceAccount'
    node_conditions_to_report:
    - Ready
    - MemoryPressure
    allocatable_types_to_report:
    - cpu
    - memory
    - ephemeral-storage
    - storage
  filelog:
    include:
    - /var/log/pods/*/*/*.log
    exclude:
    - /var/log/pods/*kube-proxy*/*/*.log
    - /var/log/pods/*kube-system*/*/*.log
    - /var/log/pods/*amazon*/*/*.log
    start_at: end
    poll_interval: 200ms
    include_file_path: true
    include_file_name: false
    operators:
    - id: container-parser
      type: container

service:
  telemetry:
    logs:
      output_paths: ["stdout"]
    metrics:
      address: 127.0.0.1:8888
      level: "detailed"
  extensions: [basicauth/client]
  pipelines:
    logs:
      receivers:
      - otlp
      - filelog
      processors:
      - memory_limiter
      - k8sattributes
      - batch
      exporters:
      - awscloudwatchlogs/sydney
    metrics:
      receivers:
      - otlp
      - kubeletstats
      - k8s_cluster
      processors:
      - memory_limiter
      - k8sattributes
      - batch
      exporters:
      - nop

Log output

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions