From 318ca21645b2668e14b31d6f089cb4d5b82cc4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 14 Jan 2025 16:09:51 +0100 Subject: [PATCH] metrics, log and supervisor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- opencloud/pkg/runtime/service/service.go | 2 +- pkg/crypto/templates.go | 2 +- pkg/log/option.go | 2 +- services/activitylog/pkg/metrics/metrics.go | 2 +- services/app-provider/pkg/revaconfig/config.go | 2 +- services/app-registry/pkg/revaconfig/config.go | 2 +- services/auth-app/pkg/revaconfig/config.go | 2 +- services/auth-basic/pkg/revaconfig/config.go | 2 +- services/auth-bearer/pkg/revaconfig/config.go | 2 +- services/auth-machine/pkg/revaconfig/config.go | 2 +- services/auth-service/pkg/revaconfig/config.go | 2 +- services/clientlog/pkg/metrics/metrics.go | 2 +- services/eventhistory/pkg/metrics/metrics.go | 2 +- services/frontend/pkg/revaconfig/config.go | 2 +- services/gateway/pkg/revaconfig/config.go | 2 +- services/graph/pkg/metrics/metrics.go | 2 +- services/groups/pkg/revaconfig/config.go | 2 +- services/idp/pkg/metrics/metrics.go | 2 +- services/invitations/pkg/metrics/metrics.go | 2 +- services/ocdav/pkg/command/server.go | 2 +- services/ocm/pkg/metrics/metrics.go | 2 +- services/ocm/pkg/revaconfig/config.go | 4 ++-- services/proxy/pkg/metrics/metrics.go | 2 +- services/search/pkg/metrics/metrics.go | 2 +- services/settings/pkg/metrics/metrics.go | 2 +- services/sharing/pkg/revaconfig/config.go | 2 +- services/storage-publiclink/pkg/revaconfig/config.go | 2 +- services/storage-shares/pkg/revaconfig/config.go | 2 +- services/storage-system/pkg/revaconfig/config.go | 4 ++-- services/storage-users/pkg/revaconfig/config.go | 2 +- services/thumbnails/pkg/metrics/metrics.go | 2 +- services/userlog/pkg/metrics/metrics.go | 2 +- services/users/pkg/revaconfig/config.go | 2 +- services/webdav/pkg/metrics/metrics.go | 2 +- services/webfinger/pkg/metrics/metrics.go | 2 +- 35 files changed, 37 insertions(+), 37 deletions(-) diff --git a/opencloud/pkg/runtime/service/service.go b/opencloud/pkg/runtime/service/service.go index dfa15e61a..8335f2992 100644 --- a/opencloud/pkg/runtime/service/service.go +++ b/opencloud/pkg/runtime/service/service.go @@ -368,7 +368,7 @@ func Start(ctx context.Context, o ...Option) error { totalBackoff := 0 // Start creates its own supervisor. Running services under `ocis server` will create its own supervision tree. - s.Supervisor = suture.New("ocis", suture.Spec{ + s.Supervisor = suture.New("opencloud", suture.Spec{ EventHook: func(e suture.Event) { if e.Type() == suture.EventTypeBackoff { totalBackoff++ diff --git a/pkg/crypto/templates.go b/pkg/crypto/templates.go index 17db0dc18..1dfcd1791 100644 --- a/pkg/crypto/templates.go +++ b/pkg/crypto/templates.go @@ -14,7 +14,7 @@ var acmeTemplate = x509.Certificate{ SerialNumber: serialNumber, Subject: pkix.Name{ Organization: []string{"Acme Corp"}, - CommonName: "OCIS", + CommonName: "OpenCloud", }, NotBefore: time.Now(), NotAfter: time.Now().Add(24 * time.Hour * 365), diff --git a/pkg/log/option.go b/pkg/log/option.go index b071193b8..0485f8fc8 100644 --- a/pkg/log/option.go +++ b/pkg/log/option.go @@ -15,7 +15,7 @@ type Options struct { // newOptions initializes the available default options. func newOptions(opts ...Option) Options { opt := Options{ - Name: "ocis", + Name: "opencloud", Level: "info", Pretty: true, Color: true, diff --git a/services/activitylog/pkg/metrics/metrics.go b/services/activitylog/pkg/metrics/metrics.go index 10ee2daed..4b5c658c1 100644 --- a/services/activitylog/pkg/metrics/metrics.go +++ b/services/activitylog/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "activitylog" diff --git a/services/app-provider/pkg/revaconfig/config.go b/services/app-provider/pkg/revaconfig/config.go index fda5a77cc..c428d514d 100644 --- a/services/app-provider/pkg/revaconfig/config.go +++ b/services/app-provider/pkg/revaconfig/config.go @@ -46,7 +46,7 @@ func AppProviderConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "app_provider", }, }, diff --git a/services/app-registry/pkg/revaconfig/config.go b/services/app-registry/pkg/revaconfig/config.go index ae162d643..06b0234de 100644 --- a/services/app-registry/pkg/revaconfig/config.go +++ b/services/app-registry/pkg/revaconfig/config.go @@ -41,7 +41,7 @@ func AppRegistryConfigFromStruct(cfg *config.Config, logger log.Logger) map[stri }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "app_registry", }, }, diff --git a/services/auth-app/pkg/revaconfig/config.go b/services/auth-app/pkg/revaconfig/config.go index fac6b61a7..a82faee9c 100644 --- a/services/auth-app/pkg/revaconfig/config.go +++ b/services/auth-app/pkg/revaconfig/config.go @@ -46,7 +46,7 @@ func AuthAppConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "auth_app", }, }, diff --git a/services/auth-basic/pkg/revaconfig/config.go b/services/auth-basic/pkg/revaconfig/config.go index 5253701f3..ec8247bca 100644 --- a/services/auth-basic/pkg/revaconfig/config.go +++ b/services/auth-basic/pkg/revaconfig/config.go @@ -46,7 +46,7 @@ func AuthBasicConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "auth_basic", }, }, diff --git a/services/auth-bearer/pkg/revaconfig/config.go b/services/auth-bearer/pkg/revaconfig/config.go index 9549f8f7b..430ece8e5 100644 --- a/services/auth-bearer/pkg/revaconfig/config.go +++ b/services/auth-bearer/pkg/revaconfig/config.go @@ -38,7 +38,7 @@ func AuthBearerConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "auth_bearer", }, }, diff --git a/services/auth-machine/pkg/revaconfig/config.go b/services/auth-machine/pkg/revaconfig/config.go index 1a55f9a91..e26e0bb1d 100644 --- a/services/auth-machine/pkg/revaconfig/config.go +++ b/services/auth-machine/pkg/revaconfig/config.go @@ -34,7 +34,7 @@ func AuthMachineConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "auth_machine", }, }, diff --git a/services/auth-service/pkg/revaconfig/config.go b/services/auth-service/pkg/revaconfig/config.go index 686f5efd4..6f97eb7c8 100644 --- a/services/auth-service/pkg/revaconfig/config.go +++ b/services/auth-service/pkg/revaconfig/config.go @@ -44,7 +44,7 @@ func AuthMachineConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "auth_service", }, }, diff --git a/services/clientlog/pkg/metrics/metrics.go b/services/clientlog/pkg/metrics/metrics.go index c1f188f2a..bdcf2c1ce 100644 --- a/services/clientlog/pkg/metrics/metrics.go +++ b/services/clientlog/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "clientlog" diff --git a/services/eventhistory/pkg/metrics/metrics.go b/services/eventhistory/pkg/metrics/metrics.go index 58fe68bc0..60ce412a6 100644 --- a/services/eventhistory/pkg/metrics/metrics.go +++ b/services/eventhistory/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "eventhistory" diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index 2fb036310..8680b6215 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -114,7 +114,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string "credentials_by_user_agent": cfg.Middleware.Auth.CredentialsByUserAgent, }, "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "frontend", }, "requestid": map[string]interface{}{}, diff --git a/services/gateway/pkg/revaconfig/config.go b/services/gateway/pkg/revaconfig/config.go index d6976ccbe..20ddfa3ce 100644 --- a/services/gateway/pkg/revaconfig/config.go +++ b/services/gateway/pkg/revaconfig/config.go @@ -112,7 +112,7 @@ func GatewayConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]i }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "gateway", }, }, diff --git a/services/graph/pkg/metrics/metrics.go b/services/graph/pkg/metrics/metrics.go index 00108406f..7e597327a 100644 --- a/services/graph/pkg/metrics/metrics.go +++ b/services/graph/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "graph" diff --git a/services/groups/pkg/revaconfig/config.go b/services/groups/pkg/revaconfig/config.go index f70a036dc..77d5ee791 100644 --- a/services/groups/pkg/revaconfig/config.go +++ b/services/groups/pkg/revaconfig/config.go @@ -53,7 +53,7 @@ func GroupsConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "groups", }, }, diff --git a/services/idp/pkg/metrics/metrics.go b/services/idp/pkg/metrics/metrics.go index 9a5f912da..6e56a1b8a 100644 --- a/services/idp/pkg/metrics/metrics.go +++ b/services/idp/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "idp" diff --git a/services/invitations/pkg/metrics/metrics.go b/services/invitations/pkg/metrics/metrics.go index b034799b9..92c80163d 100644 --- a/services/invitations/pkg/metrics/metrics.go +++ b/services/invitations/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "invitations" diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index b1ba4a2d4..5cbc53186 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -84,7 +84,7 @@ func Server(cfg *config.Config) *cli.Command { // ocdav.LockSystem(), // will default to the CS3 lock system // ocdav.TLSConfig() // tls config for the http server ocdav.MetricsEnabled(true), - ocdav.MetricsNamespace("ocis"), + ocdav.MetricsNamespace("opencloud"), ocdav.Tracing("Adding these strings is a workaround for ->", "https://github.com/cs3org/reva/issues/4131"), ocdav.WithTraceProvider(traceProvider), ocdav.RegisterTTL(registry.GetRegisterTTL()), diff --git a/services/ocm/pkg/metrics/metrics.go b/services/ocm/pkg/metrics/metrics.go index 89eeed6da..f4d7830cd 100644 --- a/services/ocm/pkg/metrics/metrics.go +++ b/services/ocm/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "ocm" diff --git a/services/ocm/pkg/revaconfig/config.go b/services/ocm/pkg/revaconfig/config.go index 55b2f9029..cab5e6814 100644 --- a/services/ocm/pkg/revaconfig/config.go +++ b/services/ocm/pkg/revaconfig/config.go @@ -49,7 +49,7 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter "credentials_by_user_agent": cfg.Middleware.Auth.CredentialsByUserAgent, }, "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "ocm", }, "requestid": map[string]interface{}{}, @@ -61,7 +61,7 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter "ocmprovider": map[string]interface{}{ "ocm_prefix": cfg.OCMD.Prefix, "endpoint": cfg.Commons.OcisURL, - "provider": "oCIS", + "provider": "OpenCloud", "webdav_root": "/dav/ocm", "webapp_root": cfg.ScienceMesh.Prefix, "enable_webapp": false, diff --git a/services/proxy/pkg/metrics/metrics.go b/services/proxy/pkg/metrics/metrics.go index f366b3ddb..57143cd8e 100644 --- a/services/proxy/pkg/metrics/metrics.go +++ b/services/proxy/pkg/metrics/metrics.go @@ -6,7 +6,7 @@ import ( var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "proxy" diff --git a/services/search/pkg/metrics/metrics.go b/services/search/pkg/metrics/metrics.go index c3076bb01..c8459d782 100644 --- a/services/search/pkg/metrics/metrics.go +++ b/services/search/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "search" diff --git a/services/settings/pkg/metrics/metrics.go b/services/settings/pkg/metrics/metrics.go index adb6000a5..caf42646d 100644 --- a/services/settings/pkg/metrics/metrics.go +++ b/services/settings/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "settings" diff --git a/services/sharing/pkg/revaconfig/config.go b/services/sharing/pkg/revaconfig/config.go index cffb79077..da4cd6db5 100644 --- a/services/sharing/pkg/revaconfig/config.go +++ b/services/sharing/pkg/revaconfig/config.go @@ -140,7 +140,7 @@ func SharingConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string] "password": cfg.Events.AuthPassword, }, "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "sharing", }, }, diff --git a/services/storage-publiclink/pkg/revaconfig/config.go b/services/storage-publiclink/pkg/revaconfig/config.go index 311c11945..7cf2fe89c 100644 --- a/services/storage-publiclink/pkg/revaconfig/config.go +++ b/services/storage-publiclink/pkg/revaconfig/config.go @@ -24,7 +24,7 @@ func StoragePublicLinkConfigFromStruct(cfg *config.Config) map[string]interface{ "interceptors": map[string]interface{}{ "log": map[string]interface{}{}, "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "storage_publiclink", }, }, diff --git a/services/storage-shares/pkg/revaconfig/config.go b/services/storage-shares/pkg/revaconfig/config.go index 0aae282e0..cb4ee87cf 100644 --- a/services/storage-shares/pkg/revaconfig/config.go +++ b/services/storage-shares/pkg/revaconfig/config.go @@ -30,7 +30,7 @@ func StorageSharesConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "storage_shares", }, }, diff --git a/services/storage-system/pkg/revaconfig/config.go b/services/storage-system/pkg/revaconfig/config.go index 3a500f930..95c5300c2 100644 --- a/services/storage-system/pkg/revaconfig/config.go +++ b/services/storage-system/pkg/revaconfig/config.go @@ -103,7 +103,7 @@ func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "storage_system", }, }, @@ -138,7 +138,7 @@ func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} { }, "middlewares": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "storage_system", }, }, diff --git a/services/storage-users/pkg/revaconfig/config.go b/services/storage-users/pkg/revaconfig/config.go index 135363fa4..760022a1d 100644 --- a/services/storage-users/pkg/revaconfig/config.go +++ b/services/storage-users/pkg/revaconfig/config.go @@ -62,7 +62,7 @@ func StorageUsersConfigFromStruct(cfg *config.Config) map[string]interface{} { "password": cfg.Events.AuthPassword, }, "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "storage_users", }, }, diff --git a/services/thumbnails/pkg/metrics/metrics.go b/services/thumbnails/pkg/metrics/metrics.go index b38fec208..a9af58a52 100644 --- a/services/thumbnails/pkg/metrics/metrics.go +++ b/services/thumbnails/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "thumbnails" diff --git a/services/userlog/pkg/metrics/metrics.go b/services/userlog/pkg/metrics/metrics.go index 1c34c6f9f..15b150b03 100644 --- a/services/userlog/pkg/metrics/metrics.go +++ b/services/userlog/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "userlog" diff --git a/services/users/pkg/revaconfig/config.go b/services/users/pkg/revaconfig/config.go index 83d5ef3c1..a70aff768 100644 --- a/services/users/pkg/revaconfig/config.go +++ b/services/users/pkg/revaconfig/config.go @@ -47,7 +47,7 @@ func UsersConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "interceptors": map[string]interface{}{ "prometheus": map[string]interface{}{ - "namespace": "ocis", + "namespace": "opencloud", "subsystem": "users", }, }, diff --git a/services/webdav/pkg/metrics/metrics.go b/services/webdav/pkg/metrics/metrics.go index d0869cdf8..00aae465c 100644 --- a/services/webdav/pkg/metrics/metrics.go +++ b/services/webdav/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "webdav" diff --git a/services/webfinger/pkg/metrics/metrics.go b/services/webfinger/pkg/metrics/metrics.go index 03707f338..8b18a2ecf 100644 --- a/services/webfinger/pkg/metrics/metrics.go +++ b/services/webfinger/pkg/metrics/metrics.go @@ -4,7 +4,7 @@ import "github.com/prometheus/client_golang/prometheus" var ( // Namespace defines the namespace for the defines metrics. - Namespace = "ocis" + Namespace = "opencloud" // Subsystem defines the subsystem for the defines metrics. Subsystem = "webfinger"