Skip to content

Commit

Permalink
Merge pull request #469 from elisasre/feat/csappend
Browse files Browse the repository at this point in the history
append collectors
  • Loading branch information
zetaab authored Dec 18, 2024
2 parents e2f3bf3 + 6401d7e commit 803e0e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions v2/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func New(cs ...prometheus.Collector) *Prometheus {
}
}

func (p *Prometheus) AppendCollectors(cs ...prometheus.Collector) {
p.cs = append(p.cs, cs...)
}

// NewPrometheus creates registers collectors and starts metrics server.
func NewPrometheus(port int, cs ...prometheus.Collector) (*Prometheus, error) {
p := New(cs...)
Expand Down

0 comments on commit 803e0e5

Please sign in to comment.