metrics

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package metrics provides a wrapper around the OpenTelemetry metrics API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(ns string, conn *grpc.ClientConn) (func(context context.Context) error, error)

Initialize sets up the metrics using the given grpc connection and namespace.

func InitializeMetrics

func InitializeMetrics() error

InitializeMetrics initializes the metrics middleware

func IsInitialized

func IsInitialized() bool

IsInitialized returns true if the metrics have been successfully initialized.

func Middleware

func Middleware() gin.HandlerFunc

Middleware records metrics for the request.

func NewCounter

func NewCounter(name, description string) (c metric.Int64Counter, err error)

NewCounter creates a new counter using the given name and description.

func NewHistogram

func NewHistogram(name, description string) (c metric.Float64Histogram, err error)

NewHistogram creates a new histogram using the given name and description.

func NewUpDownCounter

func NewUpDownCounter(name, description string) (c metric.Int64UpDownCounter, err error)

NewUpDownCounter creates a new up/down counter using the given name and description.

Types

This section is empty.

Jump to

Keyboard shortcuts

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