Skip to content

Draft: Add Kubearchive exporter#1054

Open
raks-tt wants to merge 9 commits into
redhat-appstudio:mainfrom
raks-tt:ka_exporter
Open

Draft: Add Kubearchive exporter#1054
raks-tt wants to merge 9 commits into
redhat-appstudio:mainfrom
raks-tt:ka_exporter

Conversation

@raks-tt
Copy link
Copy Markdown
Contributor

@raks-tt raks-tt commented Mar 26, 2026

Add kubearchive exporter that reads archived PLR, Snapshot and Release resource from Kubearchive HTTP API and exposes the Konflux metrics

Description


Pre-Submission Checklist

  • Jira Ticket: If a corresponding Jira ticket exists, it is linked in the description above, in the PR name, and/or in the commit message.
  • Alert Tests: New or modified alerts include tests to ensure they function correctly.
  • SOP / Runbook: Any required SOP has been created or updated as needed. If it has direct connection to the dashboard or alert - It should be included within the dashboard or alert's runbook label respectively.
  • Dashboards Addition: New dashboards or significant changes to them should have a link to the staging instance for validation purposes.
  • Contribution Guides: This submission follows the guidelines in our CONTRIBUTING.md - specifically about the commit conventions and PR instructions - together with our README.md which explains contents of this repository with useful examples for contribution.
  • Pipeline Finished Successfully

Deployment Notice

  • Production Deployment: For any changes to alerts, recording rules or dashboards, I understand that the deployment of changes to production requires updating the commit reference to o11y in app-interface repository.

Review

Once your PR is ready please let us know in the #forum-konflux-o11y slack channel. Tag @konflux-o11y-ic for assistance.

@raks-tt raks-tt added the 🛠️ WIP Work in progress label Mar 26, 2026
@raks-tt raks-tt changed the title Add Kubearchive exporter Draft: Add Kubearchive exporter Mar 26, 2026
@raks-tt raks-tt force-pushed the ka_exporter branch 6 times, most recently from a09a827 to 3674cfa Compare March 27, 2026 16:09
Add kubearchive exporter that reads archived PLR, Snapshot and Release resource from Kubearchive HTTP API and exposes the Konflux metrics
labelBuildPipelineRun = "appstudio.openshift.io/build-pipelinerun"
labelAppStudioApp = "appstudio.openshift.io/application"
labelAppStudioComp = "appstudio.openshift.io/component"
// Used as an annotation on the build PLR after Snapshot creation; also a label on test PLRs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Used as an annotation on the build PLR after Snapshot creation; also a label on test PLRs.
// Used as an annotation on the build PLR after Snapshot creation; also a label on test and release PLRs.

Comment on lines +213 to +217
type Condition struct {
Type string `json:"type"`
Status string `json:"status,omitempty"`
Reason string `json:"reason"`
}
Copy link
Copy Markdown
Contributor

@FaisalAl-Rayes FaisalAl-Rayes Mar 31, 2026

Choose a reason for hiding this comment

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

I think having the lastTransitionTime would be good as well, since it would give us the ability to even show the timings in between conditions like Released, Vlidated, ManagedPipelineProccessed, etc.

I do not mean in a way of "Let us use this info now, but let us collect it so that it will be easier to build a more granular system later.

Comment thread exporters/kaexporter/kaexporter.go Outdated
scrapeErrorsTotal *prometheus.CounterVec // labels: phase
lastScrapeSuccessGauge prometheus.Gauge // unix timestamp of last successful full scrape
scrapeDurationGauge prometheus.Gauge // last scrape wall-clock duration in seconds
truncationsTotal *prometheus.CounterVec // labels: resource (pipelineruns|snapshots|releases), namespace
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure what this means "truncationsTotal". Would be worth a comment.

raks-tt added 2 commits March 31, 2026 08:15
This fix also updates the queue wait time to wait time in the metric naming convention.
Document the scrape interval in README.md
Add test cases for race conidtion
raks-tt added 2 commits April 6, 2026 07:32
Updated the func signatures to accept namespace as parameter.
Change metric labels from baseURL to namespace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants