From 0b9f23365b93d5d0a6dd5533303d6eec77136fed Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Sat, 1 Jul 2023 10:35:41 +0200 Subject: [PATCH] Add app name and version to mongo connections --- frontend/src/styles/style.css | 4 ++-- internal/app/connection.go | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/styles/style.css b/frontend/src/styles/style.css index 590e2ef..1288c9a 100644 --- a/frontend/src/styles/style.css +++ b/frontend/src/styles/style.css @@ -50,8 +50,8 @@ a { hr { border: none; - height: 1px; - background-color: #ccc; + border-top: 1px solid #ccc; + width: 100%; } .loading { diff --git a/internal/app/connection.go b/internal/app/connection.go index 96fa13e..59ecc79 100644 --- a/internal/app/connection.go +++ b/internal/app/connection.go @@ -42,7 +42,11 @@ func (a *App) connectToHost(hostKey string) (*mongo.Client, context.Context, fun return nil, nil, nil, errors.New("invalid uri") } - client, err := mongo.NewClient(mongoOptions.Client().ApplyURI(h.URI)) + appName := "Rolens v" + a.Env.Version + opts := mongoOptions.Client() + opts.AppName = &appName + opts.ApplyURI(h.URI) + client, err := mongo.NewClient(opts) if err != nil { runtime.LogWarningf(a.ctx, "Could not connect to host %s: %s", hostKey, err.Error())