MCPcopy Create free account

hub / github.com/prometheus/common / functions

Functions800 in github.com/prometheus/common

↓ 93 callersMethodString
()
model/value_type.go:24
↓ 51 callersMethodEqual
Equal reports whether two Times represent the same instant.
model/time.go:70
↓ 50 callersMethodError
Error implements the error interface.
expfmt/text_parse.go:47
↓ 47 callersMethodGet
Get registers a new GET route.
route/route.go:93
↓ 32 callersMethodClose
()
expfmt/encode.go:98
↓ 26 callersFunctionNewClientFromConfig
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:604
↓ 25 callersMethodAdd
Add returns the Time t + d.
model/time.go:85
↓ 25 callersMethodWriteByte
(c byte)
expfmt/text_create.go:36
↓ 22 callersMethodWriteString
(s string)
expfmt/text_create.go:35
↓ 19 callersMethodSet
Set updates the logging level with the validation.
promslog/slog.go:101
↓ 14 callersFunctionLoadHTTPConfigFile
LoadHTTPConfigFile parses the given YAML file into a HTTPClientConfig.
config/http_config.go:317
↓ 14 callersMethodparseError
parseError sets p.err to a ParseError at the current line with the given message.
expfmt/text_parse.go:689
↓ 13 callersMethodFetch
(ctx context.Context)
config/http_config.go:771
↓ 13 callersMethodWithEscapingScheme
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:203
↓ 12 callersMethodDecode
(*dto.MetricFamily)
expfmt/decode.go:32
↓ 12 callersMethodIsValidMetricName
IsValidMetricName returns whether metricName is valid according to s.
model/metric.go:153
↓ 12 callersMethodLen
()
model/value.go:293
↓ 12 callersFunctionNewDecoder
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:103
↓ 11 callersMethodIsValid
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
↓ 10 callersMethodRedirect
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
↓ 10 callersMethodUnix
Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC.
model/time.go:101
↓ 9 callersMethodCloseIdleConnections
()
config/http_config.go:66
↓ 9 callersMethodEncode
(*dto.MetricFamily)
expfmt/encode.go:87
↓ 9 callersMethodPut
Put registers a new PUT route.
route/route.go:108
↓ 9 callersMethodServeHTTP
ServeHTTP implements http.Handler.
route/route.go:135
↓ 8 callersMethodIsValidLabelName
IsValidLabelName returns whether labelName is valid according to s.
model/metric.go:176
↓ 8 callersFunctionParseDuration
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 callersFunctionTimeFromUnixNano
TimeFromUnixNano returns the Time equivalent to the Unix Time t provided in nanoseconds.
model/time.go:65
↓ 8 callersFunctionparseOpenMetricsFloat
(s string)
expfmt/openmetrics_parse.go:1016
↓ 7 callersMethodBefore
Before reports whether the Time t is before o.
model/time.go:75
↓ 7 callersMethodClone
Clone returns a copy of the Metric.
model/metric.go:260
↓ 7 callersFunctionNegotiateAccept
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:140
↓ 7 callersFunctionNew
New returns a new Router.
route/route.go:53
↓ 7 callersFunctionNewEncoder
NewEncoder returns a new encoder based on content type negotiation. All Encoder implementations returned by NewEncoder also implement Closer, and call
expfmt/encode.go:232
↓ 7 callersMethodTextToMetricFamilies
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
↓ 7 callersFunctioncloneRequest
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:1238
↓ 7 callersMethodhandle
handle turns a HandlerFunc into an httprouter.Handle.
route/route.go:76
↓ 7 callersFunctionnewTestServer
(handler func(w http.ResponseWriter, r *http.Request))
config/http_config_test.go:146
↓ 7 callersFunctionwriteFloat
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
↓ 7 callersFunctionwriteOpenMetricsNameAndLabelPairs
writeOpenMetricsNameAndLabelPairs works like writeOpenMetricsSample but formats the float in OpenMetrics style.
expfmt/openmetrics_create.go:457
↓ 7 callersFunctionwriteUint
writeUint is like writeInt just for uint64.
expfmt/openmetrics_create.go:682
↓ 6 callersMethodFormatType
FormatType deduces an overall FormatType for the given format.
expfmt/expfmt.go:152
↓ 6 callersFunctionJoinDir
JoinDir joins dir and path if path is relative. If path is empty or absolute, it is returned unchanged.
config/config.go:75
↓ 6 callersFunctionNew
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 callersFunctionNewRoundTripperFromConfig
NewRoundTripperFromConfig returns a new HTTP RoundTripper configured for the given config.HTTPClientConfig and config.HTTPClientOption. The name is us
config/http_config.go:621
↓ 6 callersMethodRoundTrip
RoundTrip implements the http.RoundTrip interface.
config/http_config.go:1579
↓ 6 callersFunctionhashNew
hashNew initializes a new fnv64a hash value.
model/fnv.go:24
↓ 6 callersMethodskipBlankTab
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 callersFunctionwriteEscapedString
(w enhancedWriter, v string, includeDoubleQuote bool)
expfmt/text_create.go:466
↓ 6 callersFunctionwriteOpenMetricsFloat
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 callersFunctionLabelsToSignature
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
↓ 5 callersFunctionMetricFamilyToOpenMetrics
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
↓ 5 callersFunctionMetricFamilyToOpenMetrics20
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:47
↓ 5 callersFunctionMetricFamilyToText
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 callersFunctionNewLevel
NewLevel returns a new Level.
promslog/slog.go:58
↓ 5 callersFunctionNewTLSConfig
NewTLSConfig creates a new tls.Config from the given TLSConfig.
config/http_config.go:1262
↓ 5 callersFunctionNewTextParser
NewTextParser returns a new TextParser with the provided nameValidationScheme.
expfmt/text_parse.go:89
↓ 5 callersFunctionParam
Param returns param p for the context, or the empty string when param does not exist in context.
route/route.go:32
↓ 5 callersMethodString
()
model/time.go:294
↓ 5 callersMethodToEscapingScheme
ToEscapingScheme returns an EscapingScheme depending on the Format. IFF the Format contains an escaping=allow-utf-8 term, it will select NoEscaping. I
expfmt/expfmt.go:227
↓ 5 callersMethodUnmarshalJSON
([]byte)
model/util127_test.go:64
↓ 5 callersMethodValidate
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:1382
↓ 5 callersFunctionassertProtoEqual
(t *testing.T, want, got proto.Message, msgAndArgs ...any)
expfmt/openmetrics_parse_test.go:60
↓ 5 callersFunctiondecodeOpenMetrics20ToMap
(r io.Reader, format Format)
expfmt/openmetrics_2_0_parse_test.go:32
↓ 5 callersFunctiongenSampleHistogram
()
model/value_histogram_test.go:258
↓ 5 callersFunctionhashAdd
hashAdd adds a string to a fnv64a hash value, returning the updated hash.
model/fnv.go:29
↓ 5 callersFunctionhashAddByte
hashAddByte adds a byte to a fnv64a hash value, returning the updated hash.
model/fnv.go:38
↓ 5 callersFunctionunescapeOpenMetricsString
(s string)
expfmt/openmetrics_parse.go:1009
↓ 5 callersFunctionwriteName
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 callersFunctionwriteProtoTimestamp
(w enhancedWriter, ts *timestamppb.Timestamp)
expfmt/openmetrics_2_0_create.go:1165
↓ 4 callersMethodDecode
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:263
↓ 4 callersMethodFingerprint
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 callersFunctionIsValidLegacyMetricName
IsValidLegacyMetricName is similar to IsValidMetricName but always uses the legacy validation scheme regardless of the value of NameValidationScheme.
model/metric.go:319
↓ 4 callersFunctionNewInlineSecret
(text string)
config/http_config.go:780
↓ 4 callersFunctionNewOAuth2RoundTripper
NewOAuth2RoundTripper returns a round tripper that performs OAuth2 authentication. The opts variadic parameter accepts any HTTPClientOption (e.g. With
config/http_config.go:958
↓ 4 callersFunctionNow
Now returns the current time as a Time.
model/time.go:53
↓ 4 callersMethodResolvedAt
ResolvedAt returns true iff the activity interval ended before the given timestamp.
model/alert.go:70
↓ 4 callersMethodRoundTrip
(*http.Request)
config/http_config_test.go:1769
↓ 4 callersMethodUnixNano
UnixNano returns t as a Unix time, the number of nanoseconds elapsed since January 1, 1970 UTC.
model/time.go:107
↓ 4 callersMethodVersion
Version returns the version parameter without validating whether it is supported. It returns an empty string if the parameter is absent or the Content
expfmt/expfmt.go:143
↓ 4 callersFunctionWithSecretManager
WithSecretManager allows setting the secret manager.
config/http_config.go:590
↓ 4 callersFunctionbenchmarkLabelToSignature
(b *testing.B, l map[string]string, e uint64)
model/signature_test.go:191
↓ 4 callersFunctionbenchmarkMetricToFastFingerprint
(b *testing.B, ls LabelSet, e Fingerprint)
model/signature_test.go:237
↓ 4 callersFunctionbenchmarkMetricToFastFingerprintConc
(b *testing.B, ls LabelSet, e Fingerprint, concLevel int)
model/signature_test.go:278
↓ 4 callersFunctionbenchmarkMetricToFingerprint
(b *testing.B, ls LabelSet, e Fingerprint)
model/signature_test.go:214
↓ 4 callersMethodclose
()
config/http_config_test.go:1845
↓ 4 callersFunctiondecodeAllOpenMetrics
(t *testing.T, input string, format Format)
expfmt/openmetrics_parse_test.go:33
↓ 4 callersFunctiondecodeOpenMetricsErr
(input string, format Format)
expfmt/openmetrics_parse_test.go:50
↓ 4 callersFunctiongetCertificateBlobs
(t *testing.T)
config/http_config_test.go:1012
↓ 4 callersFunctionisBlankOrTab
(b byte)
expfmt/text_parse.go:962
↓ 4 callersFunctionisCrossHostRedirect
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:1158
↓ 4 callersFunctionlabelSetToFastFingerprint
labelSetToFastFingerprint works similar to labelSetToFingerprint but uses a faster and less allocation-heavy hash function, which is more susceptible
model/signature.go:78
↓ 4 callersFunctiontestV1V2Marshal
(t *testing.T, name string, v jsonv1.Marshaler)
model/util127_test.go:25
↓ 4 callersFunctiontoSecret
toSecret returns a SecretReader from one of the given sources, assuming exactly one or none of the sources are provided.
config/http_config.go:840
↓ 4 callersFunctionvalidateLabels20
(labels []*dto.LabelPair)
expfmt/openmetrics_2_0_create.go:1132
↓ 4 callersMethodvalidationScheme
()
expfmt/openmetrics_2_0_parse.go:241
↓ 4 callersMethodvalidationScheme
()
expfmt/openmetrics_parse.go:208
↓ 4 callersFunctionwriteCertificate
(bs map[string][]byte, src, dst string)
config/http_config_test.go:1033
↓ 4 callersFunctionwriteInt
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
↓ 4 callersFunctionwriteOpenMetrics20Timestamp
writeOpenMetrics20Timestamp writes a float64 as a timestamp without scientific notation.
expfmt/openmetrics_2_0_create.go:361
next →1–100 of 800, ranked by callers