Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove plugin option for logging error events to Sentry #1724

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/simple_plugin/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ require (
github.com/fatih/structs v1.1.0 // indirect
github.com/flosch/pongo2/v4 v4.0.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/getsentry/sentry-go v0.28.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.9.1 // indirect
Expand Down
7 changes: 0 additions & 7 deletions examples/simple_plugin/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0H
github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/getsentry/sentry-go v0.28.0 h1:7Rqx9M3ythTKy2J6uZLHmc8Sz9OGgIlseuO1iBX/s0M=
github.com/getsentry/sentry-go v0.28.0/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
Expand Down Expand Up @@ -190,9 +186,6 @@ github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZ
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/cloudquery/cloudquery-api-go v1.11.3
github.com/cloudquery/plugin-pb-go v1.19.18
github.com/cloudquery/plugin-sdk/v2 v2.7.0
github.com/getsentry/sentry-go v0.28.0
github.com/goccy/go-json v0.10.3
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
Expand Down
7 changes: 0 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0H
github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/getsentry/sentry-go v0.28.0 h1:7Rqx9M3ythTKy2J6uZLHmc8Sz9OGgIlseuO1iBX/s0M=
github.com/getsentry/sentry-go v0.28.0/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
Expand Down Expand Up @@ -190,9 +186,6 @@ github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZ
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down
1 change: 0 additions & 1 deletion internal/servers/plugin/v3/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type Server struct {
Plugin *plugin.Plugin
Logger zerolog.Logger
Directory string
NoSentry bool
}

func (s *Server) GetTables(ctx context.Context, req *pb.GetTables_Request) (*pb.GetTables_Response, error) {
Expand Down
39 changes: 0 additions & 39 deletions scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import (
"time"

"github.com/apache/arrow/go/v16/arrow"

"github.com/cloudquery/plugin-sdk/v4/caser"
"github.com/cloudquery/plugin-sdk/v4/message"
"github.com/cloudquery/plugin-sdk/v4/schema"
"github.com/getsentry/sentry-go"
"github.com/rs/zerolog"
"github.com/thoas/go-funk"
"go.opentelemetry.io/otel"
Expand Down Expand Up @@ -235,7 +233,6 @@ func (s *syncClient) logTablesMetrics(tables schema.Tables, client Client) {
}

func (s *syncClient) resolveResource(ctx context.Context, table *schema.Table, client schema.ClientMeta, parent *schema.Resource, item any) *schema.Resource {
var validationErr *schema.ValidationError
ctx, cancel := context.WithTimeout(ctx, 10*time.Minute)
defer cancel()
resource := schema.NewResourceData(table, parent, item)
Expand All @@ -248,22 +245,12 @@ func (s *syncClient) resolveResource(ctx context.Context, table *schema.Table, c
stack := fmt.Sprintf("%s\n%s", err, string(debug.Stack()))
logger.Error().Interface("error", err).TimeDiff("duration", time.Now(), objectStartTime).Str("stack", stack).Msg("resource resolver finished with panic")
atomic.AddUint64(&tableMetrics.Panics, 1)
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage(stack)
})
}
}()
if table.PreResourceResolver != nil {
if err := table.PreResourceResolver(ctx, client, resource); err != nil {
logger.Error().Err(err).Msg("pre resource resolver failed")
atomic.AddUint64(&tableMetrics.Errors, 1)
if errors.As(err, &validationErr) {
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage(validationErr.MaskedError())
})
}
return nil
}
}
Expand All @@ -276,45 +263,26 @@ func (s *syncClient) resolveResource(ctx context.Context, table *schema.Table, c
if err := table.PostResourceResolver(ctx, client, resource); err != nil {
logger.Error().Stack().Err(err).Msg("post resource resolver finished with error")
atomic.AddUint64(&tableMetrics.Errors, 1)
if errors.As(err, &validationErr) {
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage(validationErr.MaskedError())
})
}
}
}
atomic.AddUint64(&tableMetrics.Resources, 1)
return resource
}

func (s *syncClient) resolveColumn(ctx context.Context, logger zerolog.Logger, tableMetrics *TableClientMetrics, client schema.ClientMeta, resource *schema.Resource, c schema.Column) {
var validationErr *schema.ValidationError
columnStartTime := time.Now()
defer func() {
if err := recover(); err != nil {
stack := fmt.Sprintf("%s\n%s", err, string(debug.Stack()))
logger.Error().Str("column", c.Name).Interface("error", err).TimeDiff("duration", time.Now(), columnStartTime).Str("stack", stack).Msg("column resolver finished with panic")
atomic.AddUint64(&tableMetrics.Panics, 1)
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", resource.Table.Name)
scope.SetTag("column", c.Name)
sentry.CurrentHub().CaptureMessage(stack)
})
}
}()

if c.Resolver != nil {
if err := c.Resolver(ctx, client, resource, c); err != nil {
logger.Error().Err(err).Msg("column resolver finished with error")
atomic.AddUint64(&tableMetrics.Errors, 1)
if errors.As(err, &validationErr) {
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", resource.Table.Name)
scope.SetTag("column", c.Name)
sentry.CurrentHub().CaptureMessage(validationErr.MaskedError())
})
}
}
} else {
// base use case: try to get column with CamelCase name
Expand All @@ -324,13 +292,6 @@ func (s *syncClient) resolveColumn(ctx context.Context, logger zerolog.Logger, t
if err != nil {
logger.Error().Err(err).Msg("column resolver finished with error")
atomic.AddUint64(&tableMetrics.Errors, 1)
if errors.As(err, &validationErr) {
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", resource.Table.Name)
scope.SetTag("column", c.Name)
sentry.CurrentHub().CaptureMessage(validationErr.MaskedError())
})
}
}
}
}
Expand Down
34 changes: 0 additions & 34 deletions scheduler/scheduler_dfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package scheduler

import (
"context"
"errors"
"fmt"
"runtime/debug"
"sync"
"sync/atomic"

"github.com/cloudquery/plugin-sdk/v4/helpers"
"github.com/cloudquery/plugin-sdk/v4/schema"
"github.com/getsentry/sentry-go"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"golang.org/x/sync/semaphore"
Expand All @@ -33,10 +31,6 @@ func (s *syncClient) syncDfs(ctx context.Context, resolvedResources chan<- *sche
if _, ok := seenClients[c.ID()]; !ok {
seenClients[c.ID()] = true
} else {
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage("duplicate client ID in " + table.Name)
})
s.logger.Warn().Str("client", c.ID()).Str("table", table.Name).Msg("multiplex returned duplicate client")
}
}
Expand Down Expand Up @@ -76,7 +70,6 @@ func (s *syncClient) resolveTableDfs(ctx context.Context, table *schema.Table, c
ctx, span := otel.Tracer(otelName).Start(ctx, "resolveTableDfs_"+table.Name)
span.SetAttributes(attribute.Key("client-id").String(client.ID()))
defer span.End()
var validationErr *schema.ValidationError
clientName := client.ID()
logger := s.logger.With().Str("table", table.Name).Str("client", clientName).Logger()

Expand All @@ -90,10 +83,6 @@ func (s *syncClient) resolveTableDfs(ctx context.Context, table *schema.Table, c
defer func() {
if err := recover(); err != nil {
stack := fmt.Sprintf("%s\n%s", err, string(debug.Stack()))
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage(stack)
})
logger.Error().Interface("error", err).Str("stack", stack).Msg("table resolver finished with panic")
atomic.AddUint64(&tableMetrics.Panics, 1)
}
Expand All @@ -102,12 +91,6 @@ func (s *syncClient) resolveTableDfs(ctx context.Context, table *schema.Table, c
if err := table.Resolver(ctx, client, parent, res); err != nil {
logger.Error().Err(err).Msg("table resolver finished with error")
atomic.AddUint64(&tableMetrics.Errors, 1)
if errors.As(err, &validationErr) {
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage(validationErr.MaskedError())
})
}
return
}
}()
Expand All @@ -132,7 +115,6 @@ func (s *syncClient) resolveResourcesDfs(ctx context.Context, table *schema.Tabl
go func() {
defer close(resourcesChan)
var wg sync.WaitGroup
sentValidationErrors := sync.Map{}
for i := range resourcesSlice {
i := i
resourceConcurrencyKey := table.Name + "-" + client.ID() + "-" + "resource"
Expand Down Expand Up @@ -168,28 +150,12 @@ func (s *syncClient) resolveResourcesDfs(ctx context.Context, table *schema.Tabl
if err := resolvedResource.CalculateCQID(s.deterministicCQID); err != nil {
tableMetrics := s.metrics.TableClient[table.Name][client.ID()]
s.logger.Error().Err(err).Str("table", table.Name).Str("client", client.ID()).Msg("resource resolver finished with primary key calculation error")
if _, found := sentValidationErrors.LoadOrStore(table.Name, struct{}{}); !found {
// send resource validation errors to Sentry only once per table,
// to avoid sending too many duplicate messages
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage(err.Error())
})
}
atomic.AddUint64(&tableMetrics.Errors, 1)
return
}
if err := resolvedResource.Validate(); err != nil {
tableMetrics := s.metrics.TableClient[table.Name][client.ID()]
s.logger.Error().Err(err).Str("table", table.Name).Str("client", client.ID()).Msg("resource resolver finished with validation error")
if _, found := sentValidationErrors.LoadOrStore(table.Name, struct{}{}); !found {
// send resource validation errors to Sentry only once per table,
// to avoid sending too many duplicate messages
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage(err.Error())
})
}
atomic.AddUint64(&tableMetrics.Errors, 1)
return
}
Expand Down
47 changes: 2 additions & 45 deletions serve/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ import (
serverDestinationV0 "github.com/cloudquery/plugin-sdk/v4/internal/servers/destination/v0"
serverDestinationV1 "github.com/cloudquery/plugin-sdk/v4/internal/servers/destination/v1"
serversv3 "github.com/cloudquery/plugin-sdk/v4/internal/servers/plugin/v3"
"github.com/getsentry/sentry-go"
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/thoas/go-funk"
"google.golang.org/grpc"
"google.golang.org/grpc/test/bufconn"
)
Expand All @@ -43,20 +41,13 @@ type PluginServe struct {
plugin *plugin.Plugin
args []string
destinationV0V1Server bool
sentryDSN string
testListener bool
testListenerConn *bufconn.Listener
versions []int
}

type PluginOption func(*PluginServe)

func WithPluginSentryDSN(dsn string) PluginOption {
return func(s *PluginServe) {
s.sentryDSN = dsn
}
}

// WithDestinationV0V1Server is used to include destination v0 and v1 server to work
// with older sources
func WithDestinationV0V1Server() PluginOption {
Expand Down Expand Up @@ -117,7 +108,6 @@ func (s *PluginServe) Serve(ctx context.Context) error {
func (s *PluginServe) newCmdPluginServe() *cobra.Command {
var address string
var network string
var noSentry bool
var otelEndpoint string
var otelEndpointHeaders []string
var otelEndpointInsecure bool
Expand Down Expand Up @@ -225,9 +215,8 @@ func (s *PluginServe) newCmdPluginServe() *cobra.Command {
)
s.plugin.SetLogger(logger)
pbv3.RegisterPluginServer(grpcServer, &serversv3.Server{
Plugin: s.plugin,
Logger: logger,
NoSentry: noSentry,
Plugin: s.plugin,
Logger: logger,
})
if s.destinationV0V1Server {
pbDestinationV1.RegisterDestinationServer(grpcServer, &serverDestinationV1.Server{
Expand All @@ -246,33 +235,6 @@ func (s *PluginServe) newCmdPluginServe() *cobra.Command {
Versions: []int32{0, 1, 2, 3},
})

version := s.plugin.Version()

if s.sentryDSN != "" && !strings.EqualFold(version, "development") && !noSentry {
err = sentry.Init(sentry.ClientOptions{
Dsn: s.sentryDSN,
Debug: false,
AttachStacktrace: false,
Release: version,
Transport: sentry.NewHTTPSyncTransport(),
ServerName: "oss", // set to "oss" on purpose to avoid sending any identifying information
// https://docs.sentry.io/platforms/go/configuration/options/#removing-default-integrations
Integrations: func(integrations []sentry.Integration) []sentry.Integration {
var filteredIntegrations []sentry.Integration
for _, integration := range integrations {
if integration.Name() == "Modules" {
continue
}
filteredIntegrations = append(filteredIntegrations, integration)
}
return filteredIntegrations
},
})
if err != nil {
log.Error().Err(err).Msg("Error initializing sentry")
}
}

ctx := cmd.Context()
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
Expand Down Expand Up @@ -306,12 +268,7 @@ func (s *PluginServe) newCmdPluginServe() *cobra.Command {
cmd.Flags().StringVar(&otelEndpointURLPath, "otel-endpoint-urlpath", "", "Open Telemetry HTTP collector endpoint URL path")
cmd.Flags().StringArrayVar(&otelEndpointHeaders, "otel-endpoint-headers", []string{}, "Open Telemetry HTTP collector endpoint headers")
cmd.Flags().BoolVar(&otelEndpointInsecure, "otel-endpoint-insecure", false, "use Open Telemetry HTTP endpoint (for development only)")
cmd.Flags().BoolVar(&noSentry, "no-sentry", false, "disable sentry")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure here tbh what would be the best approach, whether to remove this or have it do nothing and mark as deprecated. Wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep the option but make it deprecated and no-op.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, I wasn't sure if deleting it was the best decision as if it was like that, I'd have had to delete it from the other plugin sdks as well.

Copy link
Member

@erezrokah erezrokah Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think if we remove the flag new plugins might not work with older CLI versions (don't remember if we're doing strict parsing)

cmd.Flags().StringVar(&licenseFile, "license", "", "Path to offline license file or directory")
sendErrors := funk.ContainsString([]string{"all", "errors"}, telemetryLevel.String())
if !sendErrors {
noSentry = true
}

return cmd
}
Expand Down
Loading