(app storage.Appender, hh []prompb.Histogram, labels labels.Labels)
| 236 | } |
| 237 | |
| 238 | func (h *writeHandler) appendV1Histograms(app storage.Appender, hh []prompb.Histogram, labels labels.Labels) error { |
| 239 | var err error |
| 240 | for _, hp := range hh { |
| 241 | if hp.IsFloatHistogram() { |
| 242 | _, err = app.AppendHistogram(0, labels, hp.Timestamp, nil, hp.ToFloatHistogram()) |
| 243 | } else { |
| 244 | _, err = app.AppendHistogram(0, labels, hp.Timestamp, hp.ToIntHistogram(), nil) |
| 245 | } |
| 246 | if err != nil { |
| 247 | // Although AppendHistogram does not currently return ErrDuplicateSampleForTimestamp there is |
| 248 | // a note indicating its inclusion in the future. |
| 249 | if errors.Is(err, storage.ErrOutOfOrderSample) || |
| 250 | errors.Is(err, storage.ErrOutOfBounds) || |
| 251 | errors.Is(err, storage.ErrDuplicateSampleForTimestamp) || |
| 252 | errors.Is(err, storage.ErrTooOldSample) { |
| 253 | h.logger.Error("Out of order histogram from remote write", "err", err.Error(), "series", labels.String(), "timestamp", hp.Timestamp) |
| 254 | } |
| 255 | return err |
| 256 | } |
| 257 | } |
| 258 | return nil |
| 259 | } |
| 260 | |
| 261 | // writeV2 is similar to write, but it works with v2 proto message, |
| 262 | // allows partial 4xx writes and gathers statistics. |
no test coverage detected