add auther for metrics

This commit is contained in:
ginuerzh
2023-10-09 21:30:43 +08:00
parent 2ea7dc250a
commit c1d9228eee
3 changed files with 32 additions and 108 deletions

View File

@ -209,8 +209,13 @@ func buildAPIService(cfg *config.APIConfig) (service.Service, error) {
}
func buildMetricsService(cfg *config.MetricsConfig) (service.Service, error) {
auther := auth_parser.ParseAutherFromAuth(cfg.Auth)
if cfg.Auther != "" {
auther = registry.AutherRegistry().Get(cfg.Auther)
}
return metrics.NewService(
cfg.Addr,
metrics.PathOption(cfg.Path),
metrics.AutherOption(auther),
)
}