Skip to content

Commit

Permalink
Decrease database instance collection interval (#26142)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeunier28 authored May 30, 2024
1 parent cded074 commit 9f16962
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/collector/corechecks/oracle/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ type InstanceConfig struct {
UseGlobalCustomQueries string `yaml:"use_global_custom_queries"`
CustomQueries []CustomQuery `yaml:"custom_queries"`
MetricCollectionInterval int64 `yaml:"metric_collection_interval"`
DatabaseInstanceCollectionInterval uint64 `yaml:"database_instance_collection_interval"`
DatabaseInstanceCollectionInterval int64 `yaml:"database_instance_collection_interval"`
Asm asmConfig `yaml:"asm"`
ResourceManager resourceManagerConfig `yaml:"resource_manager"`
Locks locksConfig `yaml:"locks"`
Expand Down Expand Up @@ -229,7 +229,7 @@ func NewCheckConfig(rawInstance integration.Data, rawInitConfig integration.Data

instance.UseGlobalCustomQueries = "true"

instance.DatabaseInstanceCollectionInterval = 1800
instance.DatabaseInstanceCollectionInterval = 300

instance.Loader = defaultLoader
initCfg.Loader = defaultLoader
Expand Down
2 changes: 1 addition & 1 deletion pkg/collector/corechecks/oracle/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type dbInstanceEvent struct {
AgentVersion string `json:"agent_version"`
Dbms string `json:"dbms"`
Kind string `json:"kind"`
CollectionInterval uint64 `json:"collection_interval"`
CollectionInterval int64 `json:"collection_interval"`
DbmsVersion string `json:"dbms_version"`
Tags []string `json:"tags"`
Timestamp float64 `json:"timestamp"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/collector/corechecks/oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (c *Check) Run() error {
c.connection = conn
}

dbInstanceIntervalExpired := checkIntervalExpired(&c.dbInstanceLastRun, 1800)
dbInstanceIntervalExpired := checkIntervalExpired(&c.dbInstanceLastRun, c.config.DatabaseInstanceCollectionInterval)

if dbInstanceIntervalExpired && !c.legacyIntegrationCompatibilityMode && !c.config.OnlyCustomQueries {
err := sendDbInstanceMetadata(c)
Expand Down

0 comments on commit 9f16962

Please sign in to comment.