Skip to content

Commit

Permalink
promtail: Add ActiveTargets method (grafana#5839)
Browse files Browse the repository at this point in the history
* Add ActiveTargets method to promtail

* Update CHANGELOG
  • Loading branch information
marctc authored Apr 11, 2022
1 parent 1212423 commit 0315102
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

##### Changes
* [5686](https://github.com/grafana/loki/pull/5686) **ssncferreira**: Move promtail StreamLagLabels config to upper level config.Config
* [5839](https://github.com/grafana/loki/pull/5839) **marctc**: Add ActiveTargets method to promtail
#### Fluent Bit
* [5711](https://github.com/grafana/loki/pull/5711) **MichelHollands**: Update fluent-bit output name

Expand Down
6 changes: 6 additions & 0 deletions clients/pkg/promtail/promtail.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/grafana/loki/clients/pkg/promtail/config"
"github.com/grafana/loki/clients/pkg/promtail/server"
"github.com/grafana/loki/clients/pkg/promtail/targets"
"github.com/grafana/loki/clients/pkg/promtail/targets/target"

util_log "github.com/grafana/loki/pkg/util/log"
)
Expand Down Expand Up @@ -127,3 +128,8 @@ func (p *Promtail) Shutdown() {
// todo work out the stop.
p.client.Stop()
}

// ActiveTargets returns active targets per jobs from the target manager
func (p *Promtail) ActiveTargets() map[string][]target.Target {
return p.targetManagers.ActiveTargets()
}

0 comments on commit 0315102

Please sign in to comment.