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

Getting Started Docs lead to TypeError Cannot read property 'ERROR' of undefined #2305

Closed
darrenparkinson opened this issue Jun 29, 2021 · 0 comments · Fixed by #2306
Closed
Assignees
Labels
bug Something isn't working

Comments

@darrenparkinson
Copy link

Please answer these questions before submitting a bug report.

What version of OpenTelemetry are you using?

  "dependencies": {
    "@opentelemetry/core": "^0.21.0",
    "@opentelemetry/metrics": "^0.21.0",
    "@opentelemetry/node": "^0.21.0",
    "@opentelemetry/plugin-express": "^0.15.0",
    "@opentelemetry/plugin-http": "^0.18.2",
    "@opentelemetry/plugin-https": "^0.18.2",
    "@opentelemetry/tracing": "^0.21.0",
    "express": "^4.17.1"
  }

What version of Node are you using?

$ node --version
v14.16.1

Please provide the code you used to setup the OpenTelemetry SDK

Copy / Pasted straight from the Getting Started docs:

const { LogLevel } = require("@opentelemetry/core");
const { NodeTracerProvider } = require("@opentelemetry/node");

console.log(LogLevel)

const provider = new NodeTracerProvider({
  logLevel: LogLevel.ERROR
});

provider.register();

What did you do?

I copy/pasted the docs from the website and followed directions on the website and it resulted in the error.

Page providing the docs:
https://github.com/open-telemetry/opentelemetry-js/blob/main/website_docs/getting_started/nodejs.md

Where the docs appear:
https://opentelemetry.io/docs/js/getting_started/nodejs/

What did you expect to see?

I expected the very first example of open telemetry I tried from the Getting Started guide to work.

What did you see instead?

This hot mess:

.../tracing.js:9
  logLevel: LogLevel.ERROR
                     ^

TypeError: Cannot read property 'ERROR' of undefined
    at Object.<anonymous> (.../tracing.js:9:22)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1217:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:449:5)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:76:3)
    at internal/main/run_main_module.js:7:1

Additional context

These docs are my first experience of Open Telemetry. The documentation there apparently comes from here and requires updating in order for them to be usable.

Many thanks.

@darrenparkinson darrenparkinson added the bug Something isn't working label Jun 29, 2021
@dyladan dyladan self-assigned this Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants