feat(metrics): Adding initial support for prometheus metrics (#1176)

* feat(metrics): Adding initial support for prometheus metrics

* Fixing CI

* run go mod tidy
This commit is contained in:
Jesús Espino 2023-10-17 18:22:53 +02:00 committed by GitHub
parent 3f3162e57c
commit e91f660eb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 172 additions and 26 deletions

View file

@ -7,6 +7,7 @@ import (
"github.com/go-skynet/LocalAI/pkg/gallery"
model "github.com/go-skynet/LocalAI/pkg/model"
"github.com/go-skynet/LocalAI/metrics"
"github.com/rs/zerolog/log"
)
@ -24,6 +25,7 @@ type Option struct {
PreloadModelsFromPath string
CORSAllowOrigins string
ApiKeys []string
Metrics *metrics.Metrics
Galleries []gallery.Gallery
@ -198,3 +200,9 @@ func WithApiKeys(apiKeys []string) AppOption {
o.ApiKeys = apiKeys
}
}
func WithMetrics(meter *metrics.Metrics) AppOption {
return func(o *Option) {
o.Metrics = meter
}
}