From eb181e163273e46fd02a3af123cf69d331957a80 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Thu, 18 Jun 2020 16:21:53 -0400 Subject: [PATCH] chore: fix markdown linting and add npm script --- .github/ISSUE_TEMPLATE/bug_report.md | 7 ++----- .github/ISSUE_TEMPLATE/feature_request.md | 11 +++++++---- .github/ISSUE_TEMPLATE/plugin_request.md | 17 +++++++++++------ .markdownlint.json | 3 ++- examples/tracer-web/README.md | 1 - metapackages/plugins-node-all/README.md | 2 ++ package.json | 11 +++++++---- .../opentelemetry-exporter-collector/README.md | 2 ++ packages/opentelemetry-plugin-fetch/README.md | 3 +++ packages/opentelemetry-plugin-grpc-js/README.md | 7 +++++-- 10 files changed, 41 insertions(+), 23 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index aa97c7d1a0..227235924d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,19 +8,16 @@ Please answer these questions before submitting a bug report. ### What version of OpenTelemetry are you using? - ### What version of Node are you using? - ### What did you do? -If possible, provide a recipe for reproducing the error. +If possible, provide a recipe for reproducing the error. ### What did you expect to see? - ### What did you see instead? - ### Additional context + Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 9f08ef1c10..f82363d9a2 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -6,15 +6,18 @@ labels: feature-request **NB:** Before opening a feature request against this repo, consider whether the feature should/could be implemented in the [other OpenTelemetry client libraries](https://github.com/open-telemetry/). If so, please [open an issue on opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification/issues/new) first. +### Is your feature request related to a problem? Please describe. -**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -**Describe the solution you'd like** +### Describe the solution you'd like + A clear and concise description of what you want to happen. -**Describe alternatives you've considered** +### Describe alternatives you've considered + A clear and concise description of any alternative solutions or features you've considered. -**Additional context** +### Additional context + Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/plugin_request.md b/.github/ISSUE_TEMPLATE/plugin_request.md index f6ef3905f3..3dfe243ab1 100644 --- a/.github/ISSUE_TEMPLATE/plugin_request.md +++ b/.github/ISSUE_TEMPLATE/plugin_request.md @@ -10,21 +10,26 @@ labels: plugin-request You are welcome to try out the [plugin api](https://github.com/open-telemetry/opentelemetry-js/blob/master/doc/plugin-guide.md) to build your own plugin. If you do try out the plugin api, please let us know if you have any questions/feedback. --> -**Is your plugin request related to a problem? Please describe.** +### Is your plugin request related to a problem? Please describe + -**Is it applicable for Node or Browser or both** +### Is it applicable for Node or Browser or both + +### Do you expect this plugin to be commonly used -**Do you expect this plugin to be commonly used** Weekly Downloads: -**What version of plugin are you interested in using** +### What version of plugin are you interested in using + Versions: -**Additional context** +### Additional context + -- **Is there a reference you could point for the well-defined lifecycle methods** + +#### Is there a reference you could point for the well-defined lifecycle methods** diff --git a/.markdownlint.json b/.markdownlint.json index 484d3db4c0..6208ac19f1 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -2,5 +2,6 @@ "MD013": false, "MD024": false, "MD033": false, - "MD041": false + "MD041": false, + "MD026": false } diff --git a/examples/tracer-web/README.md b/examples/tracer-web/README.md index 1807e013e7..c14c27aa31 100644 --- a/examples/tracer-web/README.md +++ b/examples/tracer-web/README.md @@ -35,7 +35,6 @@ The screen will look as follows: ![Screenshot of the running example](images/xml-http-request.png) - ### Fetch To see the results, open the browser at and make sure you have the browser console open. The application is using the `ConsoleSpanExporter` and will post the created spans to the browser console. diff --git a/metapackages/plugins-node-all/README.md b/metapackages/plugins-node-all/README.md index 3b63827b5b..d5c3fec46b 100644 --- a/metapackages/plugins-node-all/README.md +++ b/metapackages/plugins-node-all/README.md @@ -1,4 +1,5 @@ # OpenTelemetry Plugins Node Core + [![Gitter chat][gitter-image]][gitter-url] [![NPM Published Version][npm-img]][npm-url] [![dependencies][dependencies-image]][dependencies-url] @@ -22,6 +23,7 @@ In addition to all [node core plugins][otel-plugins-node-core], the following pl Note: [@opentelemetry/plugin-dns][otel-plugin-dns] is excluded by default because it requires some manual configuration to prevent infinite loops with exporters. ## Useful links + - For more information on OpenTelemetry, visit: - For more about OpenTelemetry JavaScript: - For help or feedback on this project, join us on [gitter][gitter-url] diff --git a/package.json b/package.json index ff88fb72e3..b79b7ff195 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ "lint": "lerna run lint", "lint:fix": "lerna run lint:fix", "lint:examples": "eslint ./examples/**/*.js", - "lint:examples:fix": "eslint ./examples/**/*.js --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" }, "repository": "open-telemetry/opentelemetry-js", "keywords": [ @@ -40,19 +42,20 @@ "devDependencies": { "@commitlint/cli": "8.3.5", "@commitlint/config-conventional": "8.3.4", + "@typescript-eslint/eslint-plugin": "3.3.0", + "@typescript-eslint/parser": "3.3.0", "beautify-benchmark": "0.2.4", "benchmark": "2.1.4", "eslint": "7.2.0", "eslint-config-airbnb-base": "14.2.0", - "eslint-plugin-import": "2.21.2", "eslint-plugin-header": "3.0.0", - "@typescript-eslint/eslint-plugin": "3.3.0", - "@typescript-eslint/parser": "3.3.0", + "eslint-plugin-import": "2.21.2", "gh-pages": "3.0.0", "gts": "2.0.2", "husky": "4.2.5", "lerna": "3.22.1", "lerna-changelog": "1.0.1", + "markdownlint-cli": "0.23.1", "typescript": "3.9.5" }, "husky": { diff --git a/packages/opentelemetry-exporter-collector/README.md b/packages/opentelemetry-exporter-collector/README.md index 63fa55d13b..6a8b828056 100644 --- a/packages/opentelemetry-exporter-collector/README.md +++ b/packages/opentelemetry-exporter-collector/README.md @@ -15,6 +15,7 @@ npm install --save @opentelemetry/exporter-collector ``` ## Usage in Web + The CollectorExporter in Web expects the endpoint to end in `/v1/trace`. ```js @@ -36,6 +37,7 @@ provider.register(); ``` ## Usage in Node + The CollectorExporter in Node expects the URL to only be the hostname. It will not work with `/v1/trace`. ```js diff --git a/packages/opentelemetry-plugin-fetch/README.md b/packages/opentelemetry-plugin-fetch/README.md index cdbbce00e8..10e81fb381 100644 --- a/packages/opentelemetry-plugin-fetch/README.md +++ b/packages/opentelemetry-plugin-fetch/README.md @@ -1,4 +1,5 @@ # OpenTelemetry Fetch Instrumentation for web + [![Gitter chat][gitter-image]][gitter-url] [![NPM Published Version][npm-img]][npm-url] [![dependencies][dependencies-image]][dependencies-url] @@ -41,6 +42,7 @@ fetch('http://localhost:8090/fetch.js'); ``` ## Example Screenshots + ![Screenshot of the running example](images/trace1.png) ![Screenshot of the running example](images/trace2.png) ![Screenshot of the running example](images/trace3.png) @@ -48,6 +50,7 @@ fetch('http://localhost:8090/fetch.js'); See [examples/tracer-web/fetch](https://github.com/open-telemetry/opentelemetry-js/tree/master/examples/tracer-web) for a short example. ## Useful links + - For more information on OpenTelemetry, visit: - For more about OpenTelemetry JavaScript: - For help or feedback on this project, join us on [gitter][gitter-url] diff --git a/packages/opentelemetry-plugin-grpc-js/README.md b/packages/opentelemetry-plugin-grpc-js/README.md index c46aff6b4e..4206a3050c 100644 --- a/packages/opentelemetry-plugin-grpc-js/README.md +++ b/packages/opentelemetry-plugin-grpc-js/README.md @@ -1,4 +1,5 @@ # OpenTelemetry @grpc/grpc-js Instrumentation for Node.js + [![Gitter chat][gitter-image]][gitter-url] [![NPM Published Version][npm-img]][npm-url] [![dependencies][dependencies-image]][dependencies-url] @@ -12,7 +13,7 @@ For automatic instrumentation see the ## Installation -``` +```sh npm install --save @opentelemetry/plugin-grpc-js ``` @@ -21,6 +22,7 @@ npm install --save @opentelemetry/plugin-grpc-js OpenTelemetry gRPC Instrumentation allows the user to automatically collect trace data and export them to the backend of choice, to give observability to distributed systems when working with [gRPC](https://www.npmjs.com/package/@grpc/grpc-js). To load a specific plugin (**gRPC** in this case), specify it in the Node Tracer's configuration. + ```javascript const { NodeTracerProvider } = require('@opentelemetry/node'); @@ -36,6 +38,7 @@ const provider = new NodeTracerProvider({ ``` To load all of the [supported plugins](https://github.com/open-telemetry/opentelemetry-js#plugins), use below approach. Each plugin is only loaded when the module that it patches is loaded; in other words, there is no computational overhead for listing plugins for unused modules. + ```javascript const { NodeTracerProvider } = require('@opentelemetry/node'); @@ -44,8 +47,8 @@ const provider = new NodeTracerProvider(); - ## Useful links + - For more information on OpenTelemetry, visit: - For more about OpenTelemetry JavaScript: - For help or feedback on this project, join us on [gitter][gitter-url]