ghmetrics

package
v0.0.0-...-37c3036 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectCacheEntryAgeMetrics

func CollectCacheEntryAgeMetrics(age float64, path, userAgent, tokenHash string)

func CollectCacheRequestMetrics

func CollectCacheRequestMetrics(mode, path, userAgent, tokenHash string)

CollectCacheRequestMetrics records a cache outcome for a specific path

func CollectGitHubRequestMetrics

func CollectGitHubRequestMetrics(tokenHash, path, statusCode, userAgent string, roundTripTime float64)

CollectGitHubRequestMetrics publishes the number of requests by API path to `github_requests` on prometheus.

func CollectGitHubRequestWaitDurationMetrics

func CollectGitHubRequestWaitDurationMetrics(tokenHash, requestType, api string, duration time.Duration)

CollectGitHubRequestWaitDurationMetrics publishes the wait duration of requests before sending to respective GitHub API on prometheus.

func CollectGitHubTokenMetrics

func CollectGitHubTokenMetrics(tokenHash, apiVersion string, headers http.Header, reqStartTime, responseTime time.Time)

CollectGitHubTokenMetrics publishes the rate limits of the github api to `github_token_usage` as well as `github_token_reset` on prometheus.

func CollectRequestTimeoutMetrics

func CollectRequestTimeoutMetrics(tokenHash, path, userAgent string, reqStartTime, responseTime time.Time)

CollectRequestTimeoutMetrics publishes the duration of timed-out requests by API path to 'github_request_timeouts' on prometheus.

Types

type Hasher

type Hasher interface {
	Hash(req *http.Request) string
}

Hasher knows how to hash an authorization header from a request

func NewCachingHasher

func NewCachingHasher() Hasher

Jump to

Keyboard shortcuts

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