Skip to content

[Azure Monitor] Add default timegrain to Azure Storage Account metricset#46786

Merged
zmoog merged 5 commits intomainfrom
zmoog/feat/azure-storage-default-timegrain
Sep 30, 2025
Merged

[Azure Monitor] Add default timegrain to Azure Storage Account metricset#46786
zmoog merged 5 commits intomainfrom
zmoog/feat/azure-storage-default-timegrain

Conversation

@zmoog
Copy link
Contributor

@zmoog zmoog commented Sep 25, 2025

Proposed commit message

Adds a new default_timegrain configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Here are a couple of Metricbeat config to run the tests:

# With `period: 300s` and `default_timegrain: "PT1M"`, the metricset
# collects 5 data points every 300s (5 mins) — one for each minute.
- module: azure
  metricsets:
  - storage
  enabled: true
  period: 300s
  client_id: '${AZURE_CLIENT_ID:""}'
  client_secret: '${AZURE_CLIENT_SECRET:""}'
  tenant_id: '${AZURE_TENANT_ID:""}'
  subscription_id: '${AZURE_SUBSCRIPTION_ID:""}'
  refresh_list_interval: 3600s # 1h
  enable_batch_api: true
  default_timegrain: "PT1M"
# With `period: 60s` and `default_timegrain: "PT1M"`, the metricset 
# collects 1 data points every 60s.
- module: azure
  metricsets:
  - storage
  enabled: true
  period: 60s
  client_id: '${AZURE_CLIENT_ID:""}'
  client_secret: '${AZURE_CLIENT_SECRET:""}'
  tenant_id: '${AZURE_TENANT_ID:""}'
  subscription_id: '${AZURE_SUBSCRIPTION_ID:""}'
  refresh_list_interval: 3600s # 1h
  enable_batch_api: true
  default_timegrain: "PT1M"

If you have tens of storage accounts (or more), we recommend setting enable_batch_api: true.

Related issues

Allows user to pick a different time grain as default. Continue using
the current PT5M time grain values.
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 25, 2025
@zmoog zmoog self-assigned this Sep 25, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@zmoog zmoog added Team:obs-ds-hosted-services Label for the Observability Hosted Services team input:azure-monitor labels Sep 25, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 25, 2025
@mergify
Copy link
Contributor

mergify bot commented Sep 25, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @zmoog? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.
@zmoog zmoog added the backport-active-all Automated backport with mergify to all the active branches label Sep 25, 2025
@zmoog zmoog marked this pull request as ready for review September 30, 2025 10:13
@zmoog zmoog requested a review from a team as a code owner September 30, 2025 10:13
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@zmoog zmoog changed the title [Azure Metrics][Storage Account] Make default time grain configurable Sep 30, 2025
Copy link
Contributor

@constanca-m constanca-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@zmoog zmoog requested a review from a team as a code owner September 30, 2025 10:59
@github-actions
Copy link
Contributor

@zmoog
Copy link
Contributor Author

zmoog commented Sep 30, 2025

@elastic/ingest-docs, could you review this PR when you get a chance? I'm hoping to include this change in today's FF 🙇

@zmoog zmoog enabled auto-merge (squash) September 30, 2025 11:35
@zmoog zmoog merged commit 8f145b9 into main Sep 30, 2025
38 checks passed
@zmoog zmoog deleted the zmoog/feat/azure-storage-default-timegrain branch September 30, 2025 12:40
@github-actions
Copy link
Contributor

@Mergifyio backport 8.18 8.19 9.0 9.1

@mergify
Copy link
Contributor

mergify bot commented Sep 30, 2025

mergify bot pushed a commit that referenced this pull request Sep 30, 2025
…set (#46786)

Adds a new `default_timegrain` configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

(cherry picked from commit 8f145b9)

# Conflicts:
#	docs/reference/metricbeat/metricbeat-metricset-azure-storage.md
#	x-pack/metricbeat/module/azure/storage/_meta/docs.md
mergify bot pushed a commit that referenced this pull request Sep 30, 2025
…set (#46786)

Adds a new `default_timegrain` configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

(cherry picked from commit 8f145b9)
mergify bot pushed a commit that referenced this pull request Sep 30, 2025
…set (#46786)

Adds a new `default_timegrain` configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

(cherry picked from commit 8f145b9)

# Conflicts:
#	docs/reference/metricbeat/metricbeat-metricset-azure-storage.md
#	x-pack/metricbeat/module/azure/storage/_meta/docs.md
mergify bot pushed a commit that referenced this pull request Sep 30, 2025
…set (#46786)

Adds a new `default_timegrain` configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

(cherry picked from commit 8f145b9)
zmoog added a commit that referenced this pull request Sep 30, 2025
…set (#46786) (#46853)

Adds a new `default_timegrain` configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

(cherry picked from commit 8f145b9)

# Conflicts:
#	docs/reference/metricbeat/metricbeat-metricset-azure-storage.md
#	x-pack/metricbeat/module/azure/storage/_meta/docs.md

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
zmoog added a commit that referenced this pull request Sep 30, 2025
…set (#46786) (#46851)

Adds a new `default_timegrain` configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

(cherry picked from commit 8f145b9)

# Conflicts:
#	docs/reference/metricbeat/metricbeat-metricset-azure-storage.md
#	x-pack/metricbeat/module/azure/storage/_meta/docs.md

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
zmoog added a commit that referenced this pull request Sep 30, 2025
…set (#46786) (#46852)

Adds a new `default_timegrain` configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

(cherry picked from commit 8f145b9)

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
zmoog added a commit that referenced this pull request Sep 30, 2025
…set (#46786) (#46854)

Adds a new `default_timegrain` configuration option to allow users to customize the timegrain used in the Storage Account metricset. The default value remains PT5M, but users can now choose a different value.

Without this option, users can only collect metrics with a PT5M time grain. It is a sensible default, but some users want to collect metrics with a PT1M time grain.

To learn more, see elastic/integrations#15464.

(cherry picked from commit 8f145b9)

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches input:azure-monitor Team:obs-ds-hosted-services Label for the Observability Hosted Services team

4 participants