MCPcopy Create free account

hub / github.com/prometheus/client_golang / functions

Functions932 in github.com/prometheus/client_golang

↓ 4 callersMethodHeader
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 callersFunctionInstrumentHandlerResponseSize
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 callersFunctionLinearBuckets
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 callersMethodLint
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 callersFunctionNewGaugeFunc
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 callersFunctionNewGoCollector
NewGoCollector is the obsolete version of collectors.NewGoCollector. See there for documentation. Deprecated: Use collectors.NewGoCollector instead.
prometheus/go_collector_latest.go:165
↓ 4 callersMethodNewHistogramVec
NewHistogramVec creates a new HistogramVec based on the provided HistogramVecOpts.
prometheus/histogram.go:1126
↓ 4 callersFunctionNewProcessCollector
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 callersMethodQueryRange
QueryRange performs a query for the given range.
api/prometheus/v1/api.go:484
↓ 4 callersMethodRatio
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 callersFunctionRegister
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 callersMethodRoundTrip
RoundTrip implements the RoundTripper interface.
prometheus/promhttp/instrument_client.go:31
↓ 4 callersFunctionRuntimeMetricsToProm
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 callersFunctionScrapeAndCompare
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 callersFunctionSplitLines
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 callersMethodStatus
()
prometheus/promhttp/delegator.go:34
↓ 4 callersFunctionWithExemplarFromContext
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 callersFunctionaddToBucket
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 callersFunctionassetMetricAndExemplars
( t *testing.T, reg *prometheus.Registry, expectedNumMetrics int, expectedExemplar []*dto.LabelPair, )
prometheus/promhttp/instrument_client_test.go:118
↓ 4 callersFunctionbenchmarkHistogramObserve
(w int, b *testing.B)
prometheus/histogram_test.go:35
↓ 4 callersFunctionbenchmarkHistogramWrite
(w int, b *testing.B)
prometheus/histogram_test.go:79
↓ 4 callersFunctionbenchmarkSummaryObserve
(w int, b *testing.B)
prometheus/summary_test.go:107
↓ 4 callersFunctionbenchmarkSummaryWrite
(w int, b *testing.B)
prometheus/summary_test.go:151
↓ 4 callersFunctionmakeInconsistentCardinalityError
(fqName string, labels, labelValues []string)
prometheus/labels.go:139
↓ 4 callersFunctionmakeInstrumentedClient
(opts ...Option)
prometheus/promhttp/instrument_client_test.go:34
↓ 4 callersMethodpush
(ctx context.Context, method string)
prometheus/push/push.go:265
↓ 4 callersFunctionwriteMetrics
(w io.Writer, mfs []*dto.MetricFamily, useTags bool, prefix string, now model.Time)
prometheus/graphite/bridge.go:190
↓ 3 callersMethodAdd
(val float64)
prometheus/gauge.go:122
↓ 3 callersMethodAddWithExemplar
(value float64, exemplar Labels)
prometheus/counter.go:57
↓ 3 callersMethodCollector
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 callersMethodDec
Dec decrements the Gauge by 1. Use Sub to decrement it by arbitrary values.
prometheus/gauge.go:43
↓ 3 callersMethodFlush
()
prometheus/promhttp/delegator.go:92
↓ 3 callersMethodGetGroupedOpCodes
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 callersMethodGetMetricWithLabelValues
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 callersFunctionGetUnifiedDiffString
Like WriteUnifiedDiff but returns the diff a string.
prometheus/internal/difflib.go:642
↓ 3 callersFunctionHandlerForTransactional
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 callersFunctionInstrumentHandlerInFlight
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 callersFunctionInstrumentRoundTripperCounter
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 callersFunctionInstrumentRoundTripperDuration
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 callersFunctionInstrumentRoundTripperInFlight
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 callersMethodMaybeUnwrap
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 callersMethodMustCurryWith
MustCurryWith works as CurryWith but panics where CurryWith would have returned an error.
prometheus/histogram.go:1240
↓ 3 callersFunctionMustNewConstHistogram
MustNewConstHistogram is a version of NewConstHistogram that panics where NewConstHistogram would have returned an error.
prometheus/histogram.go:1325
↓ 3 callersFunctionNew
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 callersFunctionNew
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 callersFunctionNewConstMetric
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 callersMethodNewCounter
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 callersMethodNewGauge
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 callersFunctionNewInvalidMetric
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 callersMethodNewSummaryVec
NewSummaryVec creates a new SummaryVec based on the provided SummaryVecOpts.
prometheus/summary.go:567
↓ 3 callersFunctionNormalizeMetricFamilies
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 callersMethodPush
Push pushes Prometheus metrics to the configured Graphite server.
prometheus/graphite/bridge.go:166
↓ 3 callersFunctionRuntimeMetricsBucketsForUnit
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 callersMethodSetToCurrentTime
SetToCurrentTime sets the Gauge to the current Unix time in seconds.
prometheus/gauge.go:52
↓ 3 callersFunctionToTransactionalGatherer
ToTransactionalGatherer transforms Gatherer to transactional one with noop as done function.
prometheus/registry.go:1063
↓ 3 callersMethodUnregister
Unregister implements Registerer.
prometheus/registry.go:365
↓ 3 callersMethodWith
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 callersMethodWith
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 callersFunctionWithTimeout
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 callersMethodWrapHandler
WrapHandler wraps the given HTTP handler for instrumentation.
examples/middleware/httpmiddleware/httpmiddleware.go:28
↓ 3 callersFunctionaddAndResetCounts
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 callersFunctionbestEffortLookupRM
(lookup []string)
prometheus/go_collector_latest.go:81
↓ 3 callersFunctioncalculateRatio
(matches, length int)
prometheus/internal/difflib.go:42
↓ 3 callersFunctioncheckLabelName
(l string)
prometheus/labels.go:186
↓ 3 callersFunctioncheckLinesAreEqual
(w, g string, useTags bool)
prometheus/graphite/bridge_test.go:297
↓ 3 callersFunctioncollectGoMetrics
(t *testing.T, opts internal.GoCollectorOptions)
prometheus/go_collector_latest_test.go:225
↓ 3 callersMethodconstrain
(labelName, value string)
prometheus/labels.go:126
↓ 3 callersFunctionconstrainLabels
(desc *Desc, labels Labels)
prometheus/vec.go:665
↓ 3 callersFunctionexpectCTsForMetricVecValues
(t testing.TB, vec *MetricVec, typ dto.MetricType, ctsPerLabelValue map[string]time.Time)
prometheus/counter_test.go:358
↓ 3 callersFunctionfilterMetrics
(metrics []*dto.MetricFamily, names []string)
prometheus/testutil/testutil.go:347
↓ 3 callersFunctiongoRuntimeMemStats
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 callersFunctionmarshalFloat
(v float64, stream *json.Stream)
api/prometheus/v1/api.go:212
↓ 3 callersFunctionnewBaseGoCollector
()
prometheus/go_collector.go:216
↓ 3 callersFunctionnewExemplar
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 callersFunctionnewValueFunc
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 callersMethodobserve
observe is the implementation for Observe without the findBucket part.
prometheus/histogram.go:845
↓ 3 callersFunctionrep
(s string, count int)
prometheus/internal/difflib_test.go:150
↓ 3 callersMethodreportError
(ch chan<- Metric, desc *Desc, err error)
prometheus/process_collector.go:139
↓ 3 callersFunctionsanitizeMetric
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 callersFunctiontestCurryVec
(t *testing.T, vec *CounterVec)
prometheus/vec_test.go:505
↓ 3 callersFunctiontestDelete
(t *testing.T, vec *GaugeVec)
prometheus/vec_test.go:62
↓ 3 callersFunctiontestDeleteLabelValues
(t *testing.T, vec *GaugeVec)
prometheus/vec_test.go:130
↓ 3 callersFunctionwriteSanitized
(buf *bufio.Writer, s string)
prometheus/graphite/bridge.go:285
↓ 2 callersMethodAppend
Append appends the provided error if it is not nil.
prometheus/registry.go:232
↓ 2 callersFunctionCollectAndLint
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 callersFunctionDescribeByCollect
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 callersMethodDo
(ctx context.Context, req *http.Request)
api/prometheus/v1/api.go:1381
↓ 2 callersFunctionGatherAndCompare
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 callersMethodGatherer
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 callersMethodGetMatchingBlocks
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 callersMethodGetMetricWith
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 callersMethodGrouping
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 callersMethodHeader
()
prometheus/promhttp/instrument_server_test.go:483
↓ 2 callersFunctionInstrumentHandlerRequestSize
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 callersFunctionInstrumentMetricHandler
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 callersFunctionInstrumentRoundTripperTrace
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 callersFunctionMustNewConstSummary
MustNewConstSummary is a version of NewConstSummary that panics where NewConstMetric would have returned an error.
prometheus/summary.go:773
↓ 2 callersFunctionNewBridge
NewBridge returns a pointer to a new Bridge struct.
prometheus/graphite/bridge.go:106
↓ 2 callersFunctionNewBuildInfoCollector
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 callersFunctionNewConstMetricWithCreatedTimestamp
NewConstMetricWithCreatedTimestamp does the same thing as NewConstMetric, but generates Counters with created timestamp set and returns an error for o
prometheus/value.go:136
← previousnext →101–200 of 932, ranked by callers