dbmetrics

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package dbmetrics defines the data-access-wide repository-operation- duration instrument (used by store.go/resolver.go): a metric name plus a thin re-export of pkg/telemetry/db's generic OperationRecorder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(reg prometheus.Registerer) error

Init registers the duration histogram with reg. Call once, from the API boot path (dataaccess.NewDataAccessAPI), before serving traffic.

func Observe

func Observe[T any](operation string, fn func() (T, error)) (T, error)

Observe runs fn, recording its duration under operation (e.g. "store.BatchUpsert") and a status of "ok" or "error" based on whether fn returned an error.

func ObserveErr

func ObserveErr(operation string, fn func() error) error

ObserveErr is Observe for operations that return only an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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