Skip to content

Commit

Permalink
Fix up gRPC implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
dbason committed Feb 15, 2023
1 parent 61460de commit df23af8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/logging/pkg/agent/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/rancher/opni/plugins/logging/pkg/agent/drivers/events"
"github.com/rancher/opni/plugins/logging/pkg/agent/drivers/kubernetes"
loggingutil "github.com/rancher/opni/plugins/logging/pkg/util"
collogspb "go.opentelemetry.io/proto/otlp/collector/logs/v1"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -66,6 +67,8 @@ func NewPlugin(ctx context.Context) *Plugin {
return p
}

var _ collogspb.LogsServiceServer = (*loggingutil.OTELForwarder)(nil)

func Scheme(ctx context.Context) meta.Scheme {
scheme := meta.NewScheme(meta.WithMode(meta.ModeAgent))
p := NewPlugin(ctx)
Expand Down
2 changes: 2 additions & 0 deletions plugins/logging/pkg/gateway/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/rancher/opni/plugins/logging/pkg/gateway/drivers"
"github.com/rancher/opni/plugins/logging/pkg/opensearchdata"
loggingutil "github.com/rancher/opni/plugins/logging/pkg/util"
collogspb "go.opentelemetry.io/proto/otlp/collector/logs/v1"
corev1 "k8s.io/api/core/v1"
)

Expand Down Expand Up @@ -202,6 +203,7 @@ func NewPlugin(ctx context.Context, opts ...PluginOption) *Plugin {

var _ loggingadmin.LoggingAdminServer = (*Plugin)(nil)
var _ loggingadmin.LoggingAdminV2Server = (*LoggingManagerV2)(nil)
var _ collogspb.LogsServiceServer = (*loggingutil.OTELForwarder)(nil)

func Scheme(ctx context.Context) meta.Scheme {
scheme := meta.NewScheme(meta.WithMode(meta.ModeGateway))
Expand Down
1 change: 1 addition & 0 deletions plugins/logging/pkg/util/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
)

type OTELForwarder struct {
collogspb.UnsafeLogsServiceServer
opts otelForwarderOptions

Client *AsyncClient[collogspb.LogsServiceClient]
Expand Down

0 comments on commit df23af8

Please sign in to comment.