Skip to content

Comments

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

Closed
TravisStark wants to merge 1 commit intoaws-cwa-devfrom
tjstark/collection-interval-config
Closed

[awscontainerinsightreceiver] Enable usage of user defined collection interval in awscontainerinsightreceiver#319
TravisStark wants to merge 1 commit intoaws-cwa-devfrom
tjstark/collection-interval-config

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 2 times, most recently from 79e3a20 to bf561fd Compare June 14, 2025 03:06
agarakan
agarakan previously approved these changes Jun 17, 2025
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch from bf561fd to 5166708 Compare June 25, 2025 19:43
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jul 10, 2025
@TravisStark TravisStark removed the Stale label Jul 11, 2025
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch 2 times, most recently from ec0f3fd to 7d8a3c7 Compare July 13, 2025 19:13
@TravisStark
Copy link
Author

Making a change in the Agent to set the default collection interval to -1, this will be used to infer whether the collection interval was supplied by the config or not

@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch 3 times, most recently from 66ed9ef to 2cefec4 Compare July 21, 2025 14:06
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch from 80ce9ab to c826814 Compare July 22, 2025 16:19
@TravisStark TravisStark requested a review from mxiamxia as a code owner July 22, 2025 17:23
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch 4 times, most recently from 5561c58 to 2e41d3b Compare July 22, 2025 19:34
@github-actions
Copy link

github-actions bot commented Aug 6, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Aug 6, 2025
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch from 2e41d3b to 1836172 Compare August 11, 2025 15:06
@TravisStark TravisStark removed the Stale label Aug 11, 2025
…s receivers and sets fallback defaultCollectionInterval
@TravisStark TravisStark force-pushed the tjstark/collection-interval-config branch from 1836172 to 81f2c5d Compare August 13, 2025 20:05
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Aug 28, 2025
@github-actions
Copy link

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants