(userID string, labels []cortexpb.LabelAdapter)
| 554 | } |
| 555 | |
| 556 | func (d *Distributor) tokenForLabels(userID string, labels []cortexpb.LabelAdapter) (uint32, error) { |
| 557 | if d.cfg.ShardByAllLabels { |
| 558 | return shardByAllLabels(userID, labels), nil |
| 559 | } |
| 560 | |
| 561 | unsafeMetricName, err := extract.UnsafeMetricNameFromLabelAdapters(labels) |
| 562 | if err != nil { |
| 563 | return 0, err |
| 564 | } |
| 565 | return shardByMetricName(userID, unsafeMetricName), nil |
| 566 | } |
| 567 | |
| 568 | func (d *Distributor) tokenForMetadata(userID string, metricName string) uint32 { |
| 569 | if d.cfg.ShardByAllLabels { |
no test coverage detected