From 1c8d320bf60a84eca4886ff86b0591aa246ec80a Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Wed, 23 Jun 2021 18:28:48 +0200 Subject: [PATCH 1/7] chore: add eslint config to getting-started --- getting-started/.eslintrc | 17 +++++++++++++++++ getting-started/ts-example/.eslintrc | 16 ++++++++++++++++ package.json | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 getting-started/.eslintrc create mode 100644 getting-started/ts-example/.eslintrc diff --git a/getting-started/.eslintrc b/getting-started/.eslintrc new file mode 100644 index 0000000000..0cf74b0b83 --- /dev/null +++ b/getting-started/.eslintrc @@ -0,0 +1,17 @@ +{ + "env": { + "node": true + }, + "extends": "airbnb-base", + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "strict": ["error", "global"], + "no-use-before-define": ["error", "nofunc"], + "no-console": "off", + "import/no-unresolved": "off", + "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }] + }, + "ignorePatterns": "**/*_pb.js" +} diff --git a/getting-started/ts-example/.eslintrc b/getting-started/ts-example/.eslintrc new file mode 100644 index 0000000000..6564779085 --- /dev/null +++ b/getting-started/ts-example/.eslintrc @@ -0,0 +1,16 @@ +{ + "plugins": ["@typescript-eslint", "node"], + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + "parser": "@typescript-eslint/parser", + "rules": { + "@typescript-eslint/no-var-requires": 0, + "import/prefer-default-export": "off", + "import/extensions": [ + "error", + "ignorePackages", + { + "": "never" + } + ] + } +} diff --git a/package.json b/package.json index 93e932bc30..fe8ee22e16 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,8 @@ "lint:fix": "lerna run lint:fix", "lint:fix:changed": "lerna run --concurrency 1 --stream lint:fix --since HEAD --exclude-dependents", "lint:examples": "eslint ./examples/**/*.js", + "lint:getting-started": "eslint ./getting-started/**/*.{js,ts}", + "lint:getting-started:fix": "eslint ./getting-started/**/*.{js,ts} --fix", "lint:examples:fix": "eslint ./examples/**/*.js --fix", "lint:markdown": "./node_modules/.bin/markdownlint $(git ls-files '*.md') -i ./CHANGELOG.md", "lint:markdown:fix": "./node_modules/.bin/markdownlint $(git ls-files '*.md') -i ./CHANGELOG.md --fix", From 173e6872e5a9f22f7c7e29abdf316baefa1b0a61 Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Wed, 23 Jun 2021 18:29:10 +0200 Subject: [PATCH 2/7] chore: apply lint on getting-started --- getting-started/example/app.js | 24 +++++------ getting-started/monitored-example/app.js | 25 ++++++----- .../monitored-example/monitoring.js | 43 ++++++++----------- getting-started/traced-example/app.js | 24 +++++------ getting-started/traced-example/tracing.js | 18 ++++---- getting-started/ts-example/example/app.ts | 22 +++++----- .../ts-example/monitored-example/app.ts | 24 +++++------ .../monitored-example/monitoring.ts | 18 ++++---- .../ts-example/traced-example/app.ts | 22 +++++----- .../ts-example/traced-example/tracing.ts | 6 +-- 10 files changed, 106 insertions(+), 120 deletions(-) diff --git a/getting-started/example/app.js b/getting-started/example/app.js index 86c1a6e802..aa7a396362 100644 --- a/getting-started/example/app.js +++ b/getting-started/example/app.js @@ -1,40 +1,38 @@ -"use strict"; +const PORT = process.env.PORT || '8080'; -const PORT = process.env.PORT || "8080"; - -const express = require("express"); -const axios = require("axios"); +const express = require('express'); +const axios = require('axios'); const app = express(); -app.get("/", (req, res) => { +app.get('/', (req, res) => { axios .get(`http://localhost:${PORT}/middle-tier`) .then(() => axios.get(`http://localhost:${PORT}/middle-tier`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/middle-tier", (req, res) => { +app.get('/middle-tier', (req, res) => { axios .get(`http://localhost:${PORT}/backend`) .then(() => axios.get(`http://localhost:${PORT}/backend`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/backend", (req, res) => { - res.send("Hello from the backend"); +app.get('/backend', (req, res) => { + res.send('Hello from the backend'); }); app.listen(parseInt(PORT, 10), () => { diff --git a/getting-started/monitored-example/app.js b/getting-started/monitored-example/app.js index 2144423d6a..6189d314e8 100644 --- a/getting-started/monitored-example/app.js +++ b/getting-started/monitored-example/app.js @@ -1,42 +1,41 @@ -"use strict"; +const PORT = process.env.PORT || '8080'; -const PORT = process.env.PORT || "8080"; +const express = require('express'); +const axios = require('axios'); -const express = require("express"); -const axios = require("axios"); +const { countAllRequests } = require('./monitoring'); -const { countAllRequests } = require("./monitoring"); const app = express(); app.use(countAllRequests()); -app.get("/", (req, res) => { +app.get('/', (req, res) => { axios .get(`http://localhost:${PORT}/middle-tier`) .then(() => axios.get(`http://localhost:${PORT}/middle-tier`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/middle-tier", (req, res) => { +app.get('/middle-tier', (req, res) => { axios .get(`http://localhost:${PORT}/backend`) .then(() => axios.get(`http://localhost:${PORT}/backend`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/backend", (req, res) => { - res.send("Hello from the backend"); +app.get('/backend', (req, res) => { + res.send('Hello from the backend'); }); app.listen(parseInt(PORT, 10), () => { diff --git a/getting-started/monitored-example/monitoring.js b/getting-started/monitored-example/monitoring.js index 4d01ccf675..425d3c7cb1 100644 --- a/getting-started/monitored-example/monitoring.js +++ b/getting-started/monitored-example/monitoring.js @@ -1,11 +1,9 @@ -"use strict"; - const { MeterProvider } = require('@opentelemetry/sdk-metrics-base'); const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus'); - -const prometheusPort = PrometheusExporter.DEFAULT_OPTIONS.port -const prometheusEndpoint = PrometheusExporter.DEFAULT_OPTIONS.endpoint - + +const prometheusPort = PrometheusExporter.DEFAULT_OPTIONS.port; +const prometheusEndpoint = PrometheusExporter.DEFAULT_OPTIONS.endpoint; + const exporter = new PrometheusExporter( { startServer: true, @@ -16,28 +14,25 @@ const exporter = new PrometheusExporter( ); }, ); - + const meter = new MeterProvider({ exporter, interval: 1000, }).getMeter('your-meter-name'); - -const requestCount = meter.createCounter("requests", { - description: "Count all incoming requests" + +const requestCount = meter.createCounter('requests', { + description: 'Count all incoming requests', }); - + const boundInstruments = new Map(); - -module.exports.countAllRequests = () => { - return (req, res, next) => { - if (!boundInstruments.has(req.path)) { - const labels = { route: req.path }; - const boundCounter = requestCount.bind(labels); - boundInstruments.set(req.path, boundCounter); - } - - boundInstruments.get(req.path).add(1); - next(); - }; -}; +module.exports.countAllRequests = () => (req, res, next) => { + if (!boundInstruments.has(req.path)) { + const labels = { route: req.path }; + const boundCounter = requestCount.bind(labels); + boundInstruments.set(req.path, boundCounter); + } + + boundInstruments.get(req.path).add(1); + next(); +}; diff --git a/getting-started/traced-example/app.js b/getting-started/traced-example/app.js index 86c1a6e802..aa7a396362 100644 --- a/getting-started/traced-example/app.js +++ b/getting-started/traced-example/app.js @@ -1,40 +1,38 @@ -"use strict"; +const PORT = process.env.PORT || '8080'; -const PORT = process.env.PORT || "8080"; - -const express = require("express"); -const axios = require("axios"); +const express = require('express'); +const axios = require('axios'); const app = express(); -app.get("/", (req, res) => { +app.get('/', (req, res) => { axios .get(`http://localhost:${PORT}/middle-tier`) .then(() => axios.get(`http://localhost:${PORT}/middle-tier`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/middle-tier", (req, res) => { +app.get('/middle-tier', (req, res) => { axios .get(`http://localhost:${PORT}/backend`) .then(() => axios.get(`http://localhost:${PORT}/backend`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/backend", (req, res) => { - res.send("Hello from the backend"); +app.get('/backend', (req, res) => { + res.send('Hello from the backend'); }); app.listen(parseInt(PORT, 10), () => { diff --git a/getting-started/traced-example/tracing.js b/getting-started/traced-example/tracing.js index 3508c1a0f2..140972db05 100644 --- a/getting-started/traced-example/tracing.js +++ b/getting-started/traced-example/tracing.js @@ -1,18 +1,16 @@ -"use strict"; - -const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node"); -const { SimpleSpanProcessor } = require("@opentelemetry/sdk-trace-base"); +const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); +const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base'); const { Resource } = require('@opentelemetry/resources'); const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); -const { ZipkinExporter } = require("@opentelemetry/exporter-zipkin"); +const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin'); const { registerInstrumentations } = require('@opentelemetry/instrumentation'); const { ExpressInstrumentation } = require('@opentelemetry/instrumentation-express'); const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http'); const provider = new NodeTracerProvider({ resource: new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: "getting-started", - }) + [SemanticResourceAttributes.SERVICE_NAME]: 'getting-started', + }), }); provider.addSpanProcessor( @@ -21,8 +19,8 @@ provider.addSpanProcessor( // If you are running your tracing backend on another host, // you can point to it using the `url` parameter of the // exporter config. - }) - ) + }), + ), ); provider.register(); @@ -35,4 +33,4 @@ registerInstrumentations({ ], }); -console.log("tracing initialized"); +console.log('tracing initialized'); diff --git a/getting-started/ts-example/example/app.ts b/getting-started/ts-example/example/app.ts index e4267e1421..a252668ebe 100644 --- a/getting-started/ts-example/example/app.ts +++ b/getting-started/ts-example/example/app.ts @@ -1,38 +1,38 @@ -import * as express from "express"; -import axios from "axios"; +import * as express from 'express'; +import axios from 'axios'; -const PORT: string = process.env.PORT || "8080"; +const PORT: string = process.env.PORT || '8080'; const app = express(); -app.get("/", (req, res) => { +app.get('/', (req, res) => { axios .get(`http://localhost:${PORT}/middle-tier`) .then(() => axios.get(`http://localhost:${PORT}/middle-tier`)) - .then(response => { + .then((response) => { res.send(response.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/middle-tier", (req, res) => { +app.get('/middle-tier', (req, res) => { axios .get(`http://localhost:${PORT}/backend`) .then(() => axios.get(`http://localhost:${PORT}/backend`)) - .then(response => { + .then((response) => { res.send(response.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/backend", (req, res) => { - res.send("Hello from the backend"); +app.get('/backend', (req, res) => { + res.send('Hello from the backend'); }); app.listen(parseInt(PORT, 10), () => { diff --git a/getting-started/ts-example/monitored-example/app.ts b/getting-started/ts-example/monitored-example/app.ts index 047c263836..9307eba1ac 100644 --- a/getting-started/ts-example/monitored-example/app.ts +++ b/getting-started/ts-example/monitored-example/app.ts @@ -1,40 +1,40 @@ -import * as express from "express"; -import axios from "axios"; - -const PORT: string = process.env.PORT || "8080"; +import * as express from 'express'; +import axios from 'axios'; import { countAllRequests } from './monitoring'; + +const PORT: string = process.env.PORT || '8080'; const app = express(); app.use(countAllRequests()); -app.get("/", (req, res) => { +app.get('/', (req, res) => { axios .get(`http://localhost:${PORT}/middle-tier`) .then(() => axios.get(`http://localhost:${PORT}/middle-tier`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/middle-tier", (req, res) => { +app.get('/middle-tier', (req, res) => { axios .get(`http://localhost:${PORT}/backend`) .then(() => axios.get(`http://localhost:${PORT}/backend`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/backend", (req, res) => { - res.send("Hello from the backend"); +app.get('/backend', (req, res) => { + res.send('Hello from the backend'); }); app.listen(parseInt(PORT, 10), () => { diff --git a/getting-started/ts-example/monitored-example/monitoring.ts b/getting-started/ts-example/monitored-example/monitoring.ts index 626cc76323..5e933e4a93 100644 --- a/getting-started/ts-example/monitored-example/monitoring.ts +++ b/getting-started/ts-example/monitored-example/monitoring.ts @@ -27,15 +27,13 @@ const requestCount = meter.createCounter('requests', { const handles = new Map(); -export const countAllRequests = () => { - return (req: Request, _res: Response, next: NextFunction) => { - if (!handles.has(req.path)) { - const labels = { route: req.path }; - const handle = requestCount.bind(labels); - handles.set(req.path, handle); - } +export const countAllRequests = () => (req: Request, _res: Response, next: NextFunction): void => { + if (!handles.has(req.path)) { + const labels = { route: req.path }; + const handle = requestCount.bind(labels); + handles.set(req.path, handle); + } - handles.get(req.path).add(1); - next(); - }; + handles.get(req.path).add(1); + next(); }; diff --git a/getting-started/ts-example/traced-example/app.ts b/getting-started/ts-example/traced-example/app.ts index 41b6a43394..58fb8ab589 100644 --- a/getting-started/ts-example/traced-example/app.ts +++ b/getting-started/ts-example/traced-example/app.ts @@ -1,38 +1,38 @@ -import * as express from "express"; -import axios from "axios"; +import * as express from 'express'; +import axios from 'axios'; -const PORT: string = process.env.PORT || "8080"; +const PORT: string = process.env.PORT || '8080'; const app = express(); -app.get("/", (req, res) => { +app.get('/', (req, res) => { axios .get(`http://localhost:${PORT}/middle-tier`) .then(() => axios.get(`http://localhost:${PORT}/middle-tier`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/middle-tier", (req, res) => { +app.get('/middle-tier', (req, res) => { axios .get(`http://localhost:${PORT}/backend`) .then(() => axios.get(`http://localhost:${PORT}/backend`)) - .then(result => { + .then((result) => { res.send(result.data); }) - .catch(err => { + .catch((err) => { console.error(err); res.status(500).send(); }); }); -app.get("/backend", (req, res) => { - res.send("Hello from the backend"); +app.get('/backend', (req, res) => { + res.send('Hello from the backend'); }); app.listen(parseInt(PORT, 10), () => { diff --git a/getting-started/ts-example/traced-example/tracing.ts b/getting-started/ts-example/traced-example/tracing.ts index fe2ce7e4b2..4426da25f9 100644 --- a/getting-started/ts-example/traced-example/tracing.ts +++ b/getting-started/ts-example/traced-example/tracing.ts @@ -1,9 +1,10 @@ import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; -const { Resource } = require('@opentelemetry/resources'); -const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base'; import { ZipkinExporter } from '@opentelemetry/exporter-zipkin'; + +const { Resource } = require('@opentelemetry/resources'); +const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); // For Jaeger, use the following line instead: // import { JaegerExporter } from '@opentelemetry/exporter-jaeger'; @@ -36,5 +37,4 @@ registerInstrumentations({ ], }); - console.log('tracing initialized'); From d0a11c3bead851da5d85aec0609aa9d3b0de2fe7 Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Sat, 26 Jun 2021 11:58:17 +0200 Subject: [PATCH 3/7] chore: fix strict rule in getting-started lint config --- getting-started/.eslintrc | 9 ++++----- getting-started/example/app.js | 2 ++ getting-started/monitored-example/app.js | 2 ++ getting-started/monitored-example/monitoring.js | 2 ++ getting-started/traced-example/app.js | 2 ++ getting-started/traced-example/tracing.js | 2 ++ 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/getting-started/.eslintrc b/getting-started/.eslintrc index 0cf74b0b83..6b385b6215 100644 --- a/getting-started/.eslintrc +++ b/getting-started/.eslintrc @@ -4,14 +4,13 @@ }, "extends": "airbnb-base", "parserOptions": { - "sourceType": "module" + "sourceType": "script" }, "rules": { - "strict": ["error", "global"], "no-use-before-define": ["error", "nofunc"], "no-console": "off", "import/no-unresolved": "off", - "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }] - }, - "ignorePatterns": "**/*_pb.js" + "no-unused-vars": ["error"], + "strict": ["error", "global"] + } } diff --git a/getting-started/example/app.js b/getting-started/example/app.js index aa7a396362..287ab78cb3 100644 --- a/getting-started/example/app.js +++ b/getting-started/example/app.js @@ -1,3 +1,5 @@ +'use strict'; + const PORT = process.env.PORT || '8080'; const express = require('express'); diff --git a/getting-started/monitored-example/app.js b/getting-started/monitored-example/app.js index 6189d314e8..af61cef67e 100644 --- a/getting-started/monitored-example/app.js +++ b/getting-started/monitored-example/app.js @@ -1,3 +1,5 @@ +'use strict'; + const PORT = process.env.PORT || '8080'; const express = require('express'); diff --git a/getting-started/monitored-example/monitoring.js b/getting-started/monitored-example/monitoring.js index 425d3c7cb1..ca20e8d2fd 100644 --- a/getting-started/monitored-example/monitoring.js +++ b/getting-started/monitored-example/monitoring.js @@ -1,3 +1,5 @@ +'use strict'; + const { MeterProvider } = require('@opentelemetry/sdk-metrics-base'); const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus'); diff --git a/getting-started/traced-example/app.js b/getting-started/traced-example/app.js index aa7a396362..287ab78cb3 100644 --- a/getting-started/traced-example/app.js +++ b/getting-started/traced-example/app.js @@ -1,3 +1,5 @@ +'use strict'; + const PORT = process.env.PORT || '8080'; const express = require('express'); diff --git a/getting-started/traced-example/tracing.js b/getting-started/traced-example/tracing.js index 140972db05..ae6b88b015 100644 --- a/getting-started/traced-example/tracing.js +++ b/getting-started/traced-example/tracing.js @@ -1,3 +1,5 @@ +'use strict'; + const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base'); const { Resource } = require('@opentelemetry/resources'); From 0403b722d7f4e33eb179f13418e53f7c95d37d3e Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Tue, 3 Aug 2021 15:25:38 +0200 Subject: [PATCH 4/7] chore: import examples eslintrc for getting-started eslint config --- examples/{.eslintrc => .eslintrc.json} | 0 getting-started/.eslintrc | 16 ---------------- getting-started/.eslintrc.js | 6 ++++++ 3 files changed, 6 insertions(+), 16 deletions(-) rename examples/{.eslintrc => .eslintrc.json} (100%) delete mode 100644 getting-started/.eslintrc create mode 100644 getting-started/.eslintrc.js diff --git a/examples/.eslintrc b/examples/.eslintrc.json similarity index 100% rename from examples/.eslintrc rename to examples/.eslintrc.json diff --git a/getting-started/.eslintrc b/getting-started/.eslintrc deleted file mode 100644 index 6b385b6215..0000000000 --- a/getting-started/.eslintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "node": true - }, - "extends": "airbnb-base", - "parserOptions": { - "sourceType": "script" - }, - "rules": { - "no-use-before-define": ["error", "nofunc"], - "no-console": "off", - "import/no-unresolved": "off", - "no-unused-vars": ["error"], - "strict": ["error", "global"] - } -} diff --git a/getting-started/.eslintrc.js b/getting-started/.eslintrc.js new file mode 100644 index 0000000000..8580fbfb04 --- /dev/null +++ b/getting-started/.eslintrc.js @@ -0,0 +1,6 @@ +/* eslint-disable global-require */ +/* eslint-disable strict */ + +module.exports = { + ...require('../examples/.eslintrc.json'), +}; From e82df3e0e0dc369d26faa4fea6c8f1d4ac5fd47d Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Sun, 8 Aug 2021 17:45:50 +0200 Subject: [PATCH 5/7] chore: rearrage lint scripts in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fe8ee22e16..2d933cfcfe 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,9 @@ "lint:fix": "lerna run lint:fix", "lint:fix:changed": "lerna run --concurrency 1 --stream lint:fix --since HEAD --exclude-dependents", "lint:examples": "eslint ./examples/**/*.js", + "lint:examples:fix": "eslint ./examples/**/*.js --fix", "lint:getting-started": "eslint ./getting-started/**/*.{js,ts}", "lint:getting-started:fix": "eslint ./getting-started/**/*.{js,ts} --fix", - "lint:examples:fix": "eslint ./examples/**/*.js --fix", "lint:markdown": "./node_modules/.bin/markdownlint $(git ls-files '*.md') -i ./CHANGELOG.md", "lint:markdown:fix": "./node_modules/.bin/markdownlint $(git ls-files '*.md') -i ./CHANGELOG.md --fix", "reset": "lerna clean -y && rm -rf node_modules && npm i && npm run compile && npm run lint:fix" From a0344412e230ae1596cc23d1405e172799145148 Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Sun, 8 Aug 2021 17:46:20 +0200 Subject: [PATCH 6/7] chore: restore removed require from getting-started example --- getting-started/ts-example/traced-example/tracing.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/getting-started/ts-example/traced-example/tracing.ts b/getting-started/ts-example/traced-example/tracing.ts index 4426da25f9..d42a5fb117 100644 --- a/getting-started/ts-example/traced-example/tracing.ts +++ b/getting-started/ts-example/traced-example/tracing.ts @@ -3,6 +3,7 @@ import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base'; import { ZipkinExporter } from '@opentelemetry/exporter-zipkin'; +const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); const { Resource } = require('@opentelemetry/resources'); const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); // For Jaeger, use the following line instead: From 7caebe4aea03a41ba10cddd2a1beb92000b731f0 Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Sun, 8 Aug 2021 17:57:14 +0200 Subject: [PATCH 7/7] chore: remove duplicate require in getting-started --- getting-started/ts-example/traced-example/tracing.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/getting-started/ts-example/traced-example/tracing.ts b/getting-started/ts-example/traced-example/tracing.ts index d42a5fb117..4426da25f9 100644 --- a/getting-started/ts-example/traced-example/tracing.ts +++ b/getting-started/ts-example/traced-example/tracing.ts @@ -3,7 +3,6 @@ import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base'; import { ZipkinExporter } from '@opentelemetry/exporter-zipkin'; -const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); const { Resource } = require('@opentelemetry/resources'); const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); // For Jaeger, use the following line instead: