telemetry

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(level string) (*zap.Logger, error)

NewLogger returns a production-safe structured logger.

func SetupTracing

func SetupTracing(_ context.Context, serviceName string) (func(context.Context) error, error)

SetupTracing wires a real OpenTelemetry SDK tracer provider and W3C propagation.

func StandardLogFields

func StandardLogFields(component string, operation string, fields ...zap.Field) []zap.Field

StandardLogFields returns the baseline fields every structured operational log should carry so API, worker, and scanner logs remain easy to correlate.

func String

func String(key, val string) zap.Field

String aliases zap.String for cleaner call sites outside telemetry package.

func ValidateMetricLabels

func ValidateMetricLabels(metricName string, labels ...string) error

ValidateMetricLabels rejects labels that would create unbounded Prometheus series.

func ZapError

func ZapError(err error) zap.Field

ZapError centralizes error field formatting.

Types

type Metrics

type Metrics struct {
	ScanRunsTotal                          prometheus.Counter
	ScanEnqueueTotal                       prometheus.Counter
	ScanEnqueueFailureTotal                prometheus.Counter
	ScanEnqueueDurationMS                  prometheus.Histogram
	ScanSuccessTotal                       prometheus.Counter
	ScanFailureTotal                       prometheus.Counter
	ScanPartialTotal                       prometheus.Counter
	ScanInFlight                           prometheus.Gauge
	ScanDurationMS                         prometheus.Histogram
	FindingsGenerated                      prometheus.Counter
	RepoScanRunsTotal                      prometheus.Counter
	RepoScanEnqueueTotal                   prometheus.Counter
	RepoScanEnqueueFailureTotal            prometheus.Counter
	RepoScanEnqueueDurationMS              prometheus.Histogram
	RepoScanSuccessTotal                   prometheus.Counter
	RepoScanFailureTotal                   prometheus.Counter
	RepoScanTruncatedTotal                 prometheus.Counter
	RepoScanModeRunsTotal                  *prometheus.CounterVec
	RepoScanSkippedTotal                   *prometheus.CounterVec
	RepoScanDurationMS                     prometheus.Histogram
	ServiceAuthzDenialsTotal               *prometheus.CounterVec
	RepoFindingsGenerated                  prometheus.Counter
	QueueDepth                             *prometheus.GaugeVec
	WorkerJobsTotal                        *prometheus.CounterVec
	WorkerRequeuesTotal                    *prometheus.CounterVec
	WorkerDeadLettersTotal                 *prometheus.CounterVec
	WorkerRetriesTotal                     *prometheus.CounterVec
	AutomationRunsTotal                    *prometheus.CounterVec
	AutomationLagMS                        *prometheus.HistogramVec
	APIDeniedRequestsTotal                 *prometheus.CounterVec
	AuthzPolicyShadowEvaluationsTotal      prometheus.Counter
	AuthzPolicyShadowDivergencesTotal      prometheus.Counter
	AuthzPolicyShadowEvaluationErrorsTotal prometheus.Counter
	AuthzPolicyShadowDivergenceRate        prometheus.Gauge
	AuthzPolicyRollbacksTotal              prometheus.Counter
	AuthzPolicyDecisionsByVersionTotal     *prometheus.CounterVec
}

Metrics bundles Prometheus instruments used by API and workers.

func NewMetrics

func NewMetrics() *Metrics

NewMetrics initializes a dedicated registry-safe instrument set.

Jump to

Keyboard shortcuts

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