metrics

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClientGeneratePromptTasksTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: MetricsNamespace,
			Subsystem: MetricsClientSubsystem,
			Name:      "generate_prompt_tasks_total",
			Help:      "Count the amount of generate prompt tasks",
		},
		[]string{"endpoint", "model", "style"},
	)
	ClientGeneratePromptTasksDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: MetricsNamespace,
			Subsystem: MetricsClientSubsystem,
			Name:      "generate_prompt_tasks_duration_seconds",
			Help:      "Histogram of the time (in seconds) each generate prompt task took",
			Buckets:   []float64{.001, .002, .005, .01, .02, .05, .1, .2, .5, 1},
		},
		[]string{"endpoint", "model", "style"},
	)
)
View Source
var (
	ActivePluginsInfo = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: MetricsNamespace,
			Name:      "active_plugins_info",
			Help:      "Active plugins information",
		},
		[]string{"name", "version", "author"},
	)
	ActiveServicesInfo = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: MetricsNamespace,
			Name:      "active_services_info",
			Help:      "Active services information",
		},
		[]string{"plugin", "name", "type"},
	)
)
View Source
var (
	ServerHttpRequestsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: MetricsNamespace,
			Subsystem: MetricsServerSubsystem,
			Name:      "http_requests_total",
			Help:      "Count the amount of http requests",
		},
		[]string{"method", "addr", "path"},
	)
	ServerHttpRequestsDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: MetricsNamespace,
			Subsystem: MetricsServerSubsystem,
			Name:      "http_requests_duration_seconds",
			Help:      "Histogram of the time (in seconds) each http request took",
			Buckets:   prometheus.ExponentialBuckets(0.0001, 2, 15),
		},
		[]string{"method", "addr", "path"},
	)
)
View Source
var MetricsClientSubsystem = "client"
View Source
var MetricsNamespace = "queueverse"
View Source
var MetricsServerSubsystem = "server"

Functions

func RegisterActivePlugin

func RegisterActivePlugin(name, version, author string)

func RegisterActiveService

func RegisterActiveService(plugin, name, t string)

func Setup

func Setup(pool string) (*prometheus.Registry, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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