metricskey

package
v1.0.439 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 1 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package metricskey declares the metric descriptors emitted by porto's HTTP and gRPC servers (request latency and per-role counters, deployed version, logged-error counter). Metrics lists them all so appinit.Metrics can register help text with the Prometheus sink.

Index

Constants

This section is empty.

Variables

View Source
var (
	// HTTPReqPerf samples HTTP request latency by verb, status and URI
	// (restserver/telemetry). The uri tag is the matched route template or
	// "unknown", and verb is "_OTHER" for non-standard methods.
	HTTPReqPerf = metrics.Describe{
		Name:         "http_requests_perf",
		Type:         metrics.TypeSample,
		RequiredTags: []string{"verb", "status", "uri"},
		Help:         "provides quantiles for HTTP request.",
	}
	// HTTPReqByRole counts HTTP requests by verb, status, URI and caller
	// role, with the same verb and uri tags as HTTPReqPerf.
	HTTPReqByRole = metrics.Describe{
		Name:         "http_requests_role",
		Type:         metrics.TypeCounter,
		RequiredTags: []string{"verb", "status", "uri", "role"},
		Help:         "provides counts for HTTP request by role.",
	}

	// GRPCReqPerf samples gRPC request latency by API and status code (gserver).
	GRPCReqPerf = metrics.Describe{
		Name:         "rpc_requests_perf",
		Type:         metrics.TypeSample,
		RequiredTags: []string{"api", "status"},
		Help:         "provides quantiles for gRPC request.",
	}
	// GRPCReqByRole counts gRPC requests by API, status code and caller role.
	GRPCReqByRole = metrics.Describe{
		Name:         "rpc_requests_role",
		Type:         metrics.TypeCounter,
		RequiredTags: []string{"api", "status", "role"},
		Help:         "provides counts for gRPC request by role.",
	}

	// StatsVersion is a gauge set to the commit number by appinit.Metrics.
	StatsVersion = metrics.Describe{
		Type: metrics.TypeGauge,
		Name: "version",
		Help: "version provides the deployed version",
	}
	// HealthLogErrors counts errors written to the log, by package and build
	// (incremented from the xlog error hook installed by appinit.Metrics).
	HealthLogErrors = metrics.Describe{
		Type:         metrics.TypeCounter,
		Name:         "log_errors",
		Help:         "log_errors provides the counter of errors in logs",
		RequiredTags: []string{"pkg", "build"},
	}
)

Descriptors of the metrics emitted by this repo.

Metrics lists every descriptor in this package, for registering help text with a sink (see appinit.Metrics).

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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