MCPcopy
hub / github.com/prometheus/client_golang / Write

Method Write

prometheus/metric.go:54–54  ·  prometheus/metric.go::Metric.Write

Write encodes the Metric into a "Metric" Protocol Buffer data transmission object. Metric implementations must observe concurrency safety as reads of this metric may occur at any time, and any blocking occurs at the expense of total performance of rendering all registered metrics. Ideally, Metric i

(*dto.Metric)

Source from the content-addressed store, hash-verified

52 // recommended to sort labels lexicographically. Callers of Write should
53 // still make sure of sorting if they depend on it.
54 Write(*dto.Metric) error
55 // TODO(beorn7): The original rationale of passing in a pre-allocated
56 // dto.Metric protobuf to save allocations has disappeared. The
57 // signature of this method should be changed to "Write() (*dto.Metric,

Callers 15

TestGoCollectorGCFunction · 0.65
TestTimerObserveFunction · 0.65
TestTimerByOutcomeFunction · 0.65
benchmarkSummaryWriteFunction · 0.65
TestSummaryConcurrencyFunction · 0.65

Implementers 14

valueFuncprometheus/value.go
constMetricprometheus/value.go
batchHistogramprometheus/go_collector_latest.go
wrappingMetricprometheus/wrap.go
counterprometheus/counter.go
Infoprometheus/example_metricvec_test.go
invalidMetricprometheus/metric.go
histogramprometheus/histogram.go
constHistogramprometheus/histogram.go
constNativeHistogramprometheus/histogram.go
summaryprometheus/summary.go
noObjectivesSummaryprometheus/summary.go

Calls

no outgoing calls

Tested by 15

TestGoCollectorGCFunction · 0.52
TestTimerObserveFunction · 0.52
TestTimerByOutcomeFunction · 0.52
benchmarkSummaryWriteFunction · 0.52
TestSummaryConcurrencyFunction · 0.52