Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
michaelbeaumont committed Jun 30, 2023
1 parent 1b23e5c commit 9064698
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion pkg/core/bootstrap/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import (
_ "github.com/kumahq/kuma/pkg/plugins/resources/memory"
_ "github.com/kumahq/kuma/pkg/plugins/resources/postgres"
_ "github.com/kumahq/kuma/pkg/plugins/runtime/gateway"
_ "github.com/kumahq/kuma/pkg/plugins/runtime/opentelemetry"
_ "github.com/kumahq/kuma/pkg/plugins/runtime/k8s"
_ "github.com/kumahq/kuma/pkg/plugins/runtime/k8s"
_ "github.com/kumahq/kuma/pkg/plugins/runtime/opentelemetry"
_ "github.com/kumahq/kuma/pkg/plugins/runtime/universal"
_ "github.com/kumahq/kuma/pkg/plugins/secrets/k8s"
_ "github.com/kumahq/kuma/pkg/plugins/secrets/universal"
Expand Down
19 changes: 11 additions & 8 deletions pkg/plugins/runtime/opentelemetry/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ import (
"fmt"
"time"

"github.com/kumahq/kuma/pkg/config/tracing"
"github.com/kumahq/kuma/pkg/core"
core_plugins "github.com/kumahq/kuma/pkg/core/plugins"
core_runtime "github.com/kumahq/kuma/pkg/core/runtime"
"github.com/kumahq/kuma/pkg/core/runtime/component"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
"go.opentelemetry.io/otel/sdk/trace"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

"github.com/kumahq/kuma/pkg/config/tracing"
"github.com/kumahq/kuma/pkg/core"
core_plugins "github.com/kumahq/kuma/pkg/core/plugins"
core_runtime "github.com/kumahq/kuma/pkg/core/runtime"
"github.com/kumahq/kuma/pkg/core/runtime/component"
)

func init() {
Expand All @@ -30,8 +31,7 @@ type plugin struct{}
var _ core_plugins.RuntimePlugin = &plugin{}

type tracer struct {
config tracing.OpenTelemetry
provider *trace.TracerProvider
config tracing.OpenTelemetry
}

var _ component.Component = &tracer{}
Expand All @@ -44,7 +44,10 @@ func (t *tracer) Start(stop <-chan struct{}) error {

go func() {
<-stop
shutdown(context.Background())
log.Info("stopping")
if err := shutdown(context.Background()); err != nil {
log.Error(err, "shutting down")
}
}()

return nil
Expand Down

0 comments on commit 9064698

Please sign in to comment.