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

Internal:Fix environment variable for remote configuration polling interval #2967

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Jul 13, 2023

DD_REMOTE_CONFIGURATION_POLL_INTERVAL_SECONDS was changed to DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS.

Some new system-tests fail when enabled for Ruby because DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS is not processed by ddtrace, making the test timeout.

Also, this PR marks this setting as internal, because we don't have a valid use case for tweaking remote configuration pooling rate outside of testing purposes.

@marcotc marcotc requested a review from a team July 13, 2023 23:05
@marcotc marcotc self-assigned this Jul 13, 2023
@github-actions github-actions bot added the core Involves Datadog core libraries label Jul 13, 2023
@marcotc marcotc force-pushed the fix-remote-env-var branch from bfa8775 to 490d98b Compare July 13, 2023 23:06
@marcotc marcotc added dev/internal Other internal work that does not need to be included in the changelog and removed core Involves Datadog core libraries labels Jul 13, 2023
Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

👍 LGTM

Comment on lines 542 to 546
# Tune remote configuration polling interval.
#
# @default `DD_REMOTE_CONFIGURATION_POLL_INTERVAL_SECONDS` environment variable, otherwise `5.0` seconds.
# @default `DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS` environment variable, otherwise `5.0` seconds.
# @return [Float]
# @!visibility private
Copy link
Member

Choose a reason for hiding this comment

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

Should we document here a stronger "don't tune this, this setting is only used for internal validation and changing for other use-cases it is unsupported" or something like that?

Copy link
Member

Choose a reason for hiding this comment

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

Since this is only used from system tests and system tests only use ENV variables, we might get away by not exposing the setting at all.

We could read the ENV variable. here:

@worker = Worker.new(interval: settings.remote.poll_interval_seconds) do
and if it not present default to 5.0

That way, there is no need to document that is private we just make it private 😎

Copy link
Member

Choose a reason for hiding this comment

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

That's a good point, although you lose the consistency of always going through the settings. I guess we could at least move such settings to an internal or even debug group, if we wanted to still keep them.

Copy link
Member Author

Choose a reason for hiding this comment

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

I live having it go through settings for consistency. It will get better with configuration validation 😉.

I've added stronger wording for it being private.

Comment on lines 7 to +8
ENV_ENABLED = 'DD_REMOTE_CONFIGURATION_ENABLED'
ENV_POLL_INTERVAL_SECONDS = 'DD_REMOTE_CONFIGURATION_POLL_INTERVAL_SECONDS'
ENV_POLL_INTERVAL_SECONDS = 'DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS'
Copy link
Member

Choose a reason for hiding this comment

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

This makes this setting somewhat inconsistent with DD_REMOTE_CONFIGURATION_ENABLED. I've searched on github and it seems internally we have both DD_REMOTE_CONFIGURATION_ENABLED and DD_REMOTE_CONFIG_ENABLED...

Maybe worth raising with the remote config folks what they want to do about this?

Copy link
Member

Choose a reason for hiding this comment

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

I just asked on their Slack channel

Copy link
Member

@GustavoCaso GustavoCaso left a comment

Choose a reason for hiding this comment

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

LGTM. Left a comment on how to better hide this setting, but if we decide not to follow that path I'm happy with how it is right now 😄

@github-actions github-actions bot added the core Involves Datadog core libraries label Jul 14, 2023
@marcotc marcotc merged commit 838d12a into master Jul 14, 2023
@marcotc marcotc deleted the fix-remote-env-var branch July 14, 2023 21:46
@github-actions github-actions bot added this to the 1.13.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries dev/internal Other internal work that does not need to be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants