Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/prometheus/common
/ functions
Functions
539 in github.com/prometheus/common
⨍
Functions
539
◇
Types & classes
97
↓ 42 callers
Method
String
()
model/value_type.go:24
↓ 40 callers
Method
Error
Error implements the error interface.
expfmt/text_parse.go:47
↓ 31 callers
Method
Get
Get registers a new GET route.
route/route.go:88
↓ 19 callers
Method
Add
Add returns the Time t + d.
model/time.go:85
↓ 13 callers
Method
Close
()
expfmt/encode.go:42
↓ 13 callers
Method
WriteByte
(c byte)
expfmt/text_create.go:36
↓ 12 callers
Method
Equal
Equal reports whether two Times represent the same instant.
model/time.go:70
↓ 12 callers
Function
NewClientFromConfig
NewClientFromConfig returns a new HTTP client configured for the given config.HTTPClientConfig and config.HTTPClientOption. The name is used as go-con
config/http_config.go:481
↓ 11 callers
Method
parseError
parseError sets p.err to a ParseError at the current line with the given message.
expfmt/text_parse.go:535
↓ 10 callers
Method
Set
Set implements pflag/flag.Value
model/time.go:174
↓ 10 callers
Method
WriteString
(s string)
expfmt/text_create.go:35
↓ 9 callers
Function
LoadHTTPConfigFile
LoadHTTPConfigFile parses the given YAML file into a HTTPClientConfig.
config/http_config.go:275
↓ 8 callers
Method
IsValid
IsValid is true iff the label name matches the pattern of LabelNameRE. This method, however, does not use LabelNameRE for the check but a much faster
model/labels.go:103
↓ 8 callers
Method
ServeHTTP
ServeHTTP implements http.Handler.
route/route.go:125
↓ 7 callers
Method
Before
Before reports whether the Time t is before o.
model/time.go:75
↓ 7 callers
Method
CloseIdleConnections
()
config/http_config.go:59
↓ 7 callers
Function
ParseDuration
ParseDuration parses a string into a time.Duration, assuming that a year always has 365d, a week always has 7d, and a day always has 24h.
model/time.go:204
↓ 7 callers
Method
Put
Put registers a new PUT route.
route/route.go:103
↓ 7 callers
Function
TimeFromUnixNano
TimeFromUnixNano returns the Time equivalent to the Unix Time t provided in nanoseconds.
model/time.go:65
↓ 7 callers
Method
Validate
Validate validates the TLSConfig to check that only one of the inlined or file-based fields for the TLS CA, client certificate, and client key are use
config/http_config.go:931
↓ 6 callers
Function
New
New returns a new Router.
route/route.go:48
↓ 6 callers
Function
NewTLSConfig
NewTLSConfig creates a new tls.Config from the given TLSConfig.
config/http_config.go:836
↓ 6 callers
Method
TextToMetricFamilies
TextToMetricFamilies reads 'in' as the simple and flat text-based exchange format and creates MetricFamily proto messages. It returns the MetricFamily
expfmt/text_parse.go:102
↓ 6 callers
Method
handle
handle turns a HandlerFunc into an httprouter.Handle.
route/route.go:71
↓ 6 callers
Function
hashNew
hashNew initializes a new fnv64a hash value.
model/fnv.go:24
↓ 6 callers
Function
newTestServer
(handler func(w http.ResponseWriter, r *http.Request))
config/http_config_test.go:140
↓ 6 callers
Method
skipBlankTab
skipBlankTab reads (and discards) bytes from p.buf until it encounters a byte that is neither ' ' nor '\t'. That byte is left in p.currentByte.
expfmt/text_parse.go:544
↓ 5 callers
Function
JoinDir
JoinDir joins dir and path if path is relative. If path is empty or absolute, it is returned unchanged.
config/config.go:85
↓ 5 callers
Function
MetricFamilyToText
MetricFamilyToText converts a MetricFamily proto message into text format and writes the resulting lines to 'out'. It returns the number of bytes writ
expfmt/text_create.go:66
↓ 5 callers
Method
RoundTrip
RoundTrip implements the http.RoundTrip interface.
config/http_config.go:1118
↓ 5 callers
Method
String
()
model/time.go:259
↓ 5 callers
Function
genSampleHistogram
()
model/value_histogram_test.go:256
↓ 5 callers
Function
hashAdd
hashAdd adds a string to a fnv64a hash value, returning the updated hash.
model/fnv.go:29
↓ 5 callers
Function
hashAddByte
hashAddByte adds a byte to a fnv64a hash value, returning the updated hash.
model/fnv.go:38
↓ 4 callers
Method
Fingerprint
Fingerprint returns a unique hash for the alert. It is equivalent to the fingerprint of the alert's label set.
model/alert.go:50
↓ 4 callers
Function
LabelsToSignature
LabelsToSignature returns a quasi-unique signature (i.e., fingerprint) for a given label set. (Collisions are possible but unlikely if the number of l
model/signature.go:31
↓ 4 callers
Function
MetricFamilyToOpenMetrics
MetricFamilyToOpenMetrics converts a MetricFamily proto message into the OpenMetrics text format and writes the resulting lines to 'out'. It returns t
expfmt/openmetrics_create.go:63
↓ 4 callers
Function
Param
Param returns param p for the context, or the empty string when param does not exist in context.
route/route.go:27
↓ 4 callers
Method
Unix
Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC.
model/time.go:101
↓ 4 callers
Function
benchmarkLabelToSignature
(b *testing.B, l map[string]string, e uint64)
model/signature_test.go:189
↓ 4 callers
Function
benchmarkMetricToFastFingerprint
(b *testing.B, ls LabelSet, e Fingerprint)
model/signature_test.go:237
↓ 4 callers
Function
benchmarkMetricToFastFingerprintConc
(b *testing.B, ls LabelSet, e Fingerprint, concLevel int)
model/signature_test.go:280
↓ 4 callers
Function
benchmarkMetricToFingerprint
(b *testing.B, ls LabelSet, e Fingerprint)
model/signature_test.go:213
↓ 4 callers
Function
cloneRequest
cloneRequest returns a clone of the provided *http.Request. The clone is a shallow copy of the struct and its Header map.
config/http_config.go:823
↓ 4 callers
Function
isBlankOrTab
(b byte)
expfmt/text_parse.go:736
↓ 4 callers
Function
labelSetToFastFingerprint
labelSetToFastFingerprint works similar to labelSetToFingerprint but uses a faster and less allocation-heavy hash function, which is more susceptible
model/signature.go:78
↓ 4 callers
Function
writeEscapedString
(w enhancedWriter, v string, includeDoubleQuote bool)
expfmt/text_create.go:422
↓ 3 callers
Method
Clone
Clone returns a copy of the Metric.
model/metric.go:43
↓ 3 callers
Method
Decode
(*dto.MetricFamily)
expfmt/decode.go:32
↓ 3 callers
Method
Encode
(*dto.MetricFamily)
expfmt/encode.go:31
↓ 3 callers
Method
Equal
(o *HistogramBucket)
model/value_histogram.go:84
↓ 3 callers
Function
GetRevision
()
version/info_go118.go:26
↓ 3 callers
Function
GetTags
()
version/info_go118.go:33
↓ 3 callers
Method
Len
()
model/value.go:314
↓ 3 callers
Function
NewOAuth2RoundTripper
(config *OAuth2, next http.RoundTripper, opts *httpClientOptions)
config/http_config.go:709
↓ 3 callers
Function
NewRoundTripperFromConfig
NewRoundTripperFromConfig returns a new HTTP RoundTripper configured for the given config.HTTPClientConfig and config.HTTPClientOption. The name is us
config/http_config.go:498
↓ 3 callers
Function
ParseAccept
Parse an Accept Header string returning a sorted list of clauses
internal/bitbucket.org/ww/goautoneg/autoneg.go:84
↓ 3 callers
Method
Proxy
Proxy returns the Proxy URL for a request.
config/http_config.go:1231
↓ 3 callers
Method
Resolved
Resolved returns true iff the activity interval ended in the past.
model/alert.go:63
↓ 3 callers
Method
SetDirectory
SetDirectory joins any relative file paths with dir. Any paths that are empty or absolute remain unchanged.
config/config.go:80
↓ 3 callers
Method
UnixNano
UnixNano returns t as a Unix time, the number of nanoseconds elapsed since January 1, 1970 UTC.
model/time.go:107
↓ 3 callers
Method
Validate
Validate checks whether the alert data is inconsistent.
model/alert.go:85
↓ 3 callers
Function
getCertificateBlobs
(t *testing.T)
config/http_config_test.go:986
↓ 3 callers
Function
isCount
(name string)
expfmt/text_parse.go:740
↓ 3 callers
Function
isSum
(name string)
expfmt/text_parse.go:744
↓ 3 callers
Function
isValidLabelNameStart
(b byte)
expfmt/text_parse.go:720
↓ 3 callers
Function
labelSetToFingerprint
labelSetToFingerprint works exactly as LabelsToSignature but takes a LabelSet as parameter (rather than a label map) and returns a Fingerprint.
model/signature.go:54
↓ 3 callers
Method
readTokenUntilNewline
readTokenUntilNewline copies bytes from p.buf into p.currentToken. The first byte considered is the byte already read (now in p.currentByte). The fi
expfmt/text_parse.go:578
↓ 3 callers
Method
readTokenUntilWhitespace
readTokenUntilWhitespace copies bytes from p.buf into p.currentToken. The first byte considered is the byte already read (now in p.currentByte). The
expfmt/text_parse.go:564
↓ 3 callers
Function
writeCertificate
(bs map[string][]byte, src string, dst string)
config/http_config_test.go:1009
↓ 3 callers
Function
writeOpenMetricsFloat
writeOpenMetricsFloat works like writeFloat but appends ".0" if the resulting number would otherwise contain neither a "." nor an "e".
expfmt/openmetrics_create.go:494
↓ 2 callers
Method
After
After reports whether the Time t is after o.
model/time.go:80
↓ 2 callers
Method
Decode
Decode calls the Decode method of the wrapped Decoder and then extracts the samples from the decoded MetricFamily into the provided model.Vector.
expfmt/decode.go:159
↓ 2 callers
Function
EncodeCertificate
(w io.Writer, cert *x509.Certificate)
config/generate.go:42
↓ 2 callers
Method
Equal
Equal compares first the metrics, then the timestamp, then the value. The semantics of value equality is defined by SampleValue.Equal.
model/value.go:43
↓ 2 callers
Method
GetProxyConnectHeader
ProxyConnectHeader() return the Proxy Connext Headers.
config/http_config.go:1267
↓ 2 callers
Method
HTTPHeader
()
config/config.go:54
↓ 2 callers
Function
IsValidMetricName
IsValidMetricName returns true iff name matches the pattern of MetricNameRE. This function, however, does not use MetricNameRE for the check but a muc
model/metric.go:90
↓ 2 callers
Function
LoadTLSConfig
LoadTLSConfig parses the given file into a tls.Config.
config/tls_config_test.go:31
↓ 2 callers
Method
Log
(keyvals ...interface{})
promlog/log_test.go:75
↓ 2 callers
Method
Name
Name returns the name of the alert. It is equivalent to the "alertname" label.
model/alert.go:44
↓ 2 callers
Function
NewAuthorizationCredentialsFileRoundTripper
NewAuthorizationCredentialsFileRoundTripper adds the authorization credentials read from the provided file to a request unless the authorization heade
config/http_config.go:625
↓ 2 callers
Function
NewAuthorizationCredentialsRoundTripper
NewAuthorizationCredentialsRoundTripper adds the provided credentials to a request unless the authorization header has already been set.
config/http_config.go:598
↓ 2 callers
Function
NewRoundTripCheckRequest
NewRoundTripCheckRequest creates a new instance of a type that implements http.RoundTripper, which before returning theResponse and theError, executes
config/http_config_test.go:1436
↓ 2 callers
Function
NewTLSRoundTripper
( cfg *tls.Config, settings TLSRoundTripperSettings, newRT func(*tls.Config) (http.RoundTripper, error), )
config/http_config.go:1044
↓ 2 callers
Function
NewUserAgentRoundTripper
NewUserAgentRoundTripper adds the user agent every request header.
config/http_config.go:1172
↓ 2 callers
Function
Now
Now returns the current time as a Time.
model/time.go:53
↓ 2 callers
Method
RoundTrip
(r *http.Request)
config/http_config_test.go:1420
↓ 2 callers
Function
SerialNumber
()
config/generate.go:67
↓ 2 callers
Method
Set
Set updates the value of the allowed level.
promlog/log.go:71
↓ 2 callers
Method
SetLevel
SetLevel changes the log level.
promlog/log.go:178
↓ 2 callers
Method
Time
Time returns the time.Time representation of t.
model/time.go:95
↓ 2 callers
Function
TimeFromUnix
TimeFromUnix returns the Time equivalent to the Unix Time t provided in seconds.
model/time.go:59
↓ 2 callers
Method
Validate
Validate validates the HTTPClientConfig to check only one of BearerToken, BasicAuth and BearerTokenFile is configured. It also validates that ProxyURL
config/http_config.go:331
↓ 2 callers
Method
WithInstrumentation
WithInstrumentation returns a router with instrumentation support.
route/route.go:55
↓ 2 callers
Function
extractSamples
(f *dto.MetricFamily, o *DecodeOptions)
expfmt/decode.go:188
↓ 2 callers
Method
getTLSDataWithHash
()
config/http_config.go:1068
↓ 2 callers
Function
isEmptyNonNilURL
checks if u equals to &url.URL{}
config/http_config_test.go:1754
↓ 2 callers
Function
isValidLabelNameContinuation
(b byte)
expfmt/text_parse.go:724
↓ 2 callers
Function
loadSigv4Config
(filename string)
sigv4/sigv4_config_test.go:24
next →
1–100 of 539, ranked by callers