metrics

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package metrics exposes wayback service status.

Index

Constants

View Source
const (
	ServiceIRC      = "irc"
	ServiceWeb      = "web"
	ServiceSlack    = "slack"
	ServiceMatrix   = "matrix"
	ServiceDiscord  = "discord"
	ServiceMastodon = "mastodon"
	ServiceTelegram = "telegram"
	ServiceTwitter  = "twitter"

	PublishIRC     = "irc"      // IRC channel
	PublishGithub  = "github"   // GitHub issues
	PublishNotion  = "notion"   // Notion page
	PublishChannel = "telegram" // Telegram channel
	PublishMstdn   = "mastodon" // Mastodon toot
	PublishDiscord = "discord"  // Discord channel
	PublishTwitter = "twitter"
	PublishMatrix  = "matrix"
	PublishSlack   = "slack"
	PublishNostr   = "nostr"
	PublishMeili   = "meili"

	StatusRequest = "request"
	StatusSuccess = "success"
	StatusFailure = "failure"
)

Common status values

Variables

This section is empty.

Functions

func IncrementPlayback

func IncrementPlayback(from, status string)

IncrementPlayback increments the incoming requests counter

func IncrementPublish

func IncrementPublish(desc, status string)

IncrementPublish increments the publish counter

func IncrementWayback

func IncrementWayback(from, status string)

IncrementWayback increments the incoming requests counter

Types

type Collector

type Collector struct {
	// WaybackPgs reports the archiving result for configured services
	WaybackPgs prometheus.GaugeVec

	// PlaybackPgs reports the playback result for configured services
	PlaybackPgs prometheus.GaugeVec

	// PublishPgs reports the publish result for configured services
	PublishPgs prometheus.GaugeVec
	// contains filtered or unexported fields
}

Collector represents a metric collector.

var Gather *Collector

Gather holds configured collector.

func NewCollector

func NewCollector() *Collector

NewCollector initializes a new metric collector.

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

Collect sends all the collected metrics to the provided prometheus channel. It requires the caller to handle synchronization.

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

Describe sends the descriptors of each Collector related metrics we have defined to the provided prometheus channel.

func (*Collector) Export

func (c *Collector) Export(labels ...string) string

Export export metrics by the given labels for matching.

Jump to

Keyboard shortcuts

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