Skip to content

feat: add Prometheus telemetry collection with API-based time-window…#231

Open
Sypher845 wants to merge 5 commits into
krkn-chaos:mainfrom
Sypher845:optimize-prometheus-telemetry-collection
Open

feat: add Prometheus telemetry collection with API-based time-window…#231
Sypher845 wants to merge 5 commits into
krkn-chaos:mainfrom
Sypher845:optimize-prometheus-telemetry-collection

Conversation

@Sypher845

Copy link
Copy Markdown

Description

This PR optimizes Prometheus telemetry collection by adding an optional API-based collection method with time-window filtering.

Key Changes:

  • Added PrometheusExporter class that leverages existing KrknPrometheus for API-based metrics collection
  • Updated get_prometheus_pod_data() with optional parameters: start_timestamp, end_timestamp, prometheus_url, prometheus_bearer_token
  • Updated get_ocp_prometheus_data() to support new API collection method
  • Implemented automatic fallback to filesystem backup if API collection fails
  • Added time-window filtering with configurable buffers

New Configuration Keys (all optional):

  • prometheus_backup_use_api: Enable/disable API collection (default: true)
  • prometheus_time_window_minutes_before: Buffer before start time (default: 10)
  • prometheus_time_window_minutes_after: Buffer after end time (default: 10)

Documentation

  • Is documentation needed for this update?

Related Documentation PR (if applicable)

This PR helps in solving the issue #881 in krkn
Related Issue:* krkn-chaos/krkn#881

…e-window filtering

Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
@Sypher845
Sypher845 force-pushed the optimize-prometheus-telemetry-collection branch 2 times, most recently from 226d6fc to b28d3c6 Compare January 16, 2026 18:48
Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
@Sypher845
Sypher845 force-pushed the optimize-prometheus-telemetry-collection branch from b28d3c6 to 7d13c1f Compare January 16, 2026 19:09
@github-actions github-actions Bot added the needs-dco Commits are missing a Signed-off-by line label May 15, 2026
@github-actions

Copy link
Copy Markdown

Hi @Sypher845! 👋 One or more commits in this PR are missing a Signed-off-by line, which is required by our DCO policy.

Unsigned commits:

  • 1576d70: Merge branch 'main' into optimize-prometheus-telemetry-collection
  • 5f6f7ed: Merge branch 'main' into optimize-prometheus-telemetry-collection
  • 0ac39f1: Merge branch 'main' into optimize-prometheus-telemetry-collection

To fix, rebase and sign off all commits:

git rebase HEAD~3 --signoff
git push --force-with-lease

Or, to sign off every commit in this PR at once:

git rebase origin/main --signoff
git push --force-with-lease

Tip: Add -s to future git commit commands (e.g. git commit -s -m "...") to sign off automatically.

Note: Please make sure your PR contains only 1 commit before signing off. If you have multiple commits, squash them first:

git rebase -i origin/main   # mark all but the first as 'squash'
git commit --amend -s                 # add Signed-off-by to the squashed commit
git push --force-with-lease

The needs-dco label and this comment will be removed automatically once all commits are signed off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-dco Commits are missing a Signed-off-by line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants