add version command and add build information to metrics

Signed-off-by: David Christofas <dchristofas@owncloud.com>
This commit is contained in:
David Christofas
2020-09-25 13:37:07 +02:00
parent ff8fc23ce5
commit 4f5531334f
10 changed files with 119 additions and 15 deletions
+5 -6
View File
@@ -6,7 +6,6 @@ import (
"github.com/owncloud/ocis/konnectd/pkg/crypto"
svc "github.com/owncloud/ocis/konnectd/pkg/service/v0"
"github.com/owncloud/ocis/konnectd/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/middleware"
"github.com/owncloud/ocis/ocis-pkg/service/http"
)
@@ -44,9 +43,9 @@ func Server(opts ...Option) (http.Service, error) {
service := http.NewService(
http.Logger(options.Logger),
http.Namespace(options.Config.HTTP.Namespace),
http.Name("konnectd"),
http.Version(version.String),
http.Namespace(options.Config.Service.Namespace),
http.Name(options.Config.Service.Name),
http.Version(options.Config.Service.Version),
http.Address(options.Config.HTTP.Addr),
http.Context(options.Context),
http.Flags(options.Flags...),
@@ -63,8 +62,8 @@ func Server(opts ...Option) (http.Service, error) {
middleware.Cors,
middleware.Secure,
middleware.Version(
"konnectd",
version.String,
options.Config.Service.Name,
options.Config.Service.Version,
),
middleware.Logger(
options.Logger,