Skip to content

[awscontainerinsightreceiver] Enable usage of user defined collection interval in awscontainerinsightreceiver #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: aws-cwa-dev
Choose a base branch
from

Conversation

TravisStark
Copy link

@TravisStark TravisStark commented Jun 7, 2025

Description

Container Insights supports configuring a collection interval via the CWAgent json config that dictates how often the metrics should be collected from the various sources such as cadvisor.

The collection internal is not used for all the sources the metrics are retrieved from, including:

  • DCGM monitor
  • neuron monitor
  • kueue metrics
  • EFA

This change adjusts the containerinsights receiver to pass the CollectionInterval defined in the receiver config on to each scraper.
(metrics_collection_interval in CW Agent config)

CollectionInterval time.Duration `mapstructure:"collection_interval"`

CollectionInterval time.Duration `mapstructure:"collection_interval"`

Note: For EFA, the original default collection interval value of 20s will be used if:

  • collection interval is 60s
  • collection interval is not explicitly defined in agent configuration,

Testing

Tested on an EKS Cluster running GPU and Neuron.

Changed CollectionInterval to 30.

{
    "agent":{
        "region":"us-east-1"
    },
    "logs":{
        "metrics_collected":{
            "application_signals":{
                "hosted_in":"multi-accelerator-cluster-1dot32"
            },
            "kubernetes":{
                "cluster_name":"multi-accelerator-cluster-1dot32",
                "enhanced_container_insights":true,
                "metrics_collection_interval": 30
            }
        }
    },
    "traces":{
        "traces_collected" :{
            "application_signals":{}
        }
    }
}    

Count of metrics increased from 1 per minute to 2 per minute.

Graph of DCGM Exporter metrics count with multiple collection intervals specified:
15s, 30s, 60s, and not-specified (defaults to 60s)

Screenshot 2025-06-12 at 12 55 16 PM

@TravisStark TravisStark changed the title Incorporate usage of user defined collection interval in containerinsights recievers Incorporate usage of user defined collection interval in containerinsights receivers Jun 10, 2025
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch from cbfcbf8 to f98329d Compare June 12, 2025 15:45
@TravisStark TravisStark changed the title Incorporate usage of user defined collection interval in containerinsights receivers [awscontainerinsightreceiver] Enable usage of user defined collection interval in awscontainerinsightreceiver Jun 12, 2025
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch 2 times, most recently from 0500d6c to e5cbfff Compare June 12, 2025 17:35
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch from e5cbfff to 79e3a20 Compare June 13, 2025 19:46
…s receivers and sets fallback defaultCollectionInterval
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch from 79e3a20 to bf561fd Compare June 14, 2025 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants