mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 22:37:27 -08:00
Merge pull request #134 from prometheus/fix/set-job-label-from-targets-api
Set job label for targets registered through the API
This commit is contained in:
commit
f817106d6a
|
@ -33,7 +33,9 @@ func (serv MetricsService) SetTargets(targetGroups []TargetGroup, jobName string
|
|||
newTargets := []retrieval.Target{}
|
||||
for _, targetGroup := range targetGroups {
|
||||
// Do mandatory map type conversion due to Go shortcomings.
|
||||
baseLabels := model.LabelSet{}
|
||||
baseLabels := model.LabelSet{
|
||||
model.LabelName("job"): model.LabelValue(job.Name),
|
||||
}
|
||||
for label, value := range targetGroup.BaseLabels {
|
||||
baseLabels[model.LabelName(label)] = model.LabelValue(value)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue