Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/prometheus/client_golang
/ functions
Functions
932 in github.com/prometheus/client_golang
⨍
Functions
932
◇
Types & classes
204
↓ 62 callers
Method
String
()
prometheus/desc.go:184
↓ 62 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
↓ 55 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
↓ 45 callers
Function
NewRegistry
NewRegistry creates a new vanilla Registry without any Collectors pre-registered.
prometheus/registry.go:67
↓ 44 callers
Method
Error
Error returns the error that was encountered.
prometheus/push/push.go:173
↓ 32 callers
Method
MustRegister
MustRegister implements Registerer.
prometheus/registry.go:402
↓ 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:78
↓ 32 callers
Method
Run
Run starts the event loop that pushes Prometheus metrics to Graphite at the configured interval.
prometheus/graphite/bridge.go:150
↓ 29 callers
Method
Set
Set sets the Gauge to an arbitrary value.
prometheus/gauge.go:37
↓ 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
↓ 28 callers
Method
Println
(v ...interface{})
prometheus/graphite/bridge.go:102
↓ 27 callers
Function
NewCounterVec
NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.
prometheus/counter.go:194
↓ 25 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
↓ 23 callers
Method
Inc
Inc increments the Gauge by 1. Use Add to increment it by arbitrary values.
prometheus/gauge.go:40
↓ 22 callers
Method
URL
(ep string, args map[string]string)
api/prometheus/v1/api.go:1345
↓ 21 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
↓ 21 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:501
↓ 19 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
Do
(context.Context, *http.Request)
api/prometheus/v1/api.go:1346
↓ 18 callers
Function
NewHistogramVec
NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and partitioned by the given label names.
prometheus/histogram.go:1118
↓ 18 callers
Method
Reset
Reset deletes all metrics in this vector.
prometheus/vec.go:130
↓ 17 callers
Method
Gather
Gather implements Gatherer.
prometheus/registry.go:411
↓ 17 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
↓ 16 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
↓ 16 callers
Method
ServeHTTP
(w http.ResponseWriter, req *http.Request)
api/client_test.go:124
↓ 16 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
↓ 16 callers
Method
WithLabelValues
WithLabelValues works as GetMetricWithLabelValues, but panics where GetMetricWithLabelValues would have returned an error. Not returning an error allo
prometheus/counter.go:281
↓ 15 callers
Function
NewGaugeVec
NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.
prometheus/gauge.go:152
↓ 14 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:107
↓ 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:182
↓ 14 callers
Method
Query
Query performs a query for the given time.
api/prometheus/v1/api.go:482
↓ 13 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:89
↓ 13 callers
Function
MustNewConstMetric
MustNewConstMetric is a version of NewConstMetric that panics where NewConstMetric would have returned an error.
prometheus/value.go:126
↓ 13 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
↓ 12 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
↓ 12 callers
Method
With
(Labels)
prometheus/observer.go:46
↓ 12 callers
Function
withBaseMetrics
(metricNames []string)
prometheus/collectors/go_collector_latest_test.go:132
↓ 11 callers
Method
MustCurryWith
(Labels)
prometheus/observer.go:49
↓ 11 callers
Method
WithLabelValues
(...string)
prometheus/observer.go:47
↓ 11 callers
Method
WriteHeader
(code int)
prometheus/promhttp/delegator.go:55
↓ 11 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
↓ 10 callers
Method
Inc
Inc increments the counter by 1. Use Add to increment it by arbitrary non-negative values.
prometheus/counter.go:41
↓ 10 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
↓ 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
NewClient
NewClient returns a new Client. It is safe to use the returned Client from multiple goroutines.
api/client.go:85
↓ 9 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:559
↓ 9 callers
Method
Register
Register implements Registerer.
prometheus/registry.go:270
↓ 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:311
↓ 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
GetMetricWithLabelValues
(lvs ...string)
prometheus/observer.go:45
↓ 8 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:135
↓ 8 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
↓ 8 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:869
↓ 8 callers
Function
NewMatcher
(a, b []string)
prometheus/internal/difflib.go:102
↓ 8 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
↓ 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
WithLabelValues
WithLabelValues works as GetMetricWithLabelValues, but panics where GetMetricWithLabelValues would have returned an error. Not returning an error allo
prometheus/histogram.go:1197
↓ 8 callers
Function
assertEqual
(t *testing.T, a, b interface{})
prometheus/internal/difflib_test.go:30
↓ 8 callers
Function
labels
(code, method bool, reqMethod string, status int, extraMethods ...string)
prometheus/promhttp/instrument_server.go:392
↓ 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:451
↓ 7 callers
Method
GetMetricWith
(Labels)
prometheus/observer.go:44
↓ 7 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:84
↓ 7 callers
Function
NewGoCollector
NewGoCollector is the obsolete version of collectors.NewGoCollector. See there for documentation. Deprecated: Use collectors.NewGoCollector instead.
prometheus/go_collector_go116.go:42
↓ 7 callers
Function
NewGoCollector
NewGoCollector returns a collector that exports metrics about the current Go process. This includes memory stats. To collect those, runtime.ReadMemSta
prometheus/collectors/go_collector_go116.go:47
↓ 7 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:254
↓ 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
Method
ObserveWithExemplar
(value float64, exemplar Labels)
prometheus/observer.go:63
↓ 7 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
↓ 7 callers
Method
apply
(*options)
prometheus/promhttp/option.go:24
↓ 7 callers
Function
defaultOptions
()
prometheus/promhttp/option.go:38
↓ 7 callers
Method
emptyDynamicLabels
()
prometheus/promhttp/option.go:45
↓ 7 callers
Function
formatTime
(t time.Time)
api/prometheus/v1/api.go:1456
↓ 7 callers
Function
newDelegator
(w http.ResponseWriter, observeWriteHeaderFunc func(int))
prometheus/promhttp/delegator.go:349
↓ 7 callers
Function
runTests
(t *testing.T, tests []test)
prometheus/testutil/promlint/promlint_test.go:773
↓ 6 callers
Function
CollectAndCompare
CollectAndCompare registers the provided Collector with a newly created pedantic Registry. It then calls GatherAndCompare with that Registry and with
prometheus/testutil/testutil.go:190
↓ 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
NewCounterVec
NewCounterVec creates a new CounterVec based on the provided CounterVecOpts.
prometheus/counter.go:202
↓ 6 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:92
↓ 6 callers
Function
WithGoCollectorRuntimeMetrics
WithGoCollectorRuntimeMetrics allows enabling and configuring particular group of runtime/metrics. See the list of metrics https://golang.bg/src/runti
prometheus/collectors/go_collector_latest.go:100
↓ 6 callers
Function
validateLabelValues
(vals []string, expectedNumberOfValues int)
prometheus/labels.go:166
↓ 5 callers
Method
DoGetFallback
(ctx context.Context, u *url.URL, args url.Values)
api/prometheus/v1/api.go:1347
↓ 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:77
↓ 5 callers
Method
NewGaugeVec
NewGaugeVec creates a new GaugeVec based on the provided GaugeVecOpts.
prometheus/gauge.go:160
↓ 5 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:162
↓ 5 callers
Function
NewMetricVec
NewMetricVec returns an initialized metricVec.
prometheus/vec.go:47
↓ 5 callers
Function
NewProcessCollector
NewProcessCollector is the obsolete version of collectors.NewProcessCollector. See there for documentation. Deprecated: Use collectors.NewProcessColl
prometheus/process_collector.go:60
↓ 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:82
↓ 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:643
↓ 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:235
↓ 5 callers
Function
benchmarkMetricVecWithLabelValuesCardinality
(b *testing.B, nkeys, nvalues int)
prometheus/vec_test.go:941
↓ 5 callers
Function
observeWithExemplar
observeWithExemplar is a wrapper for [prometheus.ExemplarAdder.ExemplarObserver], which falls back to [prometheus.Observer.Observe] if no labels are p
prometheus/promhttp/instrument_server.go:33
↓ 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:1538
↓ 4 callers
Method
Do
(*http.Request)
prometheus/push/push.go:65
↓ 4 callers
Method
Do
(context.Context, *http.Request)
api/client.go:79
↓ 4 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:309
↓ 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:378
next →
1–100 of 932, ranked by callers