Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/prometheus/client_golang
/ functions
Functions
1,308 in github.com/prometheus/client_golang
⨍
Functions
1,308
◇
Types & classes
274
↓ 3 callers
Function
WithLabelFromCtx
WithLabelFromCtx registers a label for dynamic resolution with access to context. See the example for ExampleInstrumentHandlerWithLabelResolver for ex
prometheus/promhttp/option.go:102
↓ 3 callers
Function
WithTimeout
WithTimeout can be used to provide an optional query evaluation timeout for Query and QueryRange. https://prometheus.io/docs/prometheus/latest/queryin
api/prometheus/v1/api.go:1138
↓ 3 callers
Method
WrapHandler
WrapHandler wraps the given HTTP handler for instrumentation.
examples/middleware/httpmiddleware/httpmiddleware.go:28
↓ 3 callers
Method
WriteHeader
(code int)
prometheus/promhttp/delegator.go:55
↓ 3 callers
Function
addAndResetCounts
addAndResetCounts adds certain fields (count, sum, conventional buckets, zero bucket) from the cold counts to the corresponding fields in the hot coun
prometheus/histogram.go:1673
↓ 3 callers
Function
addWithExemplar
addWithExemplar records val on c. If labels is non-nil and c implements [prometheus.ExemplarAdder], the exemplar is attached via AddWithExemplar; othe
prometheus/promhttp/instrument_server.go:53
↓ 3 callers
Function
bestEffortLookupRM
(lookup []string)
prometheus/go_collector_latest.go:82
↓ 3 callers
Function
calculateRatio
(matches, length int)
prometheus/internal/difflib.go:43
↓ 3 callers
Function
checkLabelName
(l string)
prometheus/labels.go:186
↓ 3 callers
Function
checkLinesAreEqual
(w, g string, useTags bool)
prometheus/graphite/bridge_test.go:298
↓ 3 callers
Method
constrain
(labelName, value string)
prometheus/labels.go:126
↓ 3 callers
Function
constrainLabels
(desc *Desc, labels Labels)
prometheus/vec.go:667
↓ 3 callers
Function
defaultCompressionFormats
()
prometheus/promhttp/http.go:70
↓ 3 callers
Function
defaultGoCollectorOptions
()
prometheus/go_collector_latest.go:150
↓ 3 callers
Method
describe
describe returns all descriptions of the collector for windows. Ensure that this list of descriptors is kept in sync with the metrics collected in the
prometheus/process_collector_windows.go:129
↓ 3 callers
Function
doubleDuration
(value, maxValue time.Duration)
exp/internal/github.com/efficientgo/core/backoff/backoff.go:108
↓ 3 callers
Function
expectCTsForMetricVecValues
(t testing.TB, vec *MetricVec, typ dto.MetricType, ctsPerLabelValue map[string]time.Time)
prometheus/counter_test.go:357
↓ 3 callers
Function
marshalFloat
(v float64, stream *json.Stream)
api/prometheus/v1/api.go:212
↓ 3 callers
Function
newExemplar
newExemplar creates a new dto.Exemplar from the provided values. An error is returned if any of the label names or values are invalid or if the total
prometheus/value.go:245
↓ 3 callers
Function
newValueFunc
newValueFunc returns a newly allocated valueFunc with the given Desc and ValueType. The value reported is determined by calling the given function fro
prometheus/value.go:79
↓ 3 callers
Method
observe
observe is the implementation for Observe without the findBucket part.
prometheus/histogram.go:904
↓ 3 callers
Function
rep
(s string, count int)
prometheus/internal/difflib_test.go:150
↓ 3 callers
Function
sanitizeMetric
sanitizeMetric injects expected fake created timestamp value "1970-01-01T00:00:10Z", so we can compare it in examples. It modifies metric in-place, th
prometheus/utils_test.go:29
↓ 3 callers
Function
testCurryVec
(t *testing.T, vec *CounterVec)
prometheus/vec_test.go:506
↓ 3 callers
Function
testDelete
(t *testing.T, vec *GaugeVec)
prometheus/vec_test.go:63
↓ 3 callers
Function
testDeleteLabelValues
(t *testing.T, vec *GaugeVec)
prometheus/vec_test.go:131
↓ 3 callers
Function
waitForRefs
waitForRefs blocks until cg reports at least want in-flight refs, failing the test if that does not happen within a short deadline. It must be called
prometheus/promhttp/http_test.go:1073
↓ 3 callers
Function
writeSanitized
(buf *bufio.Writer, s string)
prometheus/graphite/bridge.go:285
↓ 2 callers
Method
Client
Client sets a custom HTTP client for the Pusher. For convenience, this method returns a pointer to the Pusher itself. Pusher only needs one method of
prometheus/push/push.go:200
↓ 2 callers
Function
CollectAndLint
CollectAndLint registers the provided Collector with a newly created pedantic Registry. It then calls GatherAndLint with that Registry and with the pr
prometheus/testutil/lint.go:26
↓ 2 callers
Method
Descriptor
Deprecated: Use Sample.ProtoReflect.Descriptor instead.
exp/api/remote/genproto/v2/types.pb.go:466
↓ 2 callers
Method
Do
(ctx context.Context, req *http.Request)
api/prometheus/v1/api.go:1503
↓ 2 callers
Method
Enum
()
exp/api/remote/genproto/v2/types.pb.go:76
↓ 2 callers
Method
Err
Err returns the reason for terminating the backoff, or nil if it didn't terminate.
exp/internal/github.com/efficientgo/core/backoff/backoff.go:57
↓ 2 callers
Method
Gather
()
prometheus/promhttp/http.go:113
↓ 2 callers
Function
GatherAndCompare
GatherAndCompare gathers all metrics from the provided Gatherer and compares it to an expected output read from the provided Reader in the Prometheus
prometheus/testutil/testutil.go:211
↓ 2 callers
Method
Gatherer
Gatherer adds a Gatherer to the Pusher, from which metrics will be gathered to push them to the Pushgateway. The gathered metrics must not contain a j
prometheus/push/push.go:155
↓ 2 callers
Method
GetCount
()
exp/api/remote/genproto/v2/types.pb.go:676
↓ 2 callers
Method
GetMatchingBlocks
Return list of triples describing matching subsequences. Each triple is of the form (i, j, n), and means that a[i:i+n] == b[j:j+n]. The triples are
prometheus/internal/difflib.go:311
↓ 2 callers
Method
GetMetricWith
GetMetricWith returns the Counter for the given Labels map (the label names must match those of the variable labels in Desc). If that label map is acc
prometheus/counter.go:270
↓ 2 callers
Function
GetUnifiedDiffString
Like WriteUnifiedDiff but returns the diff a string.
prometheus/internal/difflib.go:643
↓ 2 callers
Method
Grouping
Grouping adds a label pair to the grouping key of the Pusher, replacing any previously added label pair with the same label name. Note that setting an
prometheus/push/push.go:183
↓ 2 callers
Function
InstrumentHandlerRequestSize
InstrumentHandlerRequestSize is a middleware that wraps the provided http.Handler to observe the request size with the provided ObserverVec. The Obser
prometheus/promhttp/instrument_server.go:243
↓ 2 callers
Function
InstrumentRoundTripperTrace
InstrumentRoundTripperTrace is a middleware that wraps the provided RoundTripper and reports times to hook functions provided in the InstrumentTrace s
prometheus/promhttp/instrument_client.go:165
↓ 2 callers
Method
MarshalToSizedBufferVT
(dAtA []byte)
exp/api/remote/genproto/v2/types_vtproto.pb.go:43
↓ 2 callers
Method
MarshalToSizedBufferVT
(dAtA []byte)
exp/api/remote/genproto/v2/types_vtproto.pb.go:97
↓ 2 callers
Method
MarshalToSizedBufferVT
(dAtA []byte)
exp/api/remote/genproto/v2/types_vtproto.pb.go:201
↓ 2 callers
Method
MarshalToSizedBufferVT
(dAtA []byte)
exp/api/remote/genproto/v2/types_vtproto.pb.go:265
↓ 2 callers
Method
MarshalToSizedBufferVT
(dAtA []byte)
exp/api/remote/genproto/v2/types_vtproto.pb.go:309
↓ 2 callers
Method
MarshalToSizedBufferVT
(dAtA []byte)
exp/api/remote/genproto/v2/types_vtproto.pb.go:357
↓ 2 callers
Method
MarshalToSizedBufferVT
(dAtA []byte)
exp/api/remote/genproto/v2/types_vtproto.pb.go:583
↓ 2 callers
Function
MustNewConstSummary
MustNewConstSummary is a version of NewConstSummary that panics where NewConstMetric would have returned an error.
prometheus/summary.go:781
↓ 2 callers
Function
MustNewMetricWithExemplars
MustNewMetricWithExemplars is a version of NewMetricWithExemplars that panics where NewMetricWithExemplars would have returned an error.
prometheus/metric.go:273
↓ 2 callers
Function
NegotiateContentEncoding
NegotiateContentEncoding returns the best offered content encoding for the request's Accept-Encoding header. If two offers match with equal weight and
internal/github.com/golang/gddo/httputil/negotiate.go:19
↓ 2 callers
Function
New
New creates a Backoff object. Pass a Context that can also terminate the operation.
exp/internal/github.com/efficientgo/core/backoff/backoff.go:34
↓ 2 callers
Function
NewBridge
NewBridge returns a pointer to a new Bridge struct.
prometheus/graphite/bridge.go:106
↓ 2 callers
Function
NewConstHistogramWithCreatedTimestamp
NewConstHistogramWithCreatedTimestamp does the same thing as NewConstHistogram but sets the created timestamp.
prometheus/histogram.go:1406
↓ 2 callers
Function
NewConstMetricWithCreatedTimestamp
NewConstMetricWithCreatedTimestamp does the same thing as NewConstMetric, but generates Counters with created timestamp set and returns an error for o
prometheus/value.go:136
↓ 2 callers
Function
NewConstNativeHistogram
NewConstNativeHistogram returns a metric representing a Prometheus native histogram with fixed values for the count, sum, and positive/negative/zero b
prometheus/histogram.go:1918
↓ 2 callers
Function
NewConstSummaryWithCreatedTimestamp
NewConstSummaryWithCreatedTimestamp does the same thing as NewConstSummary but sets the created timestamp.
prometheus/summary.go:796
↓ 2 callers
Method
NewCounterVec
NewCounterVec works like the function of the same name in the prometheus package but it automatically registers the CounterVec with the Factory's Regi
prometheus/promauto/auto.go:273
↓ 2 callers
Function
NewExpvarCollector
NewExpvarCollector is the obsolete version of collectors.NewExpvarCollector. See there for documentation. Deprecated: Use collectors.NewExpvarCollect
prometheus/expvar_collector.go:29
↓ 2 callers
Method
NewGaugeFunc
NewGaugeFunc works like the function of the same name in the prometheus package but it automatically registers the GaugeFunc with the Factory's Regist
prometheus/promauto/auto.go:316
↓ 2 callers
Method
NewHistogram
NewHistogram works like the function of the same name in the prometheus package but it automatically registers the Histogram with the Factory's Regist
prometheus/promauto/auto.go:348
↓ 2 callers
Method
NewHistogramVec
NewHistogramVec works like the function of the same name in the prometheus package but it automatically registers the HistogramVec with the Factory's
prometheus/promauto/auto.go:359
↓ 2 callers
Function
NewMetricWithExemplars
NewMetricWithExemplars returns a new Metric wrapping the provided Metric with given exemplars. Exemplars are validated. Only last applicable exemplar
prometheus/metric.go:247
↓ 2 callers
Function
NewWriteHandler
NewWriteHandler returns an HTTP handler that can receive the Remote Write 1.0 or Remote Write 2.0 (https://prometheus.io/docs/specs/remote_write_spec_
exp/api/remote/remote_api.go:513
↓ 2 callers
Method
Ongoing
Ongoing returns true if caller should keep going.
exp/internal/github.com/efficientgo/core/backoff/backoff.go:51
↓ 2 callers
Function
ParseAccept
ParseAccept parses Accept* headers.
internal/github.com/golang/gddo/httputil/header/header.go:64
↓ 2 callers
Function
ParseOptions
(args []string)
tutorials/whatsup/internal/common.go:102
↓ 2 callers
Method
Push
Push collects/gathers all metrics from all Collectors and Gatherers added to this Pusher. Then, it pushes them to the Pushgateway configured while cre
prometheus/push/push.go:125
↓ 2 callers
Method
QuickRatio
Return an upper bound on ratio() relatively quickly. This isn't defined beyond that it is an upper bound on .Ratio(), and is faster to compute.
prometheus/internal/difflib.go:485
↓ 2 callers
Method
RealQuickRatio
Return an upper bound on ratio() very quickly. This isn't defined beyond that it is an upper bound on .Ratio(), and is faster to compute than either
prometheus/internal/difflib.go:517
↓ 2 callers
Method
SetSeqs
Set two sequences to be compared.
prometheus/internal/difflib.go:118
↓ 2 callers
Method
SizeVT
()
exp/api/remote/genproto/v2/types_vtproto.pb.go:608
↓ 2 callers
Method
SizeVT
()
exp/api/remote/genproto/v2/types_vtproto.pb.go:630
↓ 2 callers
Method
SizeVT
()
exp/api/remote/genproto/v2/types_vtproto.pb.go:672
↓ 2 callers
Method
SizeVT
()
exp/api/remote/genproto/v2/types_vtproto.pb.go:695
↓ 2 callers
Method
SizeVT
()
exp/api/remote/genproto/v2/types_vtproto.pb.go:711
↓ 2 callers
Method
SizeVT
()
exp/api/remote/genproto/v2/types_vtproto.pb.go:730
↓ 2 callers
Method
SizeVT
()
exp/api/remote/genproto/v2/types_vtproto.pb.go:832
↓ 2 callers
Function
SnappyDecodeMiddleware
SnappyDecodeMiddleware returns a middleware that checks if the request body is snappy-encoded and decompresses it. If the request body is not snappy-e
exp/api/remote/remote_api.go:460
↓ 2 callers
Method
SymbolizeLabels
SymbolizeLabels symbolize Prometheus labels.
exp/api/remote/genproto/v2/symbols.go:61
↓ 2 callers
Method
UnmarshalJSON
(b []byte)
api/prometheus/v1/api.go:746
↓ 2 callers
Function
Unregister
Unregister removes the registration of the provided Collector from the DefaultRegisterer. Unregister is a shortcut for DefaultRegisterer.Unregister(c
prometheus/registry.go:185
↓ 2 callers
Method
Validate
Validate returns error if the given reference for the protobuf message is not supported.
exp/api/remote/remote_headers.go:58
↓ 2 callers
Function
WithWriteHandlerLogger
WithWriteHandlerLogger returns WriteHandlerOption that allows providing slog logger. By default, nothing is logged.
exp/api/remote/remote_api.go:434
↓ 2 callers
Function
WithoutGoCollectorRuntimeMetrics
WithoutGoCollectorRuntimeMetrics allows disabling group of runtime/metrics that you might have added in WithGoCollectorRuntimeMetrics. It behaves simi
prometheus/collectors/go_collector_latest.go:117
↓ 2 callers
Function
WrapCollectorWith
WrapCollectorWith returns a Collector wrapping the provided Collector. The wrapped Collector will add the provided Labels to all Metrics it collects (
prometheus/wrap.go:97
↓ 2 callers
Function
WrapRegistererWithPrefix
WrapRegistererWithPrefix returns a Registerer wrapping the provided Registerer. Collectors registered with the returned Registerer will be registered
prometheus/wrap.go:74
↓ 2 callers
Method
Write
(pb *dto.Metric)
prometheus/metric.go:183
↓ 2 callers
Method
WriteHeader
(int)
prometheus/promhttp/instrument_server_test.go:579
↓ 2 callers
Function
assertAlmostEqual
(t *testing.T, a, b float64, places int)
prometheus/internal/difflib_test.go:24
↓ 2 callers
Function
assertEqualMFs
(t *testing.T, wantMF, gotMF []*dto.MetricFamily)
prometheus/wrap_test.go:314
↓ 2 callers
Function
atomicAddFloat
atomicAddFloat adds the provided float atomically to another float represented by the bit pattern the bits pointer is pointing to.
prometheus/histogram.go:1654
↓ 2 callers
Function
benchmarkMetricVecWithLabelValues
(b *testing.B, labels map[string][]string)
prometheus/vec_test.go:980
↓ 2 callers
Function
benchmarkSplitLines
(b *testing.B, count int)
prometheus/internal/difflib_test.go:249
↓ 2 callers
Function
checkMetricConsistency
checkMetricConsistency checks if the provided Metric is consistent with the provided MetricFamily. It also hashes the Metric labels and the MetricFami
prometheus/registry.go:916
↓ 2 callers
Function
checkSuffixCollisions
checkSuffixCollisions checks for collisions with the “magic” suffixes the Prometheus text format and the internal metric representation of the Prometh
prometheus/registry.go:855
↓ 2 callers
Function
compareMetricFamilies
compareMetricFamilies would compare 2 slices of metric families, and optionally filters both of them to the `metricNames` provided.
prometheus/testutil/testutil.go:290
← previous
next →
201–300 of 1,308, ranked by callers