Documentation
¶
Index ¶
- Constants
- type Recorder
- func (r *Recorder) EnsureTokenActive(ctx context.Context, controllerName, tokenKey string)
- func (r *Recorder) RecordConfigError(ctx context.Context, source string)
- func (r *Recorder) RecordGitHubAPIDuration(ctx context.Context, d time.Duration, err error)
- func (r *Recorder) RecordGitHubTokenRequest(ctx context.Context, err error)
- func (r *Recorder) RecordReconcileError(ctx context.Context, controllerName, reason string)
- func (r *Recorder) RecordSecretOperation(ctx context.Context, controllerName, operation, result string)
- func (r *Recorder) RecordTokenExpiry(ctx context.Context, controllerName, namespace, name string, ...)
- func (r *Recorder) RecordTokenRefresh(ctx context.Context, controllerName, result string)
- func (r *Recorder) RecordTokenRefreshDuration(ctx context.Context, controllerName, operation string, d time.Duration)
- func (r *Recorder) RemoveTokenActive(ctx context.Context, controllerName, tokenKey string)
- func (r *Recorder) Shutdown(ctx context.Context) error
Constants ¶
const ( ResultSuccess = "success" ResultError = "error" OperationCreate = "create" OperationUpdate = "update" OperationDelete = "delete" ReasonTransient = "transient" ReasonGitHubAPI = "github_api" ReasonConfig = "config" ReasonOwnership = "ownership" ReasonSecretCreate = "secret_create" ReasonSecretUpdate = "secret_update" ReasonStatusUpdate = "status_update" )
Attribute value constants for result and operation labels.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder holds all custom OTEL metric instruments for the operator. All recording methods are nil-receiver safe.
func Setup ¶
Setup creates an OTEL Prometheus exporter registered with the controller-runtime metrics registry, and returns a Recorder holding all custom instruments.
func (*Recorder) EnsureTokenActive ¶
EnsureTokenActive idempotently marks a token as active. The first call for a given tokenKey increments the active-token counter; subsequent calls are no-ops. This makes the counter self-healing across controller restarts.
func (*Recorder) RecordConfigError ¶
RecordConfigError records a configuration loading error.
func (*Recorder) RecordGitHubAPIDuration ¶
RecordGitHubAPIDuration records the duration of a GitHub API call.
func (*Recorder) RecordGitHubTokenRequest ¶
RecordGitHubTokenRequest records a GitHub Installation Access Token request.
func (*Recorder) RecordReconcileError ¶
RecordReconcileError records a reconciliation error with its reason.
func (*Recorder) RecordSecretOperation ¶
func (r *Recorder) RecordSecretOperation(ctx context.Context, controllerName, operation, result string)
RecordSecretOperation records a secret create/update/delete operation.
func (*Recorder) RecordTokenExpiry ¶
func (r *Recorder) RecordTokenExpiry(ctx context.Context, controllerName, namespace, name string, expiresAt time.Time)
RecordTokenExpiry records the expiry timestamp for a token.
func (*Recorder) RecordTokenRefresh ¶
RecordTokenRefresh records a token refresh operation with its result.
func (*Recorder) RecordTokenRefreshDuration ¶
func (r *Recorder) RecordTokenRefreshDuration(ctx context.Context, controllerName, operation string, d time.Duration)
RecordTokenRefreshDuration records the duration of a token refresh operation.
func (*Recorder) RemoveTokenActive ¶
RemoveTokenActive idempotently marks a token as inactive. Only decrements the counter if the tokenKey was previously tracked via EnsureTokenActive.