Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ func (p *Prometheus) Use(e *gin.Engine) {
p.SetMetricsPath(e)
}

// GetListenAddress returns current listenAddress
func (p *Prometheus) GetListenAddress() string {
return p.listenAddress
}

// GetRouter returns current gin router
func (p *Prometheus) GetRouter() *gin.Engine {
return p.router
}

// UseWithAuth adds the middleware to a gin engine with BasicAuth.
func (p *Prometheus) UseWithAuth(e *gin.Engine, accounts gin.Accounts) {
e.Use(p.HandlerFunc())
Expand Down