Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
cyriltovena committed Jan 11, 2023
1 parent 1a39aa1 commit 30de572
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ func (c *ScrapeConfig) Validate() error {
}

if cfg, ok := c.ProfilingConfig.PprofConfig[pprofProcessCPU]; ok {
if *cfg.Enabled && c.ScrapeTimeout < model.Duration(time.Second*2) {
return fmt.Errorf("%v scrape_timeout must be at least 2 seconds in %v", pprofProcessCPU, c.JobName)
if *cfg.Enabled && c.ScrapeInterval < model.Duration(time.Second*2) {
return fmt.Errorf("%v scrape_interval must be at least 2 seconds in %v", pprofProcessCPU, c.JobName)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (tg *TargetGroup) targetsFromGroup(group *targetgroup.Group) ([]*Target, []
}

if pcfg, found := tg.config.ProfilingConfig.PprofConfig[profType]; found && pcfg.Delta {
params.Add("seconds", strconv.Itoa(int(time.Duration(tg.config.ScrapeInterval)/time.Second)))
params.Add("seconds", strconv.Itoa(int(time.Duration(tg.config.ScrapeInterval)/time.Second)-1))
}
targets = append(targets, &Target{
Target: scrape.NewTarget(lbls, origLabels, params),
Expand Down

0 comments on commit 30de572

Please sign in to comment.