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

Allow span limits to be unset #1830

Closed
wants to merge 2 commits into from

Conversation

owais
Copy link
Contributor

@owais owais commented May 8, 2021

Description

Ths spec recommends most span limits to default to 128 and allow users
to change it via environment variables. It does not dictate that limits
should always be set though. So users should be able to remove these
limits. This commit accepts "none" as a valid value for the limit
config environment variables.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Added new tests

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@owais owais requested review from a team, aabmass and lzchen and removed request for a team May 8, 2021 09:47
@owais owais force-pushed the allow-to-unset-limits branch from 1fd299e to 2f0ef46 Compare May 8, 2021 09:49
@srikanthccv
Copy link
Member

Interesting, was there any use-case that inspired this change?

@owais
Copy link
Contributor Author

owais commented May 9, 2021

Yes, these limits do not work for some Splunk customers at least so Splunk distributions tend not to set them by default and let the users decide.

Copy link
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

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

Can you also add some sdk tests that patch env vars and assert?

@owais owais force-pushed the allow-to-unset-limits branch from 2f0ef46 to ea0f348 Compare May 10, 2021 18:01
Ths spec recommends most span limits to default to 128 and allow users
to change it via environment variables. It does not dictate that limits
should always be set though. So users should be able to remove these
limits. This commit accepts `"none"` as a valid value for the limit
config environment variables.
@owais owais force-pushed the allow-to-unset-limits branch from ea0f348 to 5e6a893 Compare May 10, 2021 18:36
_DEFAULT_SPAN_LIMIT = "128"


def _get_limit_from_env(limit_name) -> Optional[int]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of having an "unset" value, should we maybe allow users to specify a limit manually themselves through the span api? This follows the whole hardcoded -> env var -> default value priority architecture that we use in a lot of places for configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be very nice to have. Any configuration that happen automatically on importing modules should be moved to SDK initialization IMO. That said, this PR is merely allowing setting the limits to "none" in addition to integer values.

Created an issue to implement what you suggested: #1838

Will work on it soon but we shouldn't rush it into the release tomorrow.

@owais
Copy link
Contributor Author

owais commented May 11, 2021

superseded by #1839

@owais owais closed this May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants