Skip to content

[Monitor-OpenTelemetry-Exporter] Add 15 Second Warmup for Long-Interval Statsbeat #41229

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 10 commits into
base: main
Choose a base branch
from

Conversation

JacksonWeber
Copy link
Member

Description

Adds a 15 second delay for Long-Interval Statsbeat collection such that it is not exported immediately upon startup of the client application.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 22:23
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label May 20, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a 15‑second warmup delay to prevent immediate export of long‑interval Statsbeat metrics upon client startup.

  • Updated tests to use time mocking to simulate metrics collection before and after the delay
  • Added startup delay logic in _statsbeat_metrics and scheduled a delayed export in _statsbeat using a Timer

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/statsbeat/test_statsbeat.py Updated tests to validate that metrics are not emitted before the 15‑second delay
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_statsbeat_metrics.py Added delay logic based on startup time for both feature and attach metrics
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_statsbeat.py Introduced a Timer to force a second export after 15 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monitor - Exporter Monitor OpenTelemetry Exporter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant