Skip to content

Commit

Permalink
fix: regression, don't overwrite constLabels (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
burningalchemist authored Sep 20, 2023
1 parent 1eedd19 commit 2f6e229
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion target.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func NewTarget(
) {
if name != "" {
logContext = fmt.Sprintf("%s, target=%q", logContext, name)
constLabels = prometheus.Labels{"instance": name}
if constLabels == nil {
constLabels = prometheus.Labels{"instance": name}
}
}

constLabelPairs := make([]*dto.LabelPair, 0, len(constLabels))
Expand Down

0 comments on commit 2f6e229

Please sign in to comment.