Fix nil-pointer issue with misconfigured tracing

Co-authored-by: Jörn Friedrich Dreyer <jfd@butonic.de>

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2024-07-16 14:46:49 +02:00
co-authored by Jörn Friedrich Dreyer
parent d98a05d2df
commit 505ed389b7
7 changed files with 39 additions and 72 deletions
+6 -6
View File
@@ -5,15 +5,14 @@ import (
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
ogrpc "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc"
"github.com/owncloud/ocis/v2/ocis-pkg/tracing"
"github.com/owncloud/ocis/v2/ocis-pkg/version"
"github.com/owncloud/ocis/v2/services/ocs/pkg/config"
"github.com/owncloud/ocis/v2/services/ocs/pkg/config/parser"
"github.com/owncloud/ocis/v2/services/ocs/pkg/logging"
"github.com/owncloud/ocis/v2/services/ocs/pkg/tracing"
"github.com/oklog/run"
ogrpc "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc"
"github.com/owncloud/ocis/v2/services/ocs/pkg/config"
"github.com/owncloud/ocis/v2/services/ocs/pkg/metrics"
"github.com/owncloud/ocis/v2/services/ocs/pkg/server/debug"
"github.com/owncloud/ocis/v2/services/ocs/pkg/server/http"
@@ -31,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command {
},
Action: func(c *cli.Context) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)
err := tracing.Configure(cfg)
traceProvider, err := tracing.GetServiceTraceProvider(cfg.Tracing, cfg.Service.Name)
if err != nil {
return err
}
@@ -62,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
http.Context(ctx),
http.Config(cfg),
http.Metrics(metrics),
http.TraceProvider(traceProvider),
)
if err != nil {