diff --git a/lib/config/types.go b/lib/config/types.go index 59fe936fa..d9247b22f 100644 --- a/lib/config/types.go +++ b/lib/config/types.go @@ -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"` @@ -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"` diff --git a/processes/consumer/process.go b/processes/consumer/process.go index 731834fb8..91d4ed2b1 100644 --- a/processes/consumer/process.go +++ b/processes/consumer/process.go @@ -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"