Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Sep 26, 2024
1 parent f5d0e6e commit 96184fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 7 additions & 6 deletions lib/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ type SharedDestinationSettings struct {
TruncateExceededValues bool `yaml:"truncateExceededValues"`
}

type Reporting struct {
Sentry *Sentry `yaml:"sentry"`
EmitExecutionTime bool `yaml:"emitExecutionTime"`
}

type Config struct {
Mode Mode `yaml:"mode"`
Output constants.DestinationKind `yaml:"outputSource"`
Expand All @@ -63,12 +68,8 @@ type Config struct {
S3 *S3Settings `yaml:"s3,omitempty"`

SharedDestinationSettings SharedDestinationSettings `yaml:"sharedDestinationSettings"`

Reporting struct {
Sentry *Sentry `yaml:"sentry"`
}

Telemetry struct {
Reporting Reporting `yaml:"reporting"`
Telemetry struct {
Metrics struct {
Provider constants.ExporterKind `yaml:"provider"`
Settings map[string]any `yaml:"settings,omitempty"`
Expand Down
5 changes: 4 additions & 1 deletion processes/consumer/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ func (p processArgs) process(ctx context.Context, cfg config.Config, inMemDB *mo
}

// Emit execution time lag for non-skipped events.
evt.EmitExecutionTimeLag(metricsClient)
if cfg.Reporting.EmitExecutionTime {
evt.EmitExecutionTimeLag(metricsClient)
}

shouldFlush, flushReason, err := evt.Save(cfg, inMemDB, topicConfig.tc, p.Msg)
if err != nil {
tags["what"] = "save_fail"
Expand Down

0 comments on commit 96184fb

Please sign in to comment.