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
↓ 4 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
↓ 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:285
↓ 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:289
↓ 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
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:304
↓ 4 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:165
↓ 4 callers
Method
NewHistogramVec
NewHistogramVec creates a new HistogramVec based on the provided HistogramVecOpts.
prometheus/histogram.go:1126
↓ 4 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
↓ 4 callers
Method
QueryRange
QueryRange performs a query for the given range.
api/prometheus/v1/api.go:484
↓ 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:472
↓ 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
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
↓ 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:162
↓ 4 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:650
↓ 4 callers
Method
Status
()
prometheus/promhttp/delegator.go:34
↓ 4 callers
Function
WithExemplarFromContext
WithExemplarFromContext allows to inject function that will get exemplar from context that will be put to counter and histogram metrics. If the functi
prometheus/promhttp/option.go:72
↓ 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:1431
↓ 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
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
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
push
(ctx context.Context, method string)
prometheus/push/push.go:265
↓ 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:122
↓ 3 callers
Method
AddWithExemplar
(value float64, exemplar Labels)
prometheus/counter.go:57
↓ 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
Method
Flush
()
prometheus/promhttp/delegator.go:92
↓ 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:418
↓ 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:248
↓ 3 callers
Function
GetUnifiedDiffString
Like WriteUnifiedDiff but returns the diff a string.
prometheus/internal/difflib.go:642
↓ 3 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:96
↓ 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:56
↓ 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:242
↓ 3 callers
Method
MustCurryWith
MustCurryWith works as CurryWith but panics where CurryWith would have returned an error.
prometheus/histogram.go:1240
↓ 3 callers
Function
MustNewConstHistogram
MustNewConstHistogram is a version of NewConstHistogram that panics where NewConstHistogram would have returned an error.
prometheus/histogram.go:1325
↓ 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
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
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
↓ 3 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
↓ 3 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:130
↓ 3 callers
Method
NewSummaryVec
NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts.
prometheus/summary.go:567
↓ 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:84
↓ 3 callers
Method
SetToCurrentTime
SetToCurrentTime sets the Gauge to the current Unix time in seconds.
prometheus/gauge.go:52
↓ 3 callers
Function
ToTransactionalGatherer
ToTransactionalGatherer transforms Gatherer to transactional one with noop as done function.
prometheus/registry.go:1063
↓ 3 callers
Method
Unregister
Unregister implements Registerer.
prometheus/registry.go:365
↓ 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:293
↓ 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:247
↓ 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:1085
↓ 3 callers
Method
WrapHandler
WrapHandler wraps the given HTTP handler for instrumentation.
examples/middleware/httpmiddleware/httpmiddleware.go:28
↓ 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:1565
↓ 3 callers
Function
bestEffortLookupRM
(lookup []string)
prometheus/go_collector_latest.go:81
↓ 3 callers
Function
calculateRatio
(matches, length int)
prometheus/internal/difflib.go:42
↓ 3 callers
Function
checkLabelName
(l string)
prometheus/labels.go:186
↓ 3 callers
Function
checkLinesAreEqual
(w, g string, useTags bool)
prometheus/graphite/bridge_test.go:297
↓ 3 callers
Function
collectGoMetrics
(t *testing.T, opts internal.GoCollectorOptions)
prometheus/go_collector_latest_test.go:225
↓ 3 callers
Method
constrain
(labelName, value string)
prometheus/labels.go:126
↓ 3 callers
Function
constrainLabels
(desc *Desc, labels Labels)
prometheus/vec.go:665
↓ 3 callers
Function
expectCTsForMetricVecValues
(t testing.TB, vec *MetricVec, typ dto.MetricType, ctsPerLabelValue map[string]time.Time)
prometheus/counter_test.go:358
↓ 3 callers
Function
filterMetrics
(metrics []*dto.MetricFamily, names []string)
prometheus/testutil/testutil.go:347
↓ 3 callers
Function
goRuntimeMemStats
goRuntimeMemStats provides the metrics initially provided by runtime.ReadMemStats. From Go 1.17 those similar (and better) statistics are provided by
prometheus/go_collector.go:26
↓ 3 callers
Function
marshalFloat
(v float64, stream *json.Stream)
api/prometheus/v1/api.go:212
↓ 3 callers
Function
newBaseGoCollector
()
prometheus/go_collector.go:216
↓ 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:845
↓ 3 callers
Function
rep
(s string, count int)
prometheus/internal/difflib_test.go:150
↓ 3 callers
Method
reportError
(ch chan<- Metric, desc *Desc, err error)
prometheus/process_collector.go:139
↓ 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:505
↓ 3 callers
Function
testDelete
(t *testing.T, vec *GaugeVec)
prometheus/vec_test.go:62
↓ 3 callers
Function
testDeleteLabelValues
(t *testing.T, vec *GaugeVec)
prometheus/vec_test.go:130
↓ 3 callers
Function
writeSanitized
(buf *bufio.Writer, s string)
prometheus/graphite/bridge.go:285
↓ 2 callers
Method
Append
Append appends the provided error if it is not nil.
prometheus/registry.go:232
↓ 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
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
↓ 2 callers
Method
Do
(ctx context.Context, req *http.Request)
api/prometheus/v1/api.go:1381
↓ 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:202
↓ 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
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:310
↓ 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:268
↓ 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
Method
Header
()
prometheus/promhttp/instrument_server_test.go:483
↓ 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:231
↓ 2 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:247
↓ 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
Function
MustNewConstSummary
MustNewConstSummary is a version of NewConstSummary that panics where NewConstMetric would have returned an error.
prometheus/summary.go:773
↓ 2 callers
Function
NewBridge
NewBridge returns a pointer to a new Bridge struct.
prometheus/graphite/bridge.go:106
↓ 2 callers
Function
NewBuildInfoCollector
NewBuildInfoCollector returns a collector collecting a single metric "go_build_info" with the constant value 1 and three labels "path", "version", and
prometheus/collectors/collectors.go:37
↓ 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
← previous
next →
101–200 of 932, ranked by callers