MCPcopy Index your code
hub / github.com/prometheus/prometheus / EncodeReadResponse

Function EncodeReadResponse

storage/remote/codec.go:92–101  ·  view source on GitHub ↗

EncodeReadResponse writes a remote.Response to a http.ResponseWriter.

(resp *prompb.ReadResponse, w http.ResponseWriter)

Source from the content-addressed store, hash-verified

90
91// EncodeReadResponse writes a remote.Response to a http.ResponseWriter.
92func EncodeReadResponse(resp *prompb.ReadResponse, w http.ResponseWriter) error {
93 data, err := proto.Marshal(resp)
94 if err != nil {
95 return err
96 }
97
98 compressed := snappy.Encode(nil, data)
99 _, err = w.Write(compressed)
100 return err
101}
102
103// ToQuery builds a Query proto.
104func ToQuery(from, to int64, matchers []*labels.Matcher, hints *storage.SelectHints) (*prompb.Query, error) {

Callers 2

setupRemoteFunction · 0.92
remoteReadSamplesMethod · 0.85

Calls 3

EncodeMethod · 0.65
WriteMethod · 0.65
MarshalMethod · 0.45

Tested by 1

setupRemoteFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…