Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/prometheus/common
/ functions
Functions
697 in github.com/prometheus/common
⨍
Functions
697
◇
Types & classes
119
↓ 71 callers
Method
String
()
model/value_type.go:24
↓ 46 callers
Method
Error
Error implements the error interface.
expfmt/text_parse.go:47
↓ 46 callers
Method
Get
Get registers a new GET route.
route/route.go:93
↓ 38 callers
Method
Equal
Equal reports whether two Times represent the same instant.
model/time.go:70
↓ 26 callers
Method
Close
()
expfmt/encode.go:61
↓ 26 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:606
↓ 22 callers
Method
Add
Add returns the Time t + d.
model/time.go:85
↓ 21 callers
Method
WriteByte
(c byte)
expfmt/text_create.go:36
↓ 16 callers
Method
Set
Set updates the logging level with the validation.
promslog/slog.go:101
↓ 14 callers
Function
LoadHTTPConfigFile
LoadHTTPConfigFile parses the given YAML file into a HTTPClientConfig.
config/http_config.go:319
↓ 14 callers
Method
WriteString
(s string)
expfmt/text_create.go:35
↓ 14 callers
Method
parseError
parseError sets p.err to a ParseError at the current line with the given message.
expfmt/text_parse.go:689
↓ 13 callers
Method
Fetch
(ctx context.Context)
config/http_config.go:772
↓ 10 callers
Method
Redirect
Redirect takes an absolute path and sends an internal HTTP redirect for it, prefixed by the router's path prefix. Note that this method does not inclu
route/route.go:130
↓ 9 callers
Method
CloseIdleConnections
()
config/http_config.go:68
↓ 9 callers
Method
Put
Put registers a new PUT route.
route/route.go:108
↓ 9 callers
Method
ServeHTTP
ServeHTTP implements http.Handler.
route/route.go:135
↓ 8 callers
Method
IsValid
IsValid returns true iff the name matches the pattern of LabelNameRE when NameValidationScheme is set to LegacyValidation, or valid UTF-8 if NameValid
model/labels.go:112
↓ 8 callers
Method
IsValidMetricName
IsValidMetricName returns whether metricName is valid according to s.
model/metric.go:153
↓ 8 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. Negative dur
model/time.go:227
↓ 8 callers
Function
TimeFromUnixNano
TimeFromUnixNano returns the Time equivalent to the Unix Time t provided in nanoseconds.
model/time.go:65
↓ 7 callers
Method
Before
Before reports whether the Time t is before o.
model/time.go:75
↓ 7 callers
Function
New
New returns a new Router.
route/route.go:53
↓ 7 callers
Method
handle
handle turns a HandlerFunc into an httprouter.Handle.
route/route.go:76
↓ 7 callers
Function
newTestServer
(handler func(w http.ResponseWriter, r *http.Request))
config/http_config_test.go:146
↓ 6 callers
Method
Decode
(*dto.MetricFamily)
expfmt/decode.go:32
↓ 6 callers
Method
Encode
(*dto.MetricFamily)
expfmt/encode.go:50
↓ 6 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:96
↓ 6 callers
Function
New
New returns a new slog.Logger. Each logged line will be annotated with a timestamp. The output always goes to stderr.
promslog/slog.go:260
↓ 6 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:623
↓ 6 callers
Method
RoundTrip
RoundTrip implements the http.RoundTrip interface.
config/http_config.go:1575
↓ 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:116
↓ 6 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:1239
↓ 6 callers
Function
hashNew
hashNew initializes a new fnv64a hash value.
model/fnv.go:24
↓ 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:698
↓ 6 callers
Function
writeEscapedString
(w enhancedWriter, v string, includeDoubleQuote bool)
expfmt/text_create.go:466
↓ 6 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:655
↓ 5 callers
Method
IsValidLabelName
IsValidLabelName returns whether labelName is valid according to s.
model/metric.go:176
↓ 5 callers
Function
MetricFamilyToOpenMetrics20
MetricFamilyToOpenMetrics20 converts a MetricFamily proto message into the OpenMetrics text format version 2.0.0 and writes the resulting lines to 'ou
expfmt/openmetrics_2_0_create.go:39
↓ 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:78
↓ 5 callers
Function
NewLevel
NewLevel returns a new Level.
promslog/slog.go:58
↓ 5 callers
Function
NewTLSConfig
NewTLSConfig creates a new tls.Config from the given TLSConfig.
config/http_config.go:1258
↓ 5 callers
Function
Param
Param returns param p for the context, or the empty string when param does not exist in context.
route/route.go:32
↓ 5 callers
Method
String
()
model/time.go:294
↓ 5 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:1378
↓ 5 callers
Function
genSampleHistogram
()
model/value_histogram_test.go:258
↓ 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
↓ 5 callers
Function
writeName
writeName writes a string as-is if it complies with the legacy naming scheme, or escapes it in double quotes if not.
expfmt/text_create.go:512
↓ 5 callers
Function
writeOpenMetricsNameAndLabelPairs
writeOpenMetricsNameAndLabelPairs works like writeOpenMetricsSample but formats the float in OpenMetrics style.
expfmt/openmetrics_create.go:457
↓ 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:51
↓ 4 callers
Method
FormatType
FormatType deduces an overall FormatType for the given format.
expfmt/expfmt.go:155
↓ 4 callers
Function
IsValidLegacyMetricName
IsValidLegacyMetricName is similar to IsValidMetricName but always uses the legacy validation scheme regardless of the value of NameValidationScheme.
model/metric.go:319
↓ 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
Method
Len
()
model/value.go:315
↓ 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:98
↓ 4 callers
Function
NegotiateAccept
NegotiateAccept returns the Content-Type based on the given Accept header and the list of accepted Formats provided by the caller, in order of prefere
expfmt/encode.go:101
↓ 4 callers
Function
NewDecoder
NewDecoder returns a new decoder based on the given input format. Metric names are validated based on the provided Format -- if the format requires es
expfmt/decode.go:85
↓ 4 callers
Function
NewEncoder
NewEncoder returns a new encoder based on content type negotiation. All Encoder implementations returned by NewEncoder also implement Closer, and call
expfmt/encode.go:188
↓ 4 callers
Function
NewInlineSecret
(text string)
config/http_config.go:781
↓ 4 callers
Function
NewOAuth2RoundTripper
NewOAuth2RoundTripper returns a round tripper that performs OAuth2 authentication. The opts variadic parameter accepts any HTTPClientOption (e.g. With
config/http_config.go:959
↓ 4 callers
Function
NewTextParser
NewTextParser returns a new TextParser with the provided nameValidationScheme.
expfmt/text_parse.go:89
↓ 4 callers
Method
ResolvedAt
ResolvedAt returns true iff the activity interval ended before the given timestamp.
model/alert.go:70
↓ 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
Method
UnixNano
UnixNano returns t as a Unix time, the number of nanoseconds elapsed since January 1, 1970 UTC.
model/time.go:107
↓ 4 callers
Function
WithSecretManager
WithSecretManager allows setting the secret manager.
config/http_config.go:592
↓ 4 callers
Function
benchmarkLabelToSignature
(b *testing.B, l map[string]string, e uint64)
model/signature_test.go:191
↓ 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:278
↓ 4 callers
Function
benchmarkMetricToFingerprint
(b *testing.B, ls LabelSet, e Fingerprint)
model/signature_test.go:214
↓ 4 callers
Method
close
()
config/http_config_test.go:1845
↓ 4 callers
Function
getCertificateBlobs
(t *testing.T)
config/http_config_test.go:1012
↓ 4 callers
Function
isBlankOrTab
(b byte)
expfmt/text_parse.go:962
↓ 4 callers
Function
isCrossHostRedirect
isCrossHostRedirect reports whether req is a redirect that has left the original request's host at any point in the chain. It detects this by walking
config/http_config.go:1159
↓ 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
toSecret
toSecret returns a SecretReader from one of the given sources, assuming exactly one or none of the sources are provided.
config/http_config.go:841
↓ 4 callers
Function
writeCertificate
(bs map[string][]byte, src, dst string)
config/http_config_test.go:1033
↓ 3 callers
Method
Clone
Clone returns a copy of the Metric.
model/metric.go:260
↓ 3 callers
Method
Description
()
config/http_config.go:773
↓ 3 callers
Method
Equal
(o *HistogramBucket)
model/value_histogram.go:85
↓ 3 callers
Function
NewAuthorizationCredentialsRoundTripper
NewAuthorizationCredentialsRoundTripper adds the authorization credentials read from the provided SecretReader to a request unless the authorization h
config/http_config.go:869
↓ 3 callers
Function
NewFileSecret
(file string)
config/http_config.go:801
↓ 3 callers
Function
NewTLSRoundTripperWithContext
( ctx context.Context, cfg *tls.Config, settings TLSRoundTripperSettings, newRT func(*tls.Config) (http.Ro
config/http_config.go:1507
↓ 3 callers
Method
Proxy
Proxy returns the Proxy URL for a request.
config/http_config.go:1711
↓ 3 callers
Method
Resolved
Resolved returns true iff the activity interval ended in the past.
model/alert.go:64
↓ 3 callers
Method
RoundTrip
(*http.Request)
config/http_config_test.go:1769
↓ 3 callers
Method
Set
Set implements the pflag.Value interface.
model/metric.go:138
↓ 3 callers
Method
SetDirectory
SetDirectory joins any relative file paths with dir. Any paths that are empty or absolute remain unchanged.
config/config.go:91
↓ 3 callers
Method
String
String returns the current level.
promslog/slog.go:85
↓ 3 callers
Method
String
String returns the string representation of s.
model/metric.go:82
↓ 3 callers
Method
Time
Time returns the time.Time representation of t.
model/time.go:95
↓ 3 callers
Method
ToEscapingScheme
ToEscapingScheme returns an EscapingScheme depending on the Format. Iff the Format contains a escaping=allow-utf-8 term, it will select NoEscaping. If
expfmt/expfmt.go:207
↓ 3 callers
Method
Validate
Validate checks whether the alert data is inconsistent.
model/alert.go:91
↓ 3 callers
Method
WithEscapingScheme
WithEscapingScheme returns a copy of Format with the specified escaping scheme appended to the end. If an escaping scheme already exists it is removed
expfmt/expfmt.go:134
↓ 3 callers
Method
WriteRune
(r rune)
expfmt/text_create.go:34
↓ 3 callers
Function
isCount
(name string)
expfmt/text_parse.go:966
↓ 3 callers
Function
isSum
(name string)
expfmt/text_parse.go:970
↓ 3 callers
Function
isValidLabelNameStart
(b byte)
expfmt/text_parse.go:946
↓ 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
Function
newTestOAuthServer
newTestOAuthServer returns a new test server with the expected base64 encoded client ID and secret.
config/http_config_test.go:1806
next →
1–100 of 697, ranked by callers