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

fix: ReferenceError when OTEL_TRACES_SAMPLER used without OTEL_TRACES_SAMPLER_ARG #2434

Merged
merged 1 commit into from Aug 27, 2021

Commits on Aug 27, 2021

  1. Fix ReferenceError

    When OTEL_TRACES_SAMPLER is used without OTEL_TRACES_SAMPLER_ARG there would be a ReferenceError due to getSamplerProbabilityFromEnv being called above the definition of DEFAULT_RATIO.
    
    ```
    ReferenceError: Cannot access 'DEFAULT_RATIO' before initialization
        at null.getSamplerProbabilityFromEnv (/app/node_modules/@opentelemetry/tracing/src/config.ts:91:58)
        at null.buildSamplerFromEnv (/app/node_modules/@opentelemetry/tracing/src/config.ts:71:44)
        at Object.<anonymous> (/app/node_modules/@opentelemetry/tracing/src/config.ts:38:12)
        at Module._compile (internal/modules/cjs/loader.js:1085:14)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
        at Module.load (internal/modules/cjs/loader.js:950:32)
        at Function.Module._load (internal/modules/cjs/loader.js:784:16)
        at Module.require (internal/modules/cjs/loader.js:974:19)
        at require (internal/modules/cjs/helpers.js:92:18)
        at Object.<anonymous> (/app/node_modules/@opentelemetry/tracing/src/utility.ts:17:1)```
    hermanbanken committed Aug 27, 2021
    Copy the full SHA
    ce7dfb1 View commit details
    Browse the repository at this point in the history