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
↓ 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:732
↓ 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:718
↓ 3 callers
Method
setOrCreateCurrentMF
()
expfmt/text_parse.go:903
↓ 3 callers
Method
tokenURL
()
config/http_config_test.go:1841
↓ 3 callers
Method
url
()
config/http_config_test.go:1837
↓ 3 callers
Function
writeProtoTimestamp
(w enhancedWriter, ts *timestamppb.Timestamp)
expfmt/openmetrics_2_0_create.go:390
↓ 2 callers
Method
After
After reports whether the Time t is after o.
model/time.go:80
↓ 2 callers
Function
ComponentUserAgent
(component string)
version/info.go:115
↓ 2 callers
Function
ConvertToFloat
(i any)
helpers/templates/time.go:28
↓ 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:191
↓ 2 callers
Function
EncodeCertificate
(w io.Writer, cert *x509.Certificate)
config/generate.go:41
↓ 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
Function
EscapeMetricFamily
EscapeMetricFamily escapes the given metric names and labels with the given escaping scheme. Returns a new object that uses the same pointers to field
model/metric.go:327
↓ 2 callers
Function
EscapeName
EscapeName escapes the incoming name according to the provided escaping scheme. Depending on the rules of escaping, this may cause no change in the st
model/metric.go:405
↓ 2 callers
Method
GetProxyConnectHeader
ProxyConnectHeader() return the Proxy Connext Headers.
config/http_config.go:1747
↓ 2 callers
Function
GetRevision
()
version/info.go:100
↓ 2 callers
Function
GetTags
()
version/info.go:107
↓ 2 callers
Method
HTTPHeader
()
config/config.go:65
↓ 2 callers
Function
HumanizeDuration
(i any)
helpers/templates/time.go:61
↓ 2 callers
Function
HumanizeTimestamp
(i any)
helpers/templates/time.go:108
↓ 2 callers
Method
Immutable
()
config/http_config.go:774
↓ 2 callers
Function
LoadTLSConfig
LoadTLSConfig parses the given file into a tls.Config.
config/tls_config_test.go:33
↓ 2 callers
Method
Name
Name returns the name of the alert. It is equivalent to the "alertname" label.
model/alert.go:45
↓ 2 callers
Function
Negotiate
Negotiate returns the Content-Type based on the given Accept header. If no appropriate accepted type is found, FmtText is returned (which is the Prome
expfmt/encode.go:83
↓ 2 callers
Function
NegotiateIncludingOpenMetrics
NegotiateIncludingOpenMetrics works like Negotiate but includes FmtOpenMetrics as an option for the result. Deprecated: Use NegotiateAccept(h, FmtOpe
expfmt/encode.go:92
↓ 2 callers
Function
NewFormat
NewFormat creates a new Format.
promslog/slog.go:124
↓ 2 callers
Function
NewHeadersRoundTripper
NewHeadersRoundTripper returns a RoundTripper that sets HTTP headers on requests as configured.
config/headers.go:98
↓ 2 callers
Function
NewNopLogger
NewNopLogger is a convenience function to return an slog.Logger that discards all log records.
promslog/slog.go:287
↓ 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:1785
↓ 2 callers
Function
NewUserAgentRoundTripper
NewUserAgentRoundTripper adds the user agent every request header.
config/http_config.go:1634
↓ 2 callers
Function
Now
Now returns the current time as a Time.
model/time.go:53
↓ 2 callers
Function
SerialNumber
()
config/generate.go:66
↓ 2 callers
Method
StatusAt
StatusAt returns the status of the alert at the given timestamp.
model/alert.go:83
↓ 2 callers
Function
TimeFromUnix
TimeFromUnix returns the Time equivalent to the Unix Time t provided in seconds.
model/time.go:59
↓ 2 callers
Function
UnescapeName
UnescapeName unescapes the incoming name according to the provided escaping scheme if possible. Some schemes are partially or totally non-roundtripabl
model/metric.go:473
↓ 2 callers
Method
UnmarshalJSON
UnmarshalJSON implements the json.Unmarshaler interface.
model/time.go:125
↓ 2 callers
Method
Validate
Validate validates the Headers config.
config/headers.go:73
↓ 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:391
↓ 2 callers
Function
WithDialContextFunc
WithDialContextFunc allows you to override the func gets used for the dialing. The default is `net.Dialer.DialContext`.
config/http_config.go:523
↓ 2 callers
Method
WithInstrumentation
WithInstrumentation returns a router with instrumentation support.
route/route.go:60
↓ 2 callers
Method
applyToHTTPClientOptions
(options *httpClientOptions)
config/http_config.go:512
↓ 2 callers
Function
containsRawNewline
(s string)
expfmt/openmetrics_2_0_create.go:376
↓ 2 callers
Function
extractSamples
(f *dto.MetricFamily, o *DecodeOptions)
expfmt/decode.go:220
↓ 2 callers
Method
getTLSDataWithHash
(ctx context.Context)
config/http_config.go:1532
↓ 2 callers
Method
immutable
()
config/http_config.go:1495
↓ 2 callers
Function
isDomainOrSubdomain
isDomainOrSubdomain reports whether sub is a subdomain (or exact match) of parent. It mirrors isDomainOrSubdomain from net/http/client.go.
config/http_config.go:1218
↓ 2 callers
Function
isEmptyNonNilURL
checks if u equals to &url.URL{}.
config/http_config_test.go:2241
↓ 2 callers
Function
isValidLabelNameContinuation
(b byte, quoted bool)
expfmt/text_parse.go:950
↓ 2 callers
Function
isValidLegacyRune
(b rune, i int)
model/metric.go:548
↓ 2 callers
Function
nonZeroCount
nonZeroCount returns the amount of values that are non-zero.
config/http_config.go:377
↓ 2 callers
Function
parseFloat
(s string)
expfmt/text_parse.go:1002
↓ 2 callers
Function
readFile
(t *testing.T, filename string)
config/http_config_test.go:2667
↓ 2 callers
Method
readTokenAsMetricName
readTokenAsMetricName copies a metric name from p.buf into p.currentToken. The first byte considered is the byte already read (now in p.currentByte).
expfmt/text_parse.go:767
↓ 2 callers
Method
reset
(in io.Reader)
expfmt/text_parse.go:172
↓ 2 callers
Method
roundTripperSettings
(secretManager SecretManager)
config/http_config.go:1406
↓ 2 callers
Method
skipBlankTabIfCurrentBlankTab
skipBlankTabIfCurrentBlankTab works exactly as skipBlankTab but doesn't do anything if p.currentByte is neither ' ' nor '\t'.
expfmt/text_parse.go:708
↓ 2 callers
Function
testDiscriminatorHTTPHeader
(t testing.TB)
expfmt/decode_test.go:429
↓ 2 callers
Function
testLabelNames
(t testing.TB)
model/labels_test.go:22
↓ 2 callers
Function
testLabelValues
(t testing.TB)
model/labels_test.go:58
↓ 2 callers
Function
testMetric
(t testing.TB)
model/metric_test.go:39
↓ 2 callers
Function
testTextParse
(t testing.TB)
expfmt/text_parse_test.go:45
↓ 2 callers
Function
testTextParseError
(t testing.TB)
expfmt/text_parse_test.go:1003
↓ 2 callers
Function
updateRootCA
updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs.
config/http_config.go:1464
↓ 2 callers
Method
usingClientCert
()
config/http_config.go:1398
↓ 2 callers
Method
usingClientKey
()
config/http_config.go:1402
↓ 2 callers
Function
validateLabels20
(labels []*dto.LabelPair)
expfmt/openmetrics_2_0_create.go:360
↓ 2 callers
Function
writeFloat
writeFloat is equivalent to fmt.Fprint with a float64 argument but hardcodes a few common cases for increased efficiency. For non-hardcoded cases, it
expfmt/text_create.go:476
↓ 2 callers
Function
writeInt
writeInt is equivalent to fmt.Fprint with an int64 argument but uses strconv.AppendInt with a byte slice taken from a sync.Pool to avoid allocations.
expfmt/text_create.go:502
↓ 2 callers
Function
writeOpenMetrics20Sample
writeOpenMetrics20Sample writes a single sample for simple types (Counter, Gauge, Untyped).
expfmt/openmetrics_2_0_create.go:213
↓ 2 callers
Function
writeOpenMetrics20Timestamp
writeOpenMetrics20Timestamp writes a float64 as a timestamp without scientific notation.
expfmt/openmetrics_2_0_create.go:335
↓ 2 callers
Function
writeUint
writeUint is like writeInt just for uint64.
expfmt/openmetrics_create.go:682
↓ 1 callers
Method
Clone
Clone returns a copy of the label set.
model/labelset.go:109
↓ 1 callers
Method
CloseIdleConnections
()
config/http_config.go:1615
↓ 1 callers
Method
Del
Del registers a new DELETE route.
route/route.go:103
↓ 1 callers
Function
EncodeKey
(w io.Writer, priv *rsa.PrivateKey)
config/generate.go:45
↓ 1 callers
Method
Equal
Equal returns true if both sets contain the same elements (and not more).
model/fingerprinting.go:67
↓ 1 callers
Method
Equal
(o *SampleHistogramPair)
model/value_histogram.go:177
↓ 1 callers
Function
ExtractSamples
ExtractSamples builds a slice of samples from the provided metric families. If an error occurs during sample extraction, it continues to extract from
expfmt/decode.go:204
↓ 1 callers
Method
FastFingerprint
FastFingerprint returns a Metric's Fingerprint calculated by a faster hashing algorithm, which is, however, more susceptible to hash collisions.
model/metric.go:298
↓ 1 callers
Function
FinalizeOpenMetrics
FinalizeOpenMetrics writes the final `# EOF\n` line required by OpenMetrics.
expfmt/openmetrics_create.go:387
↓ 1 callers
Function
FingerprintFromString
FingerprintFromString transforms a string representation into a Fingerprint.
model/fingerprinting.go:26
↓ 1 callers
Function
FloatToTime
(v float64)
helpers/templates/time.go:49
↓ 1 callers
Function
GenerateCertificate
(caCert *x509.Certificate, caKey *rsa.PrivateKey, server bool, name string, ipAddresses ...net.IP)
config/generate.go:117
↓ 1 callers
Function
GenerateCertificateAuthority
(commonName string, parentCert *x509.Certificate, parentKey *rsa.PrivateKey)
config/generate.go:75
↓ 1 callers
Method
HasFiring
HasFiring returns true iff one of the alerts is not resolved.
model/alert.go:127
↓ 1 callers
Method
HasFiringAt
HasFiringAt returns true iff one of the alerts is not resolved at the time ts.
model/alert.go:138
↓ 1 callers
Method
Intersection
Intersection returns the elements contained in both sets.
model/fingerprinting.go:82
↓ 1 callers
Function
IsValidMetricName
IsValidMetricName returns true iff name matches the pattern of MetricNameRE for legacy names, and iff it's valid UTF-8 if the UTF8Validation scheme is
model/metric.go:308
↓ 1 callers
Method
Level
Level returns the value of the logging level as an slog.Level.
promslog/slog.go:80
↓ 1 callers
Function
LoadHTTPConfig
LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.
config/http_config.go:309
↓ 1 callers
Method
MarshalJSON
MarshalJSON implements the json.Marshaler interface.
model/time.go:120
↓ 1 callers
Method
MarshalText
MarshalText implements the encoding.TextMarshaler interface.
model/time.go:353
↓ 1 callers
Method
Merge
Merge is a helper function to non-destructively merge two label sets.
model/labelset.go:116
↓ 1 callers
Method
Milliseconds
Milliseconds returns the duration as an integer millisecond count. Prometheus stores timestamps in milliseconds; time.Duration already covers the othe
model/time.go:193
↓ 1 callers
Function
New
(fs embed.FS)
assets/embed_gzip.go:32
↓ 1 callers
Function
NewBasicAuthRoundTripper
NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has already been set.
config/http_config.go:907
↓ 1 callers
Function
NewHostRoundTripper
NewHostRoundTripper sets the [http.Request.Host] of every request.
config/http_config.go:1639
↓ 1 callers
Function
NewOpenMetricsFormat
NewOpenMetricsFormat generates a new OpenMetrics format matching the specified version number. Note: OpenMetrics version 2.0.0 is experimental and en
expfmt/expfmt.go:117
↓ 1 callers
Function
NewRoundTripperFromConfigWithContext
NewRoundTripperFromConfigWithContext returns a new HTTP RoundTripper configured for the given config.HTTPClientConfig and config.HTTPClientOption. The
config/http_config.go:630
↓ 1 callers
Function
NewTLSConfigWithContext
NewTLSConfigWithContext creates a new tls.Config from the given TLSConfig.
config/http_config.go:1263
← previous
next →
101–200 of 697, ranked by callers