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
↓ 6 callers
Function
NewProcessCollector
NewProcessCollector is the obsolete version of collectors.NewProcessCollector. See there for documentation. Deprecated: Use collectors.NewProcessColl
prometheus/process_collector.go:62
↓ 6 callers
Function
NewProcessCollector
NewProcessCollector returns a collector which exports the current state of process metrics including CPU, memory and file descriptor usage as well as
prometheus/collectors/process_collector.go:49
↓ 6 callers
Function
WithGoCollectorRuntimeMetrics
WithGoCollectorRuntimeMetrics allows enabling and configuring particular group of runtime/metrics. See the list of metrics https://pkg.go.dev/runtime/
prometheus/collectors/go_collector_latest.go:102
↓ 6 callers
Function
addOptionalURLParams
(q url.Values, opts []Option)
api/prometheus/v1/api.go:1170
↓ 6 callers
Method
findBucket
findBucket returns the index of the bucket for the provided value, or len(h.upperBounds) for the +Inf bucket.
prometheus/histogram.go:870
↓ 6 callers
Function
observeWithExemplar
observeWithExemplar records val on obs. If labels is non-nil and obs implements [prometheus.ExemplarObserver], the exemplar is attached via ObserveWit
prometheus/promhttp/instrument_server.go:38
↓ 5 callers
Method
Add
Add adds the given value to the counter. It panics if the value is < 0.
prometheus/counter.go:44
↓ 5 callers
Function
ExponentialBuckets
ExponentialBuckets creates 'count' regular buckets, where the lowest bucket has an upper bound of 'start' and each following bucket's upper bound is '
prometheus/histogram.go:315
↓ 5 callers
Function
Handler
Handler returns an http.Handler for the prometheus.DefaultGatherer, using default HandlerOpts, i.e. it reports the first error as an HTTP error, it ha
prometheus/promhttp/http.go:209
↓ 5 callers
Method
Header
()
prometheus/promhttp/delegator_test.go:28
↓ 5 callers
Method
NewCounter
NewCounter works like the function of the same name in the prometheus package but it automatically registers the Counter with the Factory's Registerer
prometheus/promauto/auto.go:262
↓ 5 callers
Function
NewGaugeFunc
NewGaugeFunc creates a new GaugeFunc based on the provided GaugeOpts. The value reported is determined by calling the given function from within the W
prometheus/gauge.go:306
↓ 5 callers
Method
NewGaugeVec
NewGaugeVec creates a new GaugeVec based on the provided GaugeVecOpts.
prometheus/gauge.go:161
↓ 5 callers
Function
NewMetricVec
NewMetricVec returns an initialized metricVec.
prometheus/vec.go:47
↓ 5 callers
Method
QueryRange
QueryRange performs a query for the given range.
api/prometheus/v1/api.go:486
↓ 5 callers
Function
RuntimeMetricsToProm
RuntimeMetricsToProm produces a Prometheus metric name from a runtime/metrics metric description and validates whether the metric is suitable for inte
prometheus/internal/go_runtime_metrics.go:39
↓ 5 callers
Function
WithExemplarFromContext
WithExemplarFromContext allows you to inject a function that will get exemplar from context that will be put to counter and histogram metrics. If the
prometheus/promhttp/option.go:85
↓ 5 callers
Function
WithGoCollectorMemStatsMetricsDisabled
WithGoCollectorMemStatsMetricsDisabled disables metrics that is gathered in runtime.MemStats structure such as: go_memstats_alloc_bytes go_memstats_a
prometheus/collectors/go_collector_latest.go:84
↓ 5 callers
Method
WithLabelValues
WithLabelValues works as GetMetricWithLabelValues, but panics where GetMetricWithLabelValues would have returned an error. Not returning an error allo
prometheus/summary.go:651
↓ 5 callers
Method
WithLabelValues
WithLabelValues works as GetMetricWithLabelValues, but panics where GetMetricWithLabelValues would have returned an error. Not returning an error allo
prometheus/gauge.go:237
↓ 5 callers
Function
benchmarkMetricVecWithLabelValuesCardinality
(b *testing.B, nkeys, nvalues int)
prometheus/vec_test.go:942
↓ 5 callers
Function
populateMetric
( t ValueType, v float64, labelPairs []*dto.LabelPair, e *dto.Exemplar, m *dto.Metric, ct *timestamppb.T
prometheus/value.go:188
↓ 5 callers
Function
splitChars
(s string)
prometheus/internal/difflib_test.go:36
↓ 5 callers
Function
waitForCooldown
waitForCooldown returns after the count field in the provided histogramCounts has reached the provided count value.
prometheus/histogram.go:1646
↓ 4 callers
Method
Do
(*http.Request)
prometheus/push/push.go:65
↓ 4 callers
Method
GetOpCodes
Return list of 5-tuples describing how to turn a into b. Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple has i1 == j1 == 0, and rem
prometheus/internal/difflib.go:379
↓ 4 callers
Method
GetZeroCount
()
exp/api/remote/genproto/v2/types.pb.go:718
↓ 4 callers
Function
InstrumentHandlerResponseSize
InstrumentHandlerResponseSize is a middleware that wraps the provided http.Handler to observe the response size with the provided ObserverVec. The Obs
prometheus/promhttp/instrument_server.go:297
↓ 4 callers
Function
LinearBuckets
LinearBuckets creates 'count' regular buckets, each 'width' wide, where the lowest bucket has an upper bound of 'start'. The final +Inf bucket is not
prometheus/histogram.go:295
↓ 4 callers
Method
Lint
Lint performs a linting pass, returning a slice of Problems indicating any issues found in the metrics stream. The slice is sorted by metric name and
prometheus/testutil/promlint/promlint.go:67
↓ 4 callers
Method
MarshalToSizedBufferVT
(dAtA []byte)
exp/api/remote/remote_api.go:192
↓ 4 callers
Method
NewGauge
NewGauge works like the function of the same name in the prometheus package but it automatically registers the Gauge with the Factory's Registerer.
prometheus/promauto/auto.go:294
↓ 4 callers
Method
NewHistogramVec
NewHistogramVec creates a new HistogramVec based on the provided HistogramVecOpts.
prometheus/histogram.go:1191
↓ 4 callers
Function
NewInvalidDesc
NewInvalidDesc returns an invalid descriptor, i.e. a descriptor with the provided error set. If a collector returning such a descriptor is registered,
prometheus/desc.go:196
↓ 4 callers
Function
NewInvalidMetric
NewInvalidMetric returns a metric whose Write method always returns the provided error. It is useful if a Collector finds itself unable to collect a m
prometheus/metric.go:141
↓ 4 callers
Function
NewWriteResponse
NewWriteResponse creates a new WriteResponse with empty stats and status code http.StatusNoContent.
exp/api/remote/remote_headers.go:110
↓ 4 callers
Method
Ratio
Return a measure of the sequences' similarity (float in [0,1]). Where T is the total number of elements in both sequences, and M is the number of mat
prometheus/internal/difflib.go:473
↓ 4 callers
Function
Register
Register registers the provided Collector with the DefaultRegisterer. Register is a shortcut for DefaultRegisterer.Register(c). See there for more de
prometheus/registry.go:167
↓ 4 callers
Method
RoundTrip
RoundTrip implements the RoundTripper interface.
prometheus/promhttp/instrument_client.go:31
↓ 4 callers
Function
ScrapeAndCompare
ScrapeAndCompare calls a remote exporter's endpoint which is expected to return some metrics in plain text format. Then it compares it with the result
prometheus/testutil/testutil.go:166
↓ 4 callers
Method
SizeVT
()
exp/api/remote/remote_api.go:191
↓ 4 callers
Method
Status
()
prometheus/promhttp/delegator.go:34
↓ 4 callers
Method
Unregister
Unregister implements Registerer.
prometheus/registry.go:379
↓ 4 callers
Function
addToBucket
addToBucket increments the sparse bucket at key by the provided amount. It returns true if a new sparse bucket had to be created for that.
prometheus/histogram.go:1539
↓ 4 callers
Function
assetMetricAndExemplars
( t *testing.T, reg *prometheus.Registry, expectedNumMetrics int, expectedExemplar []*dto.LabelPair, )
prometheus/promhttp/instrument_client_test.go:118
↓ 4 callers
Function
benchmarkFindBucket
(b *testing.B, l int)
prometheus/histogram_test.go:1482
↓ 4 callers
Function
benchmarkHistogramObserve
(w int, b *testing.B)
prometheus/histogram_test.go:35
↓ 4 callers
Function
benchmarkHistogramWrite
(w int, b *testing.B)
prometheus/histogram_test.go:79
↓ 4 callers
Function
benchmarkSummaryObserve
(w int, b *testing.B)
prometheus/summary_test.go:107
↓ 4 callers
Function
benchmarkSummaryWrite
(w int, b *testing.B)
prometheus/summary_test.go:151
↓ 4 callers
Function
collectGoMetrics
(t *testing.T, opts internal.GoCollectorOptions)
prometheus/go_collector_latest_test.go:235
↓ 4 callers
Function
filterMetrics
(metrics []*dto.MetricFamily, names []string)
prometheus/testutil/testutil.go:323
↓ 4 callers
Function
getPIDFn
()
prometheus/get_pid.go:21
↓ 4 callers
Function
makeInconsistentCardinalityError
(fqName string, labels, labelValues []string)
prometheus/labels.go:139
↓ 4 callers
Function
makeInstrumentedClient
(opts ...Option)
prometheus/promhttp/instrument_client_test.go:34
↓ 4 callers
Method
processCollect
(ch chan<- Metric)
prometheus/process_collector_darwin.go:74
↓ 4 callers
Method
push
(ctx context.Context, method string)
prometheus/push/push.go:265
↓ 4 callers
Method
reportError
(ch chan<- Metric, desc *Desc, err error)
prometheus/process_collector.go:155
↓ 4 callers
Function
sanitizeMetricFamily
sanitizeMetricFamily is like sanitizeMetric, but for multiple metrics.
prometheus/utils_test.go:43
↓ 4 callers
Function
writeMetrics
(w io.Writer, mfs []*dto.MetricFamily, useTags bool, prefix string, now model.Time)
prometheus/graphite/bridge.go:190
↓ 3 callers
Method
Add
(val float64)
prometheus/gauge.go:123
↓ 3 callers
Method
AddWithExemplar
(value float64, exemplar Labels)
prometheus/counter.go:57
↓ 3 callers
Method
Append
Append appends the provided error if it is not nil.
prometheus/registry.go:245
↓ 3 callers
Method
Collector
Collector adds a Collector to the Pusher, from which metrics will be collected to push them to the Pushgateway. The collected metrics must not contain
prometheus/push/push.go:165
↓ 3 callers
Method
Dec
Dec decrements the Gauge by 1. Use Sub to decrement it by arbitrary values.
prometheus/gauge.go:43
↓ 3 callers
Function
DescribeByCollect
DescribeByCollect is a helper to implement the Describe method of a custom Collector. It collects the metrics from the provided Collector and sends th
prometheus/collector.go:87
↓ 3 callers
Method
GetGroupedOpCodes
Isolate change clusters by eliminating ranges with no changes. Return a generator of groups with up to n lines of context. Each group is in the same
prometheus/internal/difflib.go:419
↓ 3 callers
Method
GetMetricWithLabelValues
GetMetricWithLabelValues returns the Counter for the given slice of label values (same order as the variable labels in Desc). If that combination of l
prometheus/counter.go:250
↓ 3 callers
Function
InstrumentHandlerInFlight
InstrumentHandlerInFlight is a middleware that wraps the provided http.Handler. It sets the provided prometheus.Gauge to the number of requests curren
prometheus/promhttp/instrument_server.go:68
↓ 3 callers
Function
InstrumentMetricHandler
InstrumentMetricHandler is usually used with an http.Handler returned by the HandlerFor function. It instruments the provided http.Handler with two me
prometheus/promhttp/http.go:430
↓ 3 callers
Function
InstrumentRoundTripperCounter
InstrumentRoundTripperCounter is a middleware that wraps the provided http.RoundTripper to observe the request result with the provided CounterVec. Th
prometheus/promhttp/instrument_client.go:65
↓ 3 callers
Function
InstrumentRoundTripperDuration
InstrumentRoundTripperDuration is a middleware that wraps the provided http.RoundTripper to observe the request duration with the provided ObserverVec
prometheus/promhttp/instrument_client.go:108
↓ 3 callers
Function
InstrumentRoundTripperInFlight
InstrumentRoundTripperInFlight is a middleware that wraps the provided http.RoundTripper. It sets the provided prometheus.Gauge to the number of reque
prometheus/promhttp/instrument_client.go:40
↓ 3 callers
Method
MaybeUnwrap
MaybeUnwrap returns nil if len(errs) is 0. It returns the first and only contained error as error if len(errs is 1). In all other cases, it returns th
prometheus/registry.go:255
↓ 3 callers
Method
MustCurryWith
MustCurryWith works as CurryWith but panics where CurryWith would have returned an error.
prometheus/histogram.go:1306
↓ 3 callers
Function
MustNewConstHistogram
MustNewConstHistogram is a version of NewConstHistogram that panics where NewConstHistogram would have returned an error.
prometheus/histogram.go:1391
↓ 3 callers
Function
New
New creates a new Pusher to push to the provided URL with the provided job name (which must not be empty). You can use just host:port or ip:port as ur
prometheus/push/push.go:91
↓ 3 callers
Function
New
New creates a new Linter that reads an input stream of Prometheus metrics in the Prometheus text exposition format.
prometheus/testutil/promlint/promlint.go:42
↓ 3 callers
Function
NewCollector
NewCollector returns a collector that exports metrics about current version information.
prometheus/collectors/version/version.go:39
↓ 3 callers
Function
NewConstMetric
NewConstMetric returns a metric with one fixed value that cannot be changed. Users of this package will not have much use for it in regular operations
prometheus/value.go:105
↓ 3 callers
Function
NewMetricWithTimestamp
NewMetricWithTimestamp returns a new Metric wrapping the provided Metric in a way that it has an explicit timestamp set to the provided Time. This is
prometheus/metric.go:173
↓ 3 callers
Method
NewSummaryVec
NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts.
prometheus/summary.go:574
↓ 3 callers
Method
NextDelay
()
exp/internal/github.com/efficientgo/core/backoff/backoff.go:86
↓ 3 callers
Function
NormalizeMetricFamilies
NormalizeMetricFamilies returns a MetricFamily slice with empty MetricFamilies pruned and the remaining MetricFamilies sorted by name within the slice
prometheus/internal/metric.go:85
↓ 3 callers
Method
Push
Push pushes Prometheus metrics to the configured Graphite server.
prometheus/graphite/bridge.go:166
↓ 3 callers
Function
RuntimeMetricsBucketsForUnit
RuntimeMetricsBucketsForUnit takes a set of buckets obtained for a runtime/metrics histogram type (so, lower-bound inclusive) and a unit from a runtim
prometheus/internal/go_runtime_metrics.go:85
↓ 3 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
exp/api/remote/remote_api.go:569
↓ 3 callers
Method
SetStatusCode
SetStatusCode sets the HTTP status code for the response. http.StatusNoContent is the default unless 5xx is set.
exp/api/remote/remote_headers.go:124
↓ 3 callers
Method
SetToCurrentTime
SetToCurrentTime sets the Gauge to the current Unix time in seconds.
prometheus/gauge.go:52
↓ 3 callers
Function
SizeOfZigzag
SizeOfZigzag returns the size of the zigzag-encoded value.
exp/internal/github.com/planetscale/vtprotobuf/protohelpers/protohelpers.go:43
↓ 3 callers
Function
SplitLines
Split a string on "\n" while preserving them. The output can be used as input for UnifiedDiff and ContextDiff structures.
prometheus/internal/difflib.go:651
↓ 3 callers
Method
Stats
Stats returns the current statistics.
exp/api/remote/remote_headers.go:119
↓ 3 callers
Method
Store
Store stores remote write metrics encoded in the given WriteContentType. Provided http.Request contains the encoded bytes in the req.Body with all the
exp/api/remote/remote_api.go:415
↓ 3 callers
Method
Sub
Sub subtracts the given value from the Gauge. (The value can be negative, resulting in an increase of the Gauge.)
prometheus/gauge.go:49
↓ 3 callers
Method
Symbolize
Symbolize adds (if not added before) a string to the symbols table, while returning its reference number.
exp/api/remote/genproto/v2/symbols.go:50
↓ 3 callers
Function
ToTransactionalGatherer
ToTransactionalGatherer transforms Gatherer to transactional one with noop as done function.
prometheus/registry.go:1111
↓ 3 callers
Method
UnmarshalVT
(dAtA []byte)
exp/api/remote/genproto/v2/types_vtproto.pb.go:1406
↓ 3 callers
Method
Unregister
Unregister unregisters the Collector that equals the Collector passed in as an argument. (Two Collectors are considered equal if their Describe metho
prometheus/registry.go:133
↓ 3 callers
Method
With
With works as GetMetricWith, but panics where GetMetricWithLabels would have returned an error. Not returning an error allows shortcuts like myVec.W
prometheus/counter.go:295
↓ 3 callers
Method
With
With works as GetMetricWith, but panics where GetMetricWithLabels would have returned an error. Not returning an error allows shortcuts like myVec.W
prometheus/gauge.go:249
← previous
next →
101–200 of 1,308, ranked by callers