Skip to content

Commit ea332b1

Browse files
committed
feat: Add Sentry option to spec
1 parent 5dc6ce9 commit ea332b1

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

managedplugin/plugin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ type Config struct {
7777
Version string
7878
Environment []string // environment variables to pass to the plugin in key=value format
7979
DockerAuth string
80+
SentryDSN string
8081
}
8182

8283
type Client struct {
@@ -549,6 +550,8 @@ func (c *Client) getPluginArgs() []string {
549550
}
550551
if c.noSentry {
551552
args = append(args, "--no-sentry")
553+
} else if len(c.config.SentryDSN) > 0 {
554+
args = append(args, "--sentry-dsn", c.config.SentryDSN)
552555
}
553556
if c.licenseFile != "" {
554557
args = append(args, "--license", c.licenseFile)

specs/destination.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ type Destination struct {
2121
BatchSizeBytes int `json:"batch_size_bytes,omitempty"`
2222
Spec any `json:"spec,omitempty"`
2323
PKMode PKMode `json:"pk_mode,omitempty"`
24+
25+
// SentryDSN is the DSN used to report errors to Sentry
26+
SentryDSN string `json:"sentry_dsn,omitempty"`
2427
}
2528

2629
func (d *Destination) SetDefaults(defaultBatchSize, defaultBatchSizeBytes int) {

specs/source.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ type Source struct {
5353
// DeterministicCQID is a flag that indicates whether the source plugin should generate a random UUID as the value of _cq_id
5454
// or whether it should calculate a UUID that is a hash of the primary keys (if they exist) or the entire resource.
5555
DeterministicCQID bool `json:"deterministic_cq_id,omitempty"`
56+
57+
// SentryDSN is the DSN used to report errors to Sentry
58+
SentryDSN string `json:"sentry_dsn,omitempty"`
5659
}
5760

5861
func (s *Source) SetDefaults() {

0 commit comments

Comments
 (0)