(toEncode *dataToEncode)
| 207 | } |
| 208 | |
| 209 | func (s *LabelSynchronizer) prepare(toEncode *dataToEncode) error { |
| 210 | if toEncode.cardinality() == 0 { |
| 211 | return nil |
| 212 | } |
| 213 | |
| 214 | syncResp, err := s.grpcurl.Sync(s.generateSyncRequest(toEncode)) |
| 215 | if err != nil { |
| 216 | return errors.Wrap(err, "grpcurl.Sync") |
| 217 | } |
| 218 | eg := &errgroup.Group{} |
| 219 | common.AppendErrGroup(eg, s.addMetricNameCache, syncResp.GetMetricNames()) |
| 220 | common.AppendErrGroup(eg, s.addLabelNameCache, syncResp.GetLabelNames()) |
| 221 | common.AppendErrGroup(eg, s.addLabelValueCache, syncResp.GetLabelValues()) |
| 222 | common.AppendErrGroup(eg, s.addMetricAPPLabelLayoutCache, syncResp.GetMetricAppLabelLayouts()) |
| 223 | common.AppendErrGroup(eg, s.addLabelCache, syncResp.GetLabels()) |
| 224 | return eg.Wait() |
| 225 | } |
| 226 | |
| 227 | func (s *LabelSynchronizer) splitData(req *trident.PrometheusLabelRequest) *dataToEncode { |
| 228 | toEncode := newDataToEncode(s.cache) |
no test coverage detected