Help us shape the future of Go! Take the 2026 Go Developer Survey

telemetry

package
v0.24.2-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DimensionCollaborators     = "collaborators"
	DimensionBranchProtection  = "branch_protection"
	DimensionArchived          = "archived"
	DimensionSettings          = "settings"
	DimensionRulesetsForbidden = "rulesets_forbidden"
	DimensionRulesetParameters = "ruleset_parameters"
	DimensionRulesetSpec       = "ruleset_spec"
)

Dimensions of declared repository state that stays unapplied: state GitHub refuses to apply, and rulesets whose spec lists a ref pattern or bypass actor twice.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitMetrics

type RateLimitMetrics struct {
	// contains filtered or unexported fields
}

RateLimitMetrics holds only the essential Prometheus metrics for GitHub rate limiting

func NewForTest

func NewForTest() *RateLimitMetrics

NewForTest builds a RateLimitMetrics instance without registering it with the default Prometheus registry. Exported for cross-package tests that need to drive the metrics through real wrapper code.

func NewRateLimitMetrics

func NewRateLimitMetrics(_ ctrl.Manager) *RateLimitMetrics

NewRateLimitMetrics creates and registers only essential Prometheus metrics for GitHub rate limiting

func (*RateLimitMetrics) APICallsCountForTest

func (m *RateLimitMetrics) APICallsCountForTest(org, appID, installationID, method string) float64

APICallsCountForTest returns the current value of github_api_calls_total for the given labels. Exposed for cross-package test verification of the wrapper → telemetry wiring; production code should not need it.

func (*RateLimitMetrics) ForgetRepository

func (m *RateLimitMetrics) ForgetRepository(org, repo string)

ForgetRepository deletes every github_repository_unreconcilable series of the repository.

func (*RateLimitMetrics) PicksCountForTest

func (m *RateLimitMetrics) PicksCountForTest(org, appID, installationID, reason string) float64

PicksCountForTest returns the current value of github_app_picker_picks_total for the given labels. Same testing-only caveat as APICallsCountForTest.

func (*RateLimitMetrics) RecordAPICall

func (m *RateLimitMetrics) RecordAPICall(org, appID, installationID, method string)

RecordAPICall increments the github_api_calls_total counter for the given call. Counts every attempt, regardless of outcome.

func (*RateLimitMetrics) RecordAppUnhealthy

func (m *RateLimitMetrics) RecordAppUnhealthy(org, appID, installationID string)

RecordAppUnhealthy increments the github_app_unhealthy_total counter for the given (organization, app, installation). Call when a GitHub API call returns no HTTP response but an error.

func (*RateLimitMetrics) RecordPickerPick

func (m *RateLimitMetrics) RecordPickerPick(org, appID, installationID, reason string)

RecordPickerPick increments the github_app_picker_picks_total counter for the given credential and pick reason.

func (*RateLimitMetrics) RecordRateLimitInfo

func (m *RateLimitMetrics) RecordRateLimitInfo(resp *github.Response, org, appID, installationID string)

RecordRateLimitInfo records the rate-limit information from a GitHub API response. The org is the GitHub organization the call targeted; appID is the GitHub App ID; installationID is the GitHub App Installation ID. The (appID, installationID) pair uniquely identifies a credential.

func (*RateLimitMetrics) RepositoryUnreconcilableForTest

func (m *RateLimitMetrics) RepositoryUnreconcilableForTest() *prometheus.GaugeVec

RepositoryUnreconcilableForTest exposes the gauge vec to cross-package tests.

func (*RateLimitMetrics) SetRepositoryUnreconcilable

func (m *RateLimitMetrics) SetRepositoryUnreconcilable(org, repo, dimension string, unreconcilable bool)

SetRepositoryUnreconcilable publishes 1 when GitHub won't apply the dimension's declared state, else 0.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL