Skip to content

Add periodic re-detection for otelcol.processor.resourcedetection EC2 detector (e.g., refresh_interval) #42663

@s009255

Description

@s009255

Component(s)

processor/resourcedetection

Is your feature request related to a problem? Please describe.

otelcol.processor.resourcedetection with the ec2 detector captures EC2 metadata/tags only at component initialization. In environments where instance tags change (e.g., tenancy/owner/role labels managed by IaC), operators currently need to restart Alloy.

Please add an optional periodic refresh for the EC2 detector so resource attributes can be updated without restarts.

Describe the solution you'd like

Dynamic tagging: Many teams update EC2 tags during deployments, blue/green rotations, or post-provision steps. We want new tags to appear in metrics, logs, and traces emitted after the change—without bouncing agents.

Proposed configuration (example)

otelcol.processor.resourcedetection "aws_ec2" {
  detectors = ["ec2"]
  ec2 {
    tags             = ["^Name$", "^Team$", "^Service.*$"]
    refresh_interval = "15m"      # NEW: off by default; enables periodic refresh
  }
}

Semantics (suggested):

  • On each tick, re-query EC2 (DescribeTags or IMDS “tags in metadata” if enabled).
  • Successful refresh updates the processor’s resource attributes; new datapoints/spans/logs carry updated values.
  • No changes to historical series (expected: new labels may create new time series).
  • Backoff on failures; honor timeouts; emit metrics/logs for refresh status.

Describe alternatives you've considered

No response

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions