Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] updating scrapers to use default method from scraperhelper #22138

Conversation

MovieStoreGuy
Copy link
Contributor

Description:
Updating components to use the scraper helper config default method.

Link to tracking Issue:

Related to: open-telemetry/opentelemetry-collector#7635

Testing:

Tests have been updated where applicable.

Documentation:

This should be transparent to users so I've avoided it for the time being.

@MovieStoreGuy MovieStoreGuy changed the title Adding updates to scraper intervals for upcoming changes in upstream [chore] updating scrapers to use default method from scraperhelper May 20, 2023
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the change suggested in open-telemetry/opentelemetry-collector#7635 but is it really a direct concern that these collection intervals need to be changed? Is there a way to respect the initial delay setting while also allowing each scraper to define its own default collection interval?

If we really do need to make this change, I think a case should be made for it independently of open-telemetry/opentelemetry-collector#7635, and I think we need to consider it a breaking change to every impacted receiver.

receiver/vcenterreceiver/factory.go Show resolved Hide resolved
@MovieStoreGuy
Copy link
Contributor Author

I like the change suggested in open-telemetry/opentelemetry-collector#7635 but is it really a direct concern that these collection intervals need to be changed? Is there a way to respect the initial delay setting while also allowing each scraper to define its own default collection interval?

So I am of two minds because it presents an opportunity to standardise the defaults for the collector to be consistent and thus reducing the cognitive burden of configuration on end users. The other side of it being that we should respect the default intervals as defined by component owners, the point in case is the snowflake receiver with a 30m interval.

If we really do need to make this change, I think a case should be made for it independently of open-telemetry/opentelemetry-collector#7635, and I think we need to consider it a breaking change to every impacted receiver.

Taking this into consideration, I think it make sense to create the default configuration from the scraper helper and apply the current default timeouts to keep the expected experience consistent.

We can follow up with an issue to standardise these and get more feedback from the config sig and code owners.

@MovieStoreGuy MovieStoreGuy added the ready to merge Code review completed; ready to merge by maintainers label May 23, 2023
@djaglowski djaglowski merged commit 2c5577b into open-telemetry:main May 23, 2023
@github-actions github-actions bot added this to the next release milestone May 23, 2023
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still a breaking change?

If I understand correctly, the change in components' behavior is that they start scraping after 1 second and not after their default collection interval, is this right? In that case, I believe we should call it out in the release notes (using the subtext below?).

Copy link
Contributor Author

@MovieStoreGuy MovieStoreGuy May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽 , that makes sense but at this point this is a transparent change until the upstream is merged.

However, I think this missed the v0.78.0 release so we have time to fix this up.
I can correct it in the next release with more details.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, the change in components' behavior is that they start scraping after 1 second and not after their default collection interval, is this right?

This comment of mine is actually incorrect 🙂 Not until the core PR gets merged:

Looking at this PR again in detail, it wasn't (meant as) a breaking change, rather a refactoring. The only (accidental, I suppose) breaking change is that the Apache receiver's default collection interval has changed from 10s to 60s. This should probably be fixed in a future PR.

@andrzej-stencel
Copy link
Member

Shouldn't we mention the new config property initial_interval in each affected receiver's docs?

@@ -32,9 +32,7 @@ func NewFactory() receiver.Factory {

func createDefaultConfig() component.Config {
return &Config{
ScraperControllerSettings: scraperhelper.ScraperControllerSettings{
CollectionInterval: 10 * time.Second,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was missed and effectively the Apache receiver's default collection interval has changed from 10s to 60s?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shit, I can revert in a follow up PR.

ScraperControllerSettings: scraperhelper.ScraperControllerSettings{
CollectionInterval: defaultCollectionInterval,
},
ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The defaultCollectionInterval const defined above is now left unused. This could trick someone trying to change it and seeing no effect. We should remove that const.

@MovieStoreGuy
Copy link
Contributor Author

Shouldn't we mention the new config property initial_interval in each affected receiver's docs?

Let me make an entry in the new release

@andrzej-stencel
Copy link
Member

Shouldn't we mention the new config property initial_interval in each affected receiver's docs?

My bad, this does not belong in this PR. The initial_interval should be added to receivers' docs in a separate contrib PR, only after this core PR is merged:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants