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: changing all env params to be required #1328

Merged
merged 3 commits into from
Jul 21, 2020

Conversation

obecny
Copy link
Member

@obecny obecny commented Jul 18, 2020

all env params with defaults should be changed to required

@codecov
Copy link

codecov bot commented Jul 18, 2020

Codecov Report

Merging #1328 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1328      +/-   ##
==========================================
- Coverage   92.29%   92.26%   -0.04%     
==========================================
  Files         180      178       -2     
  Lines        4452     4342     -110     
  Branches      928      896      -32     
==========================================
- Hits         4109     4006     -103     
+ Misses        343      336       -7     
Impacted Files Coverage Δ
opentelemetry-web/src/WebTracerProvider.ts
opentelemetry-web/src/StackContextManager.ts
opentelemetry-web/src/types.ts
opentelemetry-web/src/utils.ts
...ntelemetry-web/src/enums/PerformanceTimingNames.ts
...sync-hooks/src/AbstractAsyncHooksContextManager.ts 96.49% <0.00%> (ø)
...ontext-async-hooks/src/AsyncHooksContextManager.ts 100.00% <0.00%> (ø)
...async-hooks/src/AsyncLocalStorageContextManager.ts 100.00% <0.00%> (ø)

@naseemkullah
Copy link
Member

naseemkullah commented Jul 18, 2020

Just one question before moving forward with this:

do we:

  • want a default value for the env var if the user does not set the env var? (as per current PR and current behaviour of getEnv())
  • or do we actually want the values to be undefined if not user set, and then default values have to be dealt with in the various packages?

@obecny
Copy link
Member Author

obecny commented Jul 20, 2020

Just one question before moving forward with this:

do we:

  • want a default value for the env var if the user does not set the env var? (as per current PR and current behaviour of getEnv())

Yes we want to have logic in one place, instead of keeping this in many places including frontend and backend as well as in contrib repo. You want to make sure the env params will be ready to use across all different plugins / platforms etc. That was the whole purpose of having one class for getting the env. without worry of platform, extra checking etc.. So that the same params will be interpreted the same way everywhere.

@naseemkullah
Copy link
Member

Just one question before moving forward with this:
do we:

  • want a default value for the env var if the user does not set the env var? (as per current PR and current behaviour of getEnv())

Yes we want to have logic in one place, instead of keeping this in many places including frontend and backend as well as in contrib repo. You want to make sure the env params will be ready to use across all different plugins / platforms etc. That was the whole purpose of having one class for getting the env. without worry of platform, extra checking etc.. So that the same params will be interpreted the same way everywhere.

Ah I see, thanks for confirming.

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

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

LGTM. I have one non-blocking question. How do we want precedence to work when there is in-code configuration and environment variable configuration. If we decided we wanted environment variable configuration to take precedence over in-code configuration having values be unset would be meaningful.

@obecny
Copy link
Member Author

obecny commented Jul 21, 2020

LGTM. I have one non-blocking question. How do we want precedence to work when there is in-code configuration and environment variable configuration. If we decided we wanted environment variable configuration to take precedence over in-code configuration having values be unset would be meaningful.

Not sure if we already have a strategy for that but If I were to decide I would say the user inputs will always take precedence over env variable - user variable (config input) should wins

@dyladan
Copy link
Member

dyladan commented Jul 21, 2020

LGTM. I have one non-blocking question. How do we want precedence to work when there is in-code configuration and environment variable configuration. If we decided we wanted environment variable configuration to take precedence over in-code configuration having values be unset would be meaningful.

Not sure if we already have a strategy for that but If I were to decide I would say the user inputs will always take precedence over env variable - user variable (config input) should wins

Definitely agree in-code always takes precedence over env.

@obecny obecny merged commit 3bf4e54 into open-telemetry:master Jul 21, 2020
@obecny obecny deleted the env_required branch July 21, 2020 19:06
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
… fashion (open-telemetry#1328)

* Extract X-Ray header in a case-insensitive fashion

* Back to apostrophes

* Switch to 1 tab = 2 spaces

* Add semis

* Apply prettier to tests as well

* chore: fix lint

---------

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
martinkuba pushed a commit to martinkuba/opentelemetry-js that referenced this pull request Mar 13, 2024
… fashion (open-telemetry#1328)

* Extract X-Ray header in a case-insensitive fashion

* Back to apostrophes

* Switch to 1 tab = 2 spaces

* Add semis

* Apply prettier to tests as well

* chore: fix lint

---------

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
martinkuba pushed a commit to martinkuba/opentelemetry-js that referenced this pull request Mar 16, 2024
… fashion (open-telemetry#1328)

* Extract X-Ray header in a case-insensitive fashion

* Back to apostrophes

* Switch to 1 tab = 2 spaces

* Add semis

* Apply prettier to tests as well

* chore: fix lint

---------

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
martinkuba pushed a commit to martinkuba/opentelemetry-js that referenced this pull request Apr 2, 2024
… fashion (open-telemetry#1328)

* Extract X-Ray header in a case-insensitive fashion

* Back to apostrophes

* Switch to 1 tab = 2 spaces

* Add semis

* Apply prettier to tests as well

* chore: fix lint

---------

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
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.

5 participants