Skip to content

Commit cb760ff

Browse files
committed
fix: correctly handle __raw_url__ by replacing url with it if present
1 parent 1a0135c commit cb760ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

output.go

+7
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,13 @@ func (ms *metricStore) RemoveLabels() {
415415
// High cardinality label. This is already present in logs.
416416
ts.tags = ts.tags.Without("error")
417417

418+
// Replace url with __raw_url__ if the latter is present. The agent sets this tag on multihttp checks to be the
419+
// user-specified URL, before interpolating variables in it.
420+
if rawURL, found := ts.tags.Get("__raw_url__"); found && rawURL != "" {
421+
log.Tracef("Overwriting url tag with __raw_url__ on %q", ts.name)
422+
ts.tags = ts.tags.Without("__raw_url__").With("url", rawURL)
423+
}
424+
418425
newStore[ts] = v
419426
}
420427

0 commit comments

Comments
 (0)