metrics

package
v0.0.0-...-a7a8f6c Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusSucceed failed
	StatusSucceed = "succeed"
	// StatusFailed failed
	StatusFailed = "failed"

	// ActionCreate create new branch transaction
	ActionCreate = "new"
	// ActionReport report the branch transaction status on phase one
	ActionReport = "report"
	// ActionCommit commit the global transaction
	ActionCommit = "commit"
	// ActionRollback rollback the global transaction
	ActionRollback = "rollback"
	// ActionACK report the branch transaction status on phase two
	ActionACK = "ack"

	// PhaseOne phase one
	PhaseOne = "one"
	// PhaseTwo phase two
	PhaseTwo = "two"
)
View Source
const (
	// RoleLeader leader fragment
	RoleLeader = "leader"
	// RoleFollower follower fragment
	RoleFollower = "follower"
)

Variables

View Source
var (
	// ActionGCounter action on global count
	ActionGCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "seata",
			Subsystem: "server",
			Name:      "action_global_total",
			Help:      "Total number of global transcation actions made.",
		}, []string{"fragment", "action", "status", "name"})

	// ActiveGGauge active global transaction
	ActiveGGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: "seata",
		Subsystem: "server",
		Name:      "global_active_total",
		Help:      "Total number of active global transaction.",
	}, []string{"fragment"})

	// GDurationHistogram global transaction duration time
	GDurationHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "seata",
			Subsystem: "server",
			Name:      "global_duration_seconds",
			Help:      "Bucketed histogram of global processing duration.",
			Buckets:   prometheus.ExponentialBuckets(0.0005, 2.0, 20),
		}, []string{"fragment"})

	// ActionBCounter action on branch
	ActionBCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "seata",
			Subsystem: "server",
			Name:      "action_branch_total",
			Help:      "Total number of action on branch transcation made.",
		}, []string{"fragment", "action", "status", "resource"})

	// BDurationHistogram branch transaction duration time with all phase
	BDurationHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "seata",
			Subsystem: "server",
			Name:      "branch_duration_seconds",
			Help:      "Bucketed histogram of branch processing duration.",
			Buckets:   prometheus.ExponentialBuckets(0.0005, 2.0, 20),
		}, []string{"fragment", "phase"})
)
View Source
var (
	// FragmentGauge fragment count
	FragmentGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "seata",
			Subsystem: "sharding",
			Name:      "fragment_total",
			Help:      "Total number of Fragment.",
		}, []string{"role"})
)

Functions

func Push

func Push(cfg *MetricConfig)

Push metircs in background.

Types

type MetricConfig

type MetricConfig struct {
	PushJob      string        `toml:"job" json:"job"`
	PushAddress  string        `toml:"address" json:"address"`
	PushInterval time.Duration `toml:"interval" json:"interval"`
}

MetricConfig is the metric configuration.

Jump to

Keyboard shortcuts

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