(req *cortexpb.WriteRequest, limits *validation.Limits, userID string, firstPartialErr error)
| 998 | } |
| 999 | |
| 1000 | func (d *Distributor) prepareMetadataKeys(req *cortexpb.WriteRequest, limits *validation.Limits, userID string, firstPartialErr error) ([]uint32, []*cortexpb.MetricMetadata, error) { |
| 1001 | validatedMetadata := make([]*cortexpb.MetricMetadata, 0, len(req.Metadata)) |
| 1002 | metadataKeys := make([]uint32, 0, len(req.Metadata)) |
| 1003 | |
| 1004 | for _, m := range req.Metadata { |
| 1005 | err := validation.ValidateMetadata(d.validateMetrics, limits, userID, m) |
| 1006 | |
| 1007 | if err != nil { |
| 1008 | if firstPartialErr == nil { |
| 1009 | firstPartialErr = err |
| 1010 | } |
| 1011 | |
| 1012 | continue |
| 1013 | } |
| 1014 | |
| 1015 | metadataKeys = append(metadataKeys, d.tokenForMetadata(userID, m.MetricFamilyName)) |
| 1016 | validatedMetadata = append(validatedMetadata, m) |
| 1017 | } |
| 1018 | return metadataKeys, validatedMetadata, firstPartialErr |
| 1019 | } |
| 1020 | |
| 1021 | type samplesLabelSetEntry struct { |
| 1022 | floatSamples int64 |
no test coverage detected