prometheusmetrics
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- func ActiveUsers(ctx context.Context, registerer prometheus.Registerer, db database.Store, ...) (func(), error)
- func AgentStats(ctx context.Context, logger slog.Logger, registerer prometheus.Registerer, ...) (func(), error)
- func Agents(ctx context.Context, logger slog.Logger, registerer prometheus.Registerer, ...) (func(), error)
- func Workspaces(ctx context.Context, registerer prometheus.Registerer, db database.Store, ...) (func(), error)
- type CachedGaugeVec
- type MetricsAggregator
- type VectorOperation
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcActiveUsers¶
func ActiveUsers(ctxcontext.Context, registererprometheus.Registerer, dbdatabase.Store, durationtime.Duration) (func(),error)
ActiveUsers tracks the number of users that have authenticated within the past hour.
funcAgentStats¶added inv0.22.1
funcAgents¶added inv0.22.1
func Agents(ctxcontext.Context, loggerslog.Logger, registererprometheus.Registerer, dbdatabase.Store, coordinator *atomic.Pointer[tailnet.Coordinator], derpMap *tailcfg.DERPMap, agentInactiveDisconnectTimeout, durationtime.Duration) (func(),error)
Agents tracks the total number of workspaces with labels on status.
funcWorkspaces¶
func Workspaces(ctxcontext.Context, registererprometheus.Registerer, dbdatabase.Store, durationtime.Duration) (func(),error)
Workspaces tracks the total number of workspaces with labels on status.
Types¶
typeCachedGaugeVec¶added inv0.22.1
type CachedGaugeVec struct {// contains filtered or unexported fields}
CachedGaugeVec is a wrapper for the prometheus.GaugeVec which allowsfor staging changes in the metrics vector. Calling "WithLabelValues(...)"will update the internal gauge value, but it will not be returned by"Collect(...)" until the "Commit()" method is called. The "Commit()" methodresets the internal gauge and applies all staged changes to it.
The Use of CachedGaugeVec is recommended for use cases when there is a riskthat the Prometheus collector receives incomplete metrics, collectedin the middle of metrics recalculation, between "Reset()" and the last"WithLabelValues()" call.
funcNewCachedGaugeVec¶added inv0.22.1
func NewCachedGaugeVec(gaugeVec *prometheus.GaugeVec) *CachedGaugeVec
func (*CachedGaugeVec)Collect¶added inv0.22.1
func (v *CachedGaugeVec) Collect(ch chan<-prometheus.Metric)
func (*CachedGaugeVec)Commit¶added inv0.22.1
func (v *CachedGaugeVec) Commit()
Commit will set the internal value as the cached value to return from "Collect()".The internal metric value is completely reset, so the caller should expectthe gauge to be empty for the next 'WithLabelValues' values.
func (*CachedGaugeVec)Describe¶added inv0.22.1
func (v *CachedGaugeVec) Describe(desc chan<- *prometheus.Desc)
func (*CachedGaugeVec)WithLabelValues¶added inv0.22.1
func (v *CachedGaugeVec) WithLabelValues(operationVectorOperation, valuefloat64, labelValues ...string)
typeMetricsAggregator¶added inv0.23.1
type MetricsAggregator struct {// contains filtered or unexported fields}
funcNewMetricsAggregator¶added inv0.23.1
func NewMetricsAggregator(loggerslog.Logger, registererprometheus.Registerer, durationtime.Duration) (*MetricsAggregator,error)
func (*MetricsAggregator)Collect¶added inv0.23.1
func (ma *MetricsAggregator) Collect(ch chan<-prometheus.Metric)
func (*MetricsAggregator)Describe¶added inv0.23.1
func (*MetricsAggregator) Describe(_ chan<- *prometheus.Desc)
Describe function does not have any knowledge about the metrics schema,so it does not emit anything.
func (*MetricsAggregator)Run¶added inv0.23.1
func (ma *MetricsAggregator) Run(ctxcontext.Context) func()
func (*MetricsAggregator)Update¶added inv0.23.1
func (ma *MetricsAggregator) Update(ctxcontext.Context, username, workspaceName, agentNamestring, metrics []agentsdk.AgentMetric)
typeVectorOperation¶added inv0.22.1
type VectorOperationint
const (VectorOperationAddVectorOperation =iotaVectorOperationSet)