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
↓ 79 callers
Method
Add
Add adds the given value to the Gauge. (The value can be negative, resulting in a decrease of the Gauge.)
prometheus/gauge.go:46
↓ 70 callers
Method
Write
Write encodes the Metric into a "Metric" Protocol Buffer data transmission object. Metric implementations must observe concurrency safety as reads of
prometheus/metric.go:54
↓ 61 callers
Function
NewRegistry
NewRegistry creates a new vanilla Registry without any Collectors pre-registered.
prometheus/registry.go:67
↓ 54 callers
Method
Error
Error returns the error that was encountered.
prometheus/push/push.go:173
↓ 52 callers
Method
String
()
prometheus/desc.go:211
↓ 46 callers
Method
MustRegister
MustRegister implements Registerer.
prometheus/registry.go:416
↓ 43 callers
Method
Run
Run starts the event loop that pushes Prometheus metrics to Graphite at the configured interval.
prometheus/graphite/bridge.go:150
↓ 40 callers
Method
Set
Set sets the Gauge to an arbitrary value.
prometheus/gauge.go:37
↓ 38 callers
Method
Println
(v ...any)
prometheus/graphite/bridge.go:102
↓ 32 callers
Function
NewCounter
NewCounter creates a new Counter based on the provided CounterOpts. The returned implementation also implements ExemplarAdder. It is safe to perform
prometheus/counter.go:87
↓ 32 callers
Function
NewDesc
NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc and will be reported on registration time. variableLabels and constLabel
prometheus/desc.go:90
↓ 30 callers
Method
Gather
Gather calls the Collect method of the registered Collectors and then gathers the collected metrics into a lexicographically sorted slice of uniquely
prometheus/registry.go:160
↓ 29 callers
Function
NewCounterVec
NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.
prometheus/counter.go:195
↓ 29 callers
Method
ServeHTTP
(w http.ResponseWriter, req *http.Request)
api/client_test.go:220
↓ 29 callers
Function
withBaseMetrics
(metricNames []string)
prometheus/collectors/go_collector_latest_test.go:199
↓ 28 callers
Method
Observe
Observe adds a single observation to the summary. Observations are usually positive or zero. Negative observations are accepted but prevent current ve
prometheus/summary.go:64
↓ 26 callers
Method
MustRegister
MustRegister works like Register but registers any number of Collectors and panics upon the first registration that causes an error.
prometheus/registry.go:119
↓ 26 callers
Function
NewHistogram
NewHistogram creates a new Histogram based on the provided HistogramOpts. It panics if the buckets in HistogramOpts are not in strictly increasing ord
prometheus/histogram.go:526
↓ 25 callers
Method
String
()
prometheus/collectors/gen_go_collector_set.go:181
↓ 24 callers
Method
Inc
Inc increments the Gauge by 1. Use Add to increment it by arbitrary values.
prometheus/gauge.go:40
↓ 24 callers
Function
NewGauge
NewGauge creates a new Gauge based on the provided GaugeOpts. The returned implementation is optimized for a fast Set method. If you have a choice fo
prometheus/gauge.go:78
↓ 24 callers
Method
URL
(ep string, args map[string]string)
api/prometheus/v1/api.go:1467
↓ 23 callers
Function
HandlerFor
HandlerFor returns an uninstrumented http.Handler for the provided Gatherer. The behavior of the Handler is defined by the provided HandlerOpts. Thus,
prometheus/promhttp/http.go:225
↓ 22 callers
Method
NewDesc
NewDesc allocates and initializes a new Desc. Errors are recorded in the Desc and will be reported on registration time. variableLabels and constLabel
prometheus/desc.go:104
↓ 22 callers
Function
NewPedanticRegistry
NewPedanticRegistry returns a registry that checks during collection if each collected Metric is consistent with its reported Desc, and if the Desc ha
prometheus/registry.go:85
↓ 20 callers
Method
Reset
Reset deletes all metrics in this vector.
prometheus/vec.go:130
↓ 20 callers
Function
WithUnit
WithUnit sets the unit for a Desc.
prometheus/desc.go:75
↓ 19 callers
Method
Do
(context.Context, *http.Request)
api/prometheus/v1/api.go:1468
↓ 19 callers
Method
Handle
(context.Context, slog.Record)
exp/api/remote/remote_api.go:129
↓ 19 callers
Function
NewHistogramVec
NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and partitioned by the given label names.
prometheus/histogram.go:1183
↓ 19 callers
Function
With
With creates a Factory using the provided Registerer for registration of the created Collectors. If the provided Registerer is nil, the returned Facto
prometheus/promauto/auto.go:258
↓ 18 callers
Method
Collect
Collect is called by the Prometheus registry when collecting metrics. The implementation sends each collected metric via the provided channel and retu
prometheus/collector.go:62
↓ 18 callers
Method
Query
Query performs a query for the given time.
api/prometheus/v1/api.go:484
↓ 18 callers
Method
Register
Register registers a new Collector to be included in metrics collection. It returns an error if the descriptors provided by the Collector are invalid
prometheus/registry.go:115
↓ 17 callers
Method
Contains
(mType WriteMessageType)
exp/api/remote/remote_headers.go:81
↓ 17 callers
Method
Gather
Gather implements Gatherer.
prometheus/registry.go:435
↓ 17 callers
Method
GetValue
()
exp/api/remote/genproto/v2/types.pb.go:470
↓ 17 callers
Function
MustNewConstMetric
MustNewConstMetric is a version of NewConstMetric that panics where NewConstMetric would have returned an error.
prometheus/value.go:126
↓ 17 callers
Method
Wait
Wait sleeps for the backoff time then increases the retry count and backoff time. Returns immediately if Context is terminated.
exp/internal/github.com/efficientgo/core/backoff/backoff.go:74
↓ 17 callers
Method
WithLabelValues
WithLabelValues works as GetMetricWithLabelValues, but panics where GetMetricWithLabelValues would have returned an error. Not returning an error allo
prometheus/counter.go:283
↓ 16 callers
Method
Desc
Desc returns the descriptor for the Metric. This method idempotently returns the same descriptor throughout the lifetime of the Metric. The returned d
prometheus/metric.go:39
↓ 16 callers
Function
NewGaugeVec
NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.
prometheus/gauge.go:153
↓ 15 callers
Function
BuildFQName
BuildFQName joins the given three name components by "_". Empty name components are ignored. If the name parameter itself is empty, an empty string is
prometheus/metric.go:110
↓ 15 callers
Method
Inc
Inc increments the counter by 1. Use Add to increment it by arbitrary non-negative values.
prometheus/counter.go:41
↓ 15 callers
Function
NewGoCollector
NewGoCollector returns a collector that exports metrics about the current Go process using debug.GCStats (base metrics) and runtime/metrics (both in M
prometheus/collectors/go_collector_latest.go:164
↓ 15 callers
Function
toNormalizedJSON
toNormalizedJSON removes fake random space from proto JSON original marshaller. It is required, so we can compare proto messages in json format. Read
prometheus/utils_test.go:53
↓ 14 callers
Function
MakeLabelPairs
MakeLabelPairs is a helper function to create protobuf LabelPairs from the variable and constant labels in the provided Desc. The values for the varia
prometheus/value.go:217
↓ 14 callers
Function
NewSummary
Problem with the sliding-window decay algorithm... The Merge method of perk/quantile is actually not working as advertised - and it might be unfixable
prometheus/summary.go:185
↓ 13 callers
Function
SizeOfVarint
SizeOfVarint returns the size of the varint-encoded value.
exp/internal/github.com/planetscale/vtprotobuf/protohelpers/protohelpers.go:38
↓ 12 callers
Function
NewClient
NewClient returns a new Client. It is safe to use the returned Client from multiple goroutines.
api/client.go:94
↓ 12 callers
Method
With
(Labels)
prometheus/observer.go:46
↓ 11 callers
Method
MustCurryWith
(Labels)
prometheus/observer.go:49
↓ 11 callers
Method
Observe
Observe adds a single observation to the histogram. Observations are usually positive or zero. Negative observations are accepted but prevent current
prometheus/histogram.go:260
↓ 11 callers
Method
String
()
exp/api/remote/remote_headers.go:77
↓ 11 callers
Method
WithLabelValues
(...string)
prometheus/observer.go:47
↓ 11 callers
Method
WriteHeader
(statusCode int)
prometheus/promhttp/delegator_test.go:36
↓ 10 callers
Function
NewSummaryVec
NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and partitioned by the given label names. Due to the way a Summary is repres
prometheus/summary.go:566
↓ 10 callers
Method
Strings
()
exp/api/remote/remote_headers.go:69
↓ 10 callers
Function
validateLabelValues
(vals []string, expectedNumberOfValues int)
prometheus/labels.go:166
↓ 9 callers
Method
Describe
Describe sends the super-set of all possible descriptors of metrics collected by this Collector to the provided channel and returns once the last desc
prometheus/collector.go:49
↓ 9 callers
Function
EncodeVarint
EncodeVarint encodes a uint64 into a varint-encoded byte slice and returns the offset of the encoded value. The provided offset is the offset after th
exp/internal/github.com/planetscale/vtprotobuf/protohelpers/protohelpers.go:25
↓ 9 callers
Function
HandlerForTransactional
HandlerForTransactional is like HandlerFor, but it uses transactional gather, which can safely change in-place returned *dto.MetricFamily before call
prometheus/promhttp/http.go:236
↓ 9 callers
Function
InstrumentHandlerCounter
InstrumentHandlerCounter is a middleware that wraps the provided http.Handler to observe the request result with the provided CounterVec. The CounterV
prometheus/promhttp/instrument_server.go:147
↓ 9 callers
Function
InstrumentHandlerDuration
InstrumentHandlerDuration is a middleware that wraps the provided http.Handler to observe the request duration with the provided ObserverVec. The Obse
prometheus/promhttp/instrument_server.go:96
↓ 9 callers
Function
MustRegister
MustRegister registers the provided Collectors with the DefaultRegisterer and panics if any error occurs. MustRegister is a shortcut for DefaultRegis
prometheus/registry.go:176
↓ 9 callers
Function
NewAPI
NewAPI returns a new API for the client. It is safe to use the returned API from multiple goroutines.
api/prometheus/v1/api.go:909
↓ 9 callers
Function
NewGoCollector
NewGoCollector is the obsolete version of collectors.NewGoCollector. See there for documentation. Deprecated: Use collectors.NewGoCollector instead.
prometheus/go_collector_latest.go:167
↓ 9 callers
Method
ObserveWithExemplar
(value float64, exemplar Labels)
prometheus/observer.go:63
↓ 9 callers
Function
checkLabels
checkLabels returns whether the provided Collector has a non-const, non-curried label named "code" and/or "method". It panics if the provided Collecto
prometheus/promhttp/instrument_server.go:323
↓ 9 callers
Function
file_io_prometheus_write_v2_types_proto_rawDescGZIP
()
exp/api/remote/genproto/v2/types.pb.go:1030
↓ 9 callers
Method
init
init provides the selfCollector with a reference to the metric it is supposed to collect. It is usually called within the factory function to create a
prometheus/collector.go:108
↓ 8 callers
Method
CurryWith
(Labels)
prometheus/observer.go:48
↓ 8 callers
Method
Do
(context.Context, *http.Request)
api/client.go:84
↓ 8 callers
Method
GetMetricWithLabelValues
(lvs ...string)
prometheus/observer.go:45
↓ 8 callers
Function
NewMatcher
(a, b []string)
prometheus/internal/difflib.go:103
↓ 8 callers
Function
NewTimer
NewTimer creates a new Timer. The provided Observer is used to observe a duration in seconds. If the Observer implements ExemplarObserver, passing exe
prometheus/timer.go:44
↓ 8 callers
Method
Register
Register implements Registerer.
prometheus/registry.go:283
↓ 8 callers
Method
WithLabelValues
WithLabelValues works as GetMetricWithLabelValues, but panics where GetMetricWithLabelValues would have returned an error. Not returning an error allo
prometheus/histogram.go:1263
↓ 8 callers
Function
WrapRegistererWith
WrapRegistererWith returns a Registerer wrapping the provided Registerer. Collectors registered with the returned Registerer will be registered with t
prometheus/wrap.go:46
↓ 8 callers
Function
assertEqual
(t *testing.T, a, b any)
prometheus/internal/difflib_test.go:30
↓ 8 callers
Function
labels
(code, method bool, reqMethod string, status int, extraMethods ...string)
prometheus/promhttp/instrument_server.go:404
↓ 8 callers
Function
runTests
(t *testing.T, tests []test)
prometheus/testutil/promlint/promlint_test.go:773
↓ 7 callers
Method
DeleteLabelValues
DeleteLabelValues removes the metric where the variable labels are the same as those passed in as labels (same order as the VariableLabels in Desc). I
prometheus/vec.go:74
↓ 7 callers
Method
Error
()
api/prometheus/v1/api.go:453
↓ 7 callers
Method
GetMetricWith
(Labels)
prometheus/observer.go:44
↓ 7 callers
Method
GetType
()
exp/api/remote/genproto/v2/types.pb.go:533
↓ 7 callers
Method
Header
Header sets a custom HTTP header for the Pusher's client. For convenience, this method returns a pointer to the Pusher itself.
prometheus/push/push.go:207
↓ 7 callers
Method
ObserveDuration
ObserveDuration records the duration passed since the Timer was created with NewTimer. It calls the Observe method of the Observer provided during con
prometheus/timer.go:59
↓ 7 callers
Function
Skip
Skip the first record of the byte slice and return the offset of the next record.
exp/internal/github.com/planetscale/vtprotobuf/protohelpers/protohelpers.go:48
↓ 7 callers
Method
apply
(*options)
prometheus/promhttp/option.go:25
↓ 7 callers
Function
defaultOptions
()
prometheus/promhttp/option.go:42
↓ 7 callers
Method
emptyDynamicLabels
()
prometheus/promhttp/option.go:49
↓ 7 callers
Function
formatTime
(t time.Time)
api/prometheus/v1/api.go:1578
↓ 7 callers
Function
newDelegator
(w http.ResponseWriter, observeWriteHeaderFunc func(int))
prometheus/promhttp/delegator.go:355
↓ 6 callers
Function
CollectAndCompare
CollectAndCompare collects the metrics identified by `metricNames` and compares them in the Prometheus text exposition format to the data read from ex
prometheus/testutil/testutil.go:196
↓ 6 callers
Method
Delete
Delete deletes the metric where the variable labels are the same as those passed in as labels. It returns true if a metric was deleted. It is not an
prometheus/vec.go:95
↓ 6 callers
Method
DoGetFallback
(ctx context.Context, u *url.URL, args url.Values)
api/prometheus/v1/api.go:1469
↓ 6 callers
Method
Err
Err returns an error that occurred during construction, if any. Calling this method is optional. It can be used to detect construction errors early,
prometheus/desc.go:207
↓ 6 callers
Method
Flush
()
prometheus/promhttp/delegator.go:98
↓ 6 callers
Method
NewCounterVec
NewCounterVec creates a new CounterVec based on the provided CounterVecOpts.
prometheus/counter.go:203
next →
1–100 of 1,308, ranked by callers