Skip to content

Commit f6e3560

Browse files
authored
Documented parameters to DropTargetLabels (#120)
The rationale was buried in a discussion thread in the original PR, and the reasoning isn't obvious until you understand exactly how Target.Labels and MonitoredResource are constructed: #15 (comment)
1 parent 6de434d commit f6e3560

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

retrieval/series_cache.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ func (c *seriesCache) refresh(ctx context.Context, ref uint64) error {
337337
return nil
338338
}
339339
// Remove target labels and __name__ label.
340+
// Stackdriver only accepts a limited amount of labels, so we choose to economize aggressively here. This should be OK
341+
// because we expect that the target.Labels will be redundant with the Stackdriver MonitoredResource, which is derived
342+
// from the target Labels and DiscoveredLabels.
340343
finalLabels := targets.DropTargetLabels(pkgLabels(entry.lset), target.Labels)
341344
for i, l := range finalLabels {
342345
if l.Name == "__name__" {

0 commit comments

Comments
 (0)