Skip to content

Improve build metrics with new counters, gauges, and labels#2187

Open
avinal wants to merge 1 commit intoshipwright-io:mainfrom
avinal:main
Open

Improve build metrics with new counters, gauges, and labels#2187
avinal wants to merge 1 commit intoshipwright-io:mainfrom
avinal:main

Conversation

@avinal
Copy link
Copy Markdown
Member

@avinal avinal commented May 6, 2026

Changes

Add build_buildrun_result_total counter that tracks BuildRun completions
with outcome (succeeded/failed/cancelled/timeout), replacing the
misleading build_buildruns_completed_total which fired at executor
creation. Add build_buildrun_failure_reason_total counter for failure
breakdown, build_buildruns_active gauge for in-flight BuildRuns, and
build_buildstrategy_count gauge for strategy objects.

Add opt-in labels strategy_kind, executor, result, and source_type
to all metrics. Record pre-executor validation failures in result
metrics. Count both successful and failed Build registrations.

Related Issue

Fixes #2148

Type of PR

/kind feature

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Kind label has been set
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes


"action-required"
- New metrics: build_buildrun_result_total, build_buildrun_failure_reason_total, build_buildruns_active, build_buildstrategy_count
- New labels: strategy_kind, executor, result, source_type (opt-in via PROMETHEUS_ENABLED_LABELS) 
- Deprecated: build_buildruns_completed_total in favor of build_buildrun_result_total
- Fixed: build_builds_registered_total now counts both successful and failed registrations

@openshift-ci openshift-ci Bot added release-note Label for when a PR has specified a release note kind/feature Categorizes issue or PR as related to a new feature. labels May 6, 2026
@openshift-ci openshift-ci Bot requested review from SaschaSchwarze0 and dorzel May 6, 2026 11:34
@pull-request-size pull-request-size Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 6, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign heavywombat for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Add build_buildrun_result_total counter that tracks BuildRun completions
with outcome (succeeded/failed/cancelled/timeout), replacing the
misleading build_buildruns_completed_total which fired at executor
creation. Add build_buildrun_failure_reason_total counter for failure
breakdown, build_buildruns_active gauge for in-flight BuildRuns, and
build_buildstrategy_count gauge for strategy objects.

Add opt-in labels strategy_kind, executor, result, and source_type
to all metrics. Record pre-executor validation failures in result
metrics. Count both successful and failed Build registrations.

Fixes shipwright-io#2148

Assisted-by: Claude Code
Signed-off-by: Avinal Kumar <avinal@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. release-note Label for when a PR has specified a release note size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[FEATURE] Improve Shipwright Builds Metrics

2 participants