diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index c78a412a05..6d44130a79 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -5,7 +5,7 @@
#####################################################
#
# Learn about membership in OpenTelemetry community:
-# https://github.com/open-telemetry/community/blob/master/community-membership.md
+# https://github.com/open-telemetry/community/blob/main/community-membership.md
#
#
# Learn about CODEOWNERS file format:
diff --git a/.github/ISSUE_TEMPLATE/plugin_request.md b/.github/ISSUE_TEMPLATE/plugin_request.md
index f6ef3905f3..67b61573e2 100644
--- a/.github/ISSUE_TEMPLATE/plugin_request.md
+++ b/.github/ISSUE_TEMPLATE/plugin_request.md
@@ -7,7 +7,7 @@ labels: plugin-request
**Is your plugin request related to a problem? Please describe.**
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 1430a81999..8a17e1d13d 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -5,9 +5,9 @@ Before creating a pull request, please make sure:
- Your PR is solving one problem
- Please provide enough information so that others can review your pull request
- You have read the guide for contributing
- - See https://github.com/open-telemetry/opentelemetry-js/blob/master/CONTRIBUTING.md
+ - See https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md
- You signed all your commits (otherwise we won't be able to merge the PR)
- - See https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#sign-the-cla
+ - See https://github.com/open-telemetry/community/blob/main/CONTRIBUTING.md#sign-the-cla
- You added unit tests for the new functionality
- You mention in the PR description which issue it is addressing, e.g. "Fixes #xxx". This will auto-close
the issue that your PR fixes (if such)
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 1299c32578..2c9d60566d 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,6 +1,10 @@
name: Lint
-on: [push, pull_request]
+on:
+ push:
+ branches:
+ - main
+ pull_request:
jobs:
build:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 68227b0d06..b1257bc332 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -201,4 +201,4 @@ Released 2020-04-27
Released 2020-04-08
-For details about this release and all previous releases, see https://github.com/open-telemetry/opentelemetry-js/blob/master/CHANGELOG.md
+For details about this release and all previous releases, see https://github.com/open-telemetry/opentelemetry-js/blob/main/CHANGELOG.md
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d4ecbe1610..59aac5e6d1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -16,7 +16,7 @@ Reporting bugs is an important contribution. Please make sure to include:
### Before you start
Please read project contribution
-[guide](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md)
+[guide](https://github.com/open-telemetry/community/blob/main/CONTRIBUTING.md)
for general practices for OpenTelemetry project.
#### Conventional commit
@@ -42,16 +42,16 @@ git remote add upstream https://github.com/open-telemetry/opentelemetry-js-contr
git remote -v
```
-To update your fork, fetch the upstream repo's branches and commits, then merge your master with upstream's master:
+To update your fork, fetch the upstream repo's branches and commits, then merge your main with upstream's main:
```
git fetch upstream
-git checkout master
-git merge upstream/master
+git checkout main
+git merge upstream/main
```
-Remember to always work in a branch of your local copy, as you might otherwise have to contend with conflicts in master.
+Remember to always work in a branch of your local copy, as you might otherwise have to contend with conflicts in main.
-Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#github-workflow) section of general project contributing guide.
+Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/main/CONTRIBUTING.md#github-workflow) section of general project contributing guide.
### Running the tests
diff --git a/README.md b/README.md
index 938a8e516c..4d6244703c 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
---
- Getting Started
+ Getting Started
•
API Documentation
•
@@ -13,10 +13,10 @@
-
+
-
+
@@ -115,25 +115,25 @@ We'd love your help!. Use tags [up-for-grabs][up-for-grabs-issues] and
Apache 2.0 - See [LICENSE][license-url] for more information.
[node-gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[up-for-grabs-issues]: https://github.com/open-telemetry/opentelemetry-js-contrib/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs
[good-first-issues]: https://github.com/open-telemetry/openTelemetry-js-contrib/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
-[otel-plugin-grpc]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-grpc
-[otel-plugin-http]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-http
-[otel-plugin-https]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-https
-[otel-plugin-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-dns
-[otel-plugin-document-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/web/opentelemetry-plugin-document-load
-[otel-plugin-react-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/web/opentelemetry-plugin-react-load
-[otel-plugin-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-ioredis
-[otel-plugin-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-mongodb
-[otel-plugin-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-mysql
-[otel-plugin-pg-pool]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-pg-pool
-[otel-plugin-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-pg
-[otel-plugin-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-redis
-[otel-plugin-user-interaction]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/web/opentelemetry-plugin-user-interaction
-[otel-plugin-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-xml-http-request
-[otel-plugin-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-express
-[otel-plugins-node-core-and-contrib]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/metapackages/plugins-node-core-and-contrib
-[otel-contrib-hapi-instrumentation]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-hapi-instrumentation
-[otel-contrib-koa-instrumentation]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-koa-instrumentation
-[otel-contrib-instrumentation-graphql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-graphql
+[otel-plugin-grpc]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-grpc
+[otel-plugin-http]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-http
+[otel-plugin-https]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-https
+[otel-plugin-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-dns
+[otel-plugin-document-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-plugin-document-load
+[otel-plugin-react-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-plugin-react-load
+[otel-plugin-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-ioredis
+[otel-plugin-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-mongodb
+[otel-plugin-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-mysql
+[otel-plugin-pg-pool]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-pg-pool
+[otel-plugin-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-pg
+[otel-plugin-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-redis
+[otel-plugin-user-interaction]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-plugin-user-interaction
+[otel-plugin-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-xml-http-request
+[otel-plugin-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-express
+[otel-plugins-node-core-and-contrib]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/plugins-node-core-and-contrib
+[otel-contrib-hapi-instrumentation]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-hapi-instrumentation
+[otel-contrib-koa-instrumentation]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-koa-instrumentation
+[otel-contrib-instrumentation-graphql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-graphql
diff --git a/RELEASING.md b/RELEASING.md
index 68b2f6c956..e124d0c6fc 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -16,7 +16,7 @@ Release Process:
## Update to latest locally
-Use `git fetch` and `git checkout origin/master` to ensure you’re on the latest commit. Make sure you have no unstaged changes. Ideally, also use `git clean -dfx` to remove all ignored and untracked files.
+Use `git fetch` and `git checkout origin/main` to ensure you’re on the latest commit. Make sure you have no unstaged changes. Ideally, also use `git clean -dfx` to remove all ignored and untracked files.
## Create a new branch
@@ -70,7 +70,7 @@ GITHUB_AUTH=xxxxx lerna-changelog --from=v1.0.0 --to=v2.0.0
From what `lerna-changelog` has generated, starts new Unreleased label. Follow the example set by recent Released label.
-On [GitHub Releases](https://github.com/open-telemetry/opentelemetry-js/releases), follow the example set by recent releases to populate a summary of changes, as well as a list of commits that were applied since the last release. Save it as a draft, don’t publish it. Don’t forget the tag -- call it `vx.y.z` and leave it pointing at `master` for now (this can be changed as long as the GitHub release isn’t published).
+On [GitHub Releases](https://github.com/open-telemetry/opentelemetry-js/releases), follow the example set by recent releases to populate a summary of changes, as well as a list of commits that were applied since the last release. Save it as a draft, don’t publish it. Don’t forget the tag -- call it `vx.y.z` and leave it pointing at `main` for now (this can be changed as long as the GitHub release isn’t published).
## Create a new PR
@@ -101,9 +101,9 @@ Publish the GitHub release, ensuring that the tag points to the newly landed com
## Update CHANGELOG
-* After releasing is done, update the [CHANGELOG.md](https://github.com/open-telemetry/opentelemetry-js/blob/master/CHANGELOG.md) and start new Unreleased label.
+* After releasing is done, update the [CHANGELOG.md](https://github.com/open-telemetry/opentelemetry-js/blob/main/CHANGELOG.md) and start new Unreleased label.
* Create a new commit with the exact title: `Post Release: update CHANGELOG.md`.
-* Go through PR review and merge it to GitHub master branch.
+* Go through PR review and merge it to GitHub main branch.
## Known Issues
diff --git a/examples/dns/README.md b/examples/dns/README.md
index 3d18e2816f..dc9f810edd 100644
--- a/examples/dns/README.md
+++ b/examples/dns/README.md
@@ -53,7 +53,7 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/express/README.md b/examples/express/README.md
index 317149d638..10fdc78c6c 100644
--- a/examples/express/README.md
+++ b/examples/express/README.md
@@ -69,7 +69,7 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/graphql/README.md b/examples/graphql/README.md
index 465439fd47..cc25573219 100644
--- a/examples/graphql/README.md
+++ b/examples/graphql/README.md
@@ -5,11 +5,11 @@ This example shows how to use 2 popular graphql servers
- [Apollo GraphQL](https://www.npmjs.com/package/apollo-server)
- [GraphQL HTTP Server Middleware](https://www.npmjs.com/package/express-graphql)
-and [@opentelemetry/instrumentation-graphql](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-instrumentation-graphql) to instrument a simple Node.js application.
+and [@opentelemetry/instrumentation-graphql](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-graphql) to instrument a simple Node.js application.
This instrumentation should work with any graphql server as it instruments graphql directly.
-This example will export spans data simultaneously using [Exporter Collector](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-exporter-collector).
+This example will export spans data simultaneously using [Exporter Collector](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-collector).
## Installation
diff --git a/examples/graphql/schema.js b/examples/graphql/schema.js
index be98379c40..e4903f76b6 100644
--- a/examples/graphql/schema.js
+++ b/examples/graphql/schema.js
@@ -3,7 +3,7 @@
const https = require('https');
const graphql = require('graphql');
-const url1 = 'https://raw.githubusercontent.com/open-telemetry/opentelemetry-js/master/package.json';
+const url1 = 'https://raw.githubusercontent.com/open-telemetry/opentelemetry-js/main/package.json';
function getData(url) {
return new Promise((resolve, reject) => {
diff --git a/examples/grpc-census-prop/README.md b/examples/grpc-census-prop/README.md
index d85f0446ff..ba70d2d1e7 100644
--- a/examples/grpc-census-prop/README.md
+++ b/examples/grpc-census-prop/README.md
@@ -11,7 +11,7 @@ that is already instrumented using OpenCensus.
If both sides of gRPC communication are using OpenTelemetry instrumentation then
the `propagator-grpc-census-binary` propagator isn't required. Context will be
propagated using the `traceparent` header (thanks to the
-[HttpTraceContext](https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-core/src/context/propagation/HttpTraceContext.ts)
+[HttpTraceContext](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-core/src/context/propagation/HttpTraceContext.ts)
propagator from opentelemetry-core). If there is a mix of OpenCensus and OpenTelemetry
instrumentation then the `propagator-grpc-census-binary` propagator allows OpenTelemetry
to propagate context through the `grpc-trace-bin` binary header.
@@ -123,7 +123,7 @@ See [combination4](./combination4.md) for example output
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/grpc_dynamic_codegen/README.md b/examples/grpc_dynamic_codegen/README.md
index a28d1c4238..f7f1f38310 100644
--- a/examples/grpc_dynamic_codegen/README.md
+++ b/examples/grpc_dynamic_codegen/README.md
@@ -53,7 +53,7 @@ Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/hapi/README.md b/examples/hapi/README.md
index 38bbf9f1dd..13ed19543b 100644
--- a/examples/hapi/README.md
+++ b/examples/hapi/README.md
@@ -69,7 +69,7 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/koa/README.md b/examples/koa/README.md
index 194542b9e7..d742289a03 100644
--- a/examples/koa/README.md
+++ b/examples/koa/README.md
@@ -69,7 +69,7 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/mongodb/README.md b/examples/mongodb/README.md
index 9958995d4d..cef079c078 100644
--- a/examples/mongodb/README.md
+++ b/examples/mongodb/README.md
@@ -67,7 +67,7 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/mysql/README.md b/examples/mysql/README.md
index ac25b27399..ad91495968 100644
--- a/examples/mysql/README.md
+++ b/examples/mysql/README.md
@@ -67,7 +67,7 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/postgres/README.md b/examples/postgres/README.md
index f82058f1bd..548938e0bb 100644
--- a/examples/postgres/README.md
+++ b/examples/postgres/README.md
@@ -98,7 +98,7 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/examples/react-load/preact/README.md b/examples/react-load/preact/README.md
index ef77db47de..7e6d14b303 100644
--- a/examples/react-load/preact/README.md
+++ b/examples/react-load/preact/README.md
@@ -60,6 +60,6 @@ After a few seconds (when the request is fulfilled):
Apache 2.0 - See [LICENSE][license-url] for more information.
-[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[otel]: https://opentelemetry.io/
-[otel-node]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node
\ No newline at end of file
+[otel-node]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node
\ No newline at end of file
diff --git a/examples/react-load/react/README.md b/examples/react-load/react/README.md
index 013c5c5656..e2a5696463 100644
--- a/examples/react-load/react/README.md
+++ b/examples/react-load/react/README.md
@@ -66,6 +66,6 @@ Since the example adds in a delay to the request, we can see that reflected in t
Apache 2.0 - See [LICENSE][license-url] for more information.
-[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[otel]: https://opentelemetry.io/
-[otel-node]: https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node
+[otel-node]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node
diff --git a/examples/redis/README.md b/examples/redis/README.md
index c74c033ae7..073a9396cb 100644
--- a/examples/redis/README.md
+++ b/examples/redis/README.md
@@ -99,7 +99,7 @@ Go to Jaeger with your browser [http://localhost:16686/trace/(your-trace-id)]()
## Useful links
- For more information on OpenTelemetry, visit:
-- For more information on OpenTelemetry for Node.js, visit:
+- For more information on OpenTelemetry for Node.js, visit:
## LICENSE
diff --git a/metapackages/plugins-node-core-and-contrib/README.md b/metapackages/plugins-node-core-and-contrib/README.md
index 7526f7e4aa..e7c5d2403c 100644
--- a/metapackages/plugins-node-core-and-contrib/README.md
+++ b/metapackages/plugins-node-core-and-contrib/README.md
@@ -34,7 +34,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=metapackages/plugins-node-core
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetryplugins-node-core
@@ -43,11 +43,11 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[otel-plugins-node-core]: https://www.npmjs.com/package/@opentelemetry/plugins-node-core
-[otel-plugin-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-dns
-[otel-plugin-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-express
-[otel-plugin-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-ioredis
-[otel-plugin-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-mongodb
-[otel-plugin-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-mysql
-[otel-plugin-pg-pool]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-pg-pool
-[otel-plugin-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-pg
-[otel-plugin-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-plugin-redis
+[otel-plugin-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-dns
+[otel-plugin-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-express
+[otel-plugin-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-ioredis
+[otel-plugin-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-mongodb
+[otel-plugin-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-mysql
+[otel-plugin-pg-pool]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-pg-pool
+[otel-plugin-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-pg
+[otel-plugin-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-plugin-redis
diff --git a/packages/opentelemetry-host-metrics/README.md b/packages/opentelemetry-host-metrics/README.md
index 681a612446..19f9007553 100644
--- a/packages/opentelemetry-host-metrics/README.md
+++ b/packages/opentelemetry-host-metrics/README.md
@@ -51,7 +51,7 @@ APACHE 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js-contrib.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib.svg?path=packages%2Fopentelemetry-host-metrics
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=packages%2Fopentelemetry-host-metrics
diff --git a/packages/opentelemetry-test-utils/testUtils.ts b/packages/opentelemetry-test-utils/testUtils.ts
index fc97a1bb30..e6d1918d73 100644
--- a/packages/opentelemetry-test-utils/testUtils.ts
+++ b/packages/opentelemetry-test-utils/testUtils.ts
@@ -15,7 +15,13 @@
*/
import * as childProcess from 'child_process';
-import { SpanKind, Attributes, Event, Span, Status } from '@opentelemetry/api';
+import {
+ SpanKind,
+ Attributes,
+ Span,
+ Status,
+ TimedEvent,
+} from '@opentelemetry/api';
import * as assert from 'assert';
import { ReadableSpan } from '@opentelemetry/tracing';
import {
@@ -78,7 +84,7 @@ export const assertSpan = (
span: ReadableSpan,
kind: SpanKind,
attributes: Attributes,
- events: Event[],
+ events: TimedEvent[],
status: Status
) => {
assert.strictEqual(span.spanContext.traceId.length, 32);
diff --git a/plugins/node/opentelemetry-hapi-instrumentation/README.md b/plugins/node/opentelemetry-hapi-instrumentation/README.md
index e8abaf98eb..ed9eb9e62e 100644
--- a/plugins/node/opentelemetry-hapi-instrumentation/README.md
+++ b/plugins/node/opentelemetry-hapi-instrumentation/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`Hapi`](https://hapi.dev).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -43,10 +43,10 @@ const { NodeTracerProvider } = require('@opentelemetry/node');
const provider = new NodeTracerProvider();
```
-See [examples/hapi](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/examples/hapi) for a short example using Hapi
+See [examples/hapi](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/hapi) for a short example using Hapi
## Hapi Instrumentation Support
-This package provides automatic tracing for hapi server routes and [request lifecycle](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle) extensions defined either directly or via a Hapi plugin.
+This package provides automatic tracing for hapi server routes and [request lifecycle](https://github.com/hapijs/hapi/blob/main/API.md#request-lifecycle) extensions defined either directly or via a Hapi plugin.
## Useful links
- For more information on OpenTelemetry, visit:
@@ -59,7 +59,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/status.svg?path=plugins/node/opentelemetry-hapi-instrumentation
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=plugins/node/opentelemetry-hapi-instrumentation
diff --git a/plugins/node/opentelemetry-hapi-instrumentation/src/hapi.ts b/plugins/node/opentelemetry-hapi-instrumentation/src/hapi.ts
index d02c4df80a..38978bc993 100644
--- a/plugins/node/opentelemetry-hapi-instrumentation/src/hapi.ts
+++ b/plugins/node/opentelemetry-hapi-instrumentation/src/hapi.ts
@@ -68,7 +68,7 @@ export class HapiInstrumentation extends BasePlugin {
// type definition for Hapi.Server. Hapi.Server (note the uppercase) can also function
// as a factory function, similarly to Hapi.server (lowercase), and so should
// also be supported and instrumented. This is an issue with the DefinitelyTyped repo.
- // Function is defined at: https://github.com/hapijs/hapi/blob/master/lib/index.js#L9
+ // Function is defined at: https://github.com/hapijs/hapi/blob/main/lib/index.js#L9
this._logger.debug('Patching Hapi.Server');
shimmer.wrap(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
diff --git a/plugins/node/opentelemetry-instrumentation-graphql/README.md b/plugins/node/opentelemetry-instrumentation-graphql/README.md
index 2340e81799..835a06e242 100644
--- a/plugins/node/opentelemetry-instrumentation-graphql/README.md
+++ b/plugins/node/opentelemetry-instrumentation-graphql/README.md
@@ -66,7 +66,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-instrumentation-graphql
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-instrumentation-graphql
diff --git a/plugins/node/opentelemetry-instrumentation-graphql/test/schema.ts b/plugins/node/opentelemetry-instrumentation-graphql/test/schema.ts
index a55982c6c6..f62b21f0d4 100644
--- a/plugins/node/opentelemetry-instrumentation-graphql/test/schema.ts
+++ b/plugins/node/opentelemetry-instrumentation-graphql/test/schema.ts
@@ -18,7 +18,7 @@ import * as https from 'https';
import * as graphql from 'graphql';
const url1 =
- 'https://raw.githubusercontent.com/open-telemetry/opentelemetry-js/master/package.json';
+ 'https://raw.githubusercontent.com/open-telemetry/opentelemetry-js/main/package.json';
function getData(url: string): any {
return new Promise((resolve, reject) => {
diff --git a/plugins/node/opentelemetry-koa-instrumentation/README.md b/plugins/node/opentelemetry-koa-instrumentation/README.md
index e1f17a9acb..64b13fec20 100644
--- a/plugins/node/opentelemetry-koa-instrumentation/README.md
+++ b/plugins/node/opentelemetry-koa-instrumentation/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`Koa`](https://github.com/koajs/koa).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -43,7 +43,7 @@ const { NodeTracerProvider } = require('@opentelemetry/node');
const provider = new NodeTracerProvider();
```
-See [examples/koa](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/examples/koa) for a short example using both Koa and @koa/router
+See [examples/koa](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/koa) for a short example using both Koa and @koa/router
## Koa Packages
@@ -60,7 +60,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/status.svg?path=plugins/node/opentelemetry-koa-instrumentation
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=plugins/node/opentelemetry-koa-instrumentation
diff --git a/plugins/node/opentelemetry-plugin-dns/README.md b/plugins/node/opentelemetry-plugin-dns/README.md
index d4ee247c9b..367885e87e 100644
--- a/plugins/node/opentelemetry-plugin-dns/README.md
+++ b/plugins/node/opentelemetry-plugin-dns/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`dns`](http://nodejs.org/dist/latest/docs/api/dns.html).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -55,7 +55,7 @@ Dns plugin has currently one option. You can set the following:
| Options | Type | Description |
| ------- | ---- | ----------- |
-| [`ignoreHostnames`](https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-plugin-dns/src/types.ts#L98) | `IgnoreMatcher[]` | Dns plugin will not trace all requests that match hostnames |
+| [`ignoreHostnames`](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-plugin-dns/src/types.ts#L98) | `IgnoreMatcher[]` | Dns plugin will not trace all requests that match hostnames |
## Useful links
- For more information on OpenTelemetry, visit:
@@ -68,7 +68,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-dns
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-dns
diff --git a/plugins/node/opentelemetry-plugin-express/README.md b/plugins/node/opentelemetry-plugin-express/README.md
index 0ad825f9b3..f65c96ad88 100644
--- a/plugins/node/opentelemetry-plugin-express/README.md
+++ b/plugins/node/opentelemetry-plugin-express/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`express`](https://github.com/expressjs/express).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -43,7 +43,7 @@ const { NodeTracerProvider } = require('@opentelemetry/node');
const provider = new NodeTracerProvider();
```
-See [examples/express](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/examples/express) for a short example.
+See [examples/express](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/express) for a short example.
### Caveats
@@ -74,7 +74,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-express
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-express
diff --git a/plugins/node/opentelemetry-plugin-express/src/types.ts b/plugins/node/opentelemetry-plugin-express/src/types.ts
index 051eed6431..1c6fac0a2f 100644
--- a/plugins/node/opentelemetry-plugin-express/src/types.ts
+++ b/plugins/node/opentelemetry-plugin-express/src/types.ts
@@ -43,7 +43,7 @@ export type PatchedRequest = {
} & Request;
export type PathParams = string | RegExp | Array;
-// https://github.com/expressjs/express/blob/master/lib/router/index.js#L53
+// https://github.com/expressjs/express/blob/main/lib/router/index.js#L53
export type ExpressRouter = {
params: { [key: string]: string };
_params: string[];
@@ -53,7 +53,7 @@ export type ExpressRouter = {
stack: ExpressLayer[];
};
-// https://github.com/expressjs/express/blob/master/lib/router/layer.js#L33
+// https://github.com/expressjs/express/blob/main/lib/router/layer.js#L33
export type ExpressLayer = {
handle: Function;
[kLayerPatched]?: boolean;
@@ -68,7 +68,7 @@ export type LayerMetadata = {
name: string;
};
-// https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-semantic-conventions.md#databases-client-calls
+// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/data-semantic-conventions.md#databases-client-calls
export enum AttributeNames {
COMPONENT = 'component',
HTTP_ROUTE = 'http.route',
@@ -85,7 +85,7 @@ export enum ExpressLayerType {
export type IgnoreMatcher = string | RegExp | ((name: string) => boolean);
/**
- * Options available for the Express Plugin (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-express#express-plugin-options))
+ * Options available for the Express Plugin (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-express#express-plugin-options))
*/
export interface ExpressPluginConfig extends PluginConfig {
/** Ignore specific based on their name */
diff --git a/plugins/node/opentelemetry-plugin-ioredis/README.md b/plugins/node/opentelemetry-plugin-ioredis/README.md
index 188a2f0669..c41c34f068 100644
--- a/plugins/node/opentelemetry-plugin-ioredis/README.md
+++ b/plugins/node/opentelemetry-plugin-ioredis/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`ioredis`](https://github.com/luin/ioredis).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -85,7 +85,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-ioredis
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-ioredis
diff --git a/plugins/node/opentelemetry-plugin-ioredis/src/types.ts b/plugins/node/opentelemetry-plugin-ioredis/src/types.ts
index b8d7aad62c..09246ace00 100644
--- a/plugins/node/opentelemetry-plugin-ioredis/src/types.ts
+++ b/plugins/node/opentelemetry-plugin-ioredis/src/types.ts
@@ -39,7 +39,7 @@ export type DbStatementSerializer = (
) => string;
/**
- * Options available for the IORedis Plugin (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-plugin-ioredis#ioredis-plugin-options))
+ * Options available for the IORedis Plugin (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-plugin-ioredis#ioredis-plugin-options))
*/
export interface IoredisPluginConfig extends PluginConfig {
/** Custom serializer function for the db.statement tag */
diff --git a/plugins/node/opentelemetry-plugin-ioredis/src/utils.ts b/plugins/node/opentelemetry-plugin-ioredis/src/utils.ts
index 58201d5009..bd7ec340a5 100644
--- a/plugins/node/opentelemetry-plugin-ioredis/src/utils.ts
+++ b/plugins/node/opentelemetry-plugin-ioredis/src/utils.ts
@@ -36,6 +36,7 @@ import {
const endSpan = (span: Span, err: NodeJS.ErrnoException | null | undefined) => {
if (err) {
+ span.recordException(err);
span.setStatus({
code: StatusCode.ERROR,
message: err.message,
@@ -116,7 +117,20 @@ export const traceSendCommand = (
try {
const result = original.apply(this, arguments);
- endSpan(span, null);
+
+ const origResolve = cmd.resolve;
+ /* eslint-disable @typescript-eslint/no-explicit-any */
+ cmd.resolve = function (result: any) {
+ endSpan(span, null);
+ origResolve(result);
+ };
+
+ const origReject = cmd.reject;
+ cmd.reject = function (err: Error) {
+ endSpan(span, err);
+ origReject(err);
+ };
+
return result;
} catch (error) {
endSpan(span, error);
diff --git a/plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts b/plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts
index 5027d992d3..fe570c1e17 100644
--- a/plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts
+++ b/plugins/node/opentelemetry-plugin-ioredis/test/ioredis.test.ts
@@ -28,6 +28,7 @@ import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks';
import * as testUtils from '@opentelemetry/test-utils';
import {
InMemorySpanExporter,
+ ReadableSpan,
SimpleSpanProcessor,
} from '@opentelemetry/tracing';
import * as assert from 'assert';
@@ -36,6 +37,7 @@ import { IORedisPlugin, plugin } from '../src';
import { IoredisPluginConfig, DbStatementSerializer } from '../src/types';
import {
DatabaseAttribute,
+ ExceptionAttribute,
GeneralAttribute,
} from '@opentelemetry/semantic-conventions';
@@ -59,6 +61,20 @@ const unsetStatus: Status = {
code: StatusCode.UNSET,
};
+const predictableStackTrace =
+ '-- Stack trace replaced by test to predictable value -- ';
+const sanitizeEventForAssertion = (span: ReadableSpan) => {
+ span.events.forEach(e => {
+ // stack trace includes data such as /user/{userName}/repos/{projectName}
+ if (e.attributes?.[ExceptionAttribute.STACKTRACE]) {
+ e.attributes[ExceptionAttribute.STACKTRACE] = predictableStackTrace;
+ }
+
+ // since time will change on each test invocation, it is being replaced to predicable value
+ e.time = [0, 0];
+ });
+};
+
describe('ioredis', () => {
const provider = new NodeTracerProvider();
let ioredis: typeof ioredisTypes;
@@ -131,9 +147,11 @@ describe('ioredis', () => {
assert.strictEqual(endedSpans.length, 3);
assert.strictEqual(endedSpans[2].name, 'test span');
- client.quit(done);
- assert.strictEqual(endedSpans.length, 4);
- assert.strictEqual(endedSpans[3].name, 'quit');
+ client.quit(() => {
+ assert.strictEqual(endedSpans.length, 4);
+ assert.strictEqual(endedSpans[3].name, 'quit');
+ done();
+ });
};
const errorHandler = (err: Error) => {
assert.ifError(err);
@@ -263,6 +281,38 @@ describe('ioredis', () => {
});
});
+ it('should set span with error when redis return reject', async () => {
+ const span = provider.getTracer('ioredis-test').startSpan('test span');
+ await context.with(setSpan(context.active(), span), async () => {
+ await client.set('non-int-key', 'non-int-value');
+ try {
+ // should throw 'ReplyError: ERR value is not an integer or out of range'
+ // because the value im the key is not numeric and we try to increment it
+ await client.incr('non-int-key');
+ } catch (ex) {
+ const endedSpans = memoryExporter.getFinishedSpans();
+ assert.strictEqual(endedSpans.length, 2);
+ const ioredisSpan = endedSpans[1];
+ // redis 'incr' operation failed with exception, so span should indicate it
+ assert.strictEqual(ioredisSpan.status.code, StatusCode.ERROR);
+ const exceptionEvent = ioredisSpan.events[0];
+ assert.strictEqual(exceptionEvent.name, 'exception');
+ assert.strictEqual(
+ exceptionEvent.attributes?.[ExceptionAttribute.MESSAGE],
+ ex.message
+ );
+ assert.strictEqual(
+ exceptionEvent.attributes?.[ExceptionAttribute.STACKTRACE],
+ ex.stack
+ );
+ assert.strictEqual(
+ exceptionEvent.attributes?.[ExceptionAttribute.TYPE],
+ ex.name
+ );
+ }
+ });
+ });
+
it('should create a child span for streamify scanning', done => {
const attributes = {
...DEFAULT_ATTRIBUTES,
@@ -322,10 +372,10 @@ describe('ioredis', () => {
const spanNames = [
'connect',
'connect',
- 'subscribe',
'info',
'info',
'subscribe',
+ 'subscribe',
'publish',
'publish',
'unsubscribe',
@@ -377,24 +427,48 @@ describe('ioredis', () => {
span.end();
const endedSpans = memoryExporter.getFinishedSpans();
+ const evalshaSpan = endedSpans[0];
// the script may be already cached on server therefore we get either 2 or 3 spans
if (endedSpans.length === 3) {
assert.strictEqual(endedSpans[2].name, 'test span');
assert.strictEqual(endedSpans[1].name, 'eval');
assert.strictEqual(endedSpans[0].name, 'evalsha');
+ // in this case, server returns NOSCRIPT error for evalsha,
+ // telling the client to use EVAL instead
+ sanitizeEventForAssertion(evalshaSpan);
+ testUtils.assertSpan(
+ evalshaSpan,
+ SpanKind.CLIENT,
+ attributes,
+ [
+ {
+ attributes: {
+ [ExceptionAttribute.MESSAGE]:
+ 'NOSCRIPT No matching script. Please use EVAL.',
+ [ExceptionAttribute.STACKTRACE]: predictableStackTrace,
+ [ExceptionAttribute.TYPE]: 'ReplyError',
+ },
+ name: 'exception',
+ time: [0, 0],
+ },
+ ],
+ {
+ code: StatusCode.ERROR,
+ }
+ );
} else {
assert.strictEqual(endedSpans.length, 2);
assert.strictEqual(endedSpans[1].name, 'test span');
assert.strictEqual(endedSpans[0].name, 'evalsha');
+ testUtils.assertSpan(
+ evalshaSpan,
+ SpanKind.CLIENT,
+ attributes,
+ [],
+ unsetStatus
+ );
}
- testUtils.assertSpan(
- endedSpans[0],
- SpanKind.CLIENT,
- attributes,
- [],
- unsetStatus
- );
- testUtils.assertPropagation(endedSpans[0], span);
+ testUtils.assertPropagation(evalshaSpan, span);
done();
});
});
diff --git a/plugins/node/opentelemetry-plugin-mongodb/README.md b/plugins/node/opentelemetry-plugin-mongodb/README.md
index 0d6650de6f..78971f6e55 100644
--- a/plugins/node/opentelemetry-plugin-mongodb/README.md
+++ b/plugins/node/opentelemetry-plugin-mongodb/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`mongodb`](https://github.com/mongodb/node-mongodb-native).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -43,7 +43,7 @@ const { NodeTracerProvider } = require('@opentelemetry/node');
const provider = new NodeTracerProvider();
```
-See [examples/mongodb](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/examples/mongodb) for a short example.
+See [examples/mongodb](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/mongodb) for a short example.
### Mongo Plugin Options
@@ -51,7 +51,7 @@ Mongodb plugin has few options available to choose from. You can set the followi
| Options | Type | Description |
| ------- | ---- | ----------- |
-| [`enhancedDatabaseReporting`](https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-api/src/trace/instrumentation/Plugin.ts#L91) | `string` | If true, additional information about query parameters and results will be attached (as `attributes`) to spans representing database operations |
+| [`enhancedDatabaseReporting`](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-api/src/trace/instrumentation/Plugin.ts#L91) | `string` | If true, additional information about query parameters and results will be attached (as `attributes`) to spans representing database operations |
@@ -67,7 +67,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-mongodb
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-mongodb
diff --git a/plugins/node/opentelemetry-plugin-mongodb/src/types.ts b/plugins/node/opentelemetry-plugin-mongodb/src/types.ts
index 928539c606..84393b4c43 100644
--- a/plugins/node/opentelemetry-plugin-mongodb/src/types.ts
+++ b/plugins/node/opentelemetry-plugin-mongodb/src/types.ts
@@ -25,7 +25,7 @@ export type MongoInternalCommand = {
q?: { [key: string]: unknown };
};
-// https://github.com/mongodb/node-mongodb-native/blob/master/lib/topologies/server.js#L179
+// https://github.com/mongodb/node-mongodb-native/blob/main/lib/topologies/server.js#L179
export type MongoInternalTopology = {
s?: {
// those are for mongodb@3
diff --git a/plugins/node/opentelemetry-plugin-mysql/README.md b/plugins/node/opentelemetry-plugin-mysql/README.md
index 1d83611281..2d44d297eb 100644
--- a/plugins/node/opentelemetry-plugin-mysql/README.md
+++ b/plugins/node/opentelemetry-plugin-mysql/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`mysql`](https://www.npmjs.com/package/mysql).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -44,7 +44,7 @@ const { NodeTracerProvider } = require('@opentelemetry/node');
const provider = new NodeTracerProvider();
```
-See [examples/mysql](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/examples/mysql) for a short example.
+See [examples/mysql](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/mysql) for a short example.
## Useful links
- For more information on OpenTelemetry, visit:
@@ -57,7 +57,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-mysql
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-mysql
diff --git a/plugins/node/opentelemetry-plugin-pg-pool/README.md b/plugins/node/opentelemetry-plugin-pg-pool/README.md
index e2a4cc21fa..c29fb4541e 100644
--- a/plugins/node/opentelemetry-plugin-pg-pool/README.md
+++ b/plugins/node/opentelemetry-plugin-pg-pool/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`pg`](https://github.com/brianc/node-postgres).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -47,7 +47,7 @@ const provider = new NodeTracerProvider({
});
```
-See [examples/postgres](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/examples/postgres) for a short example.
+See [examples/postgres](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/postgres) for a short example.
## Supported Versions
@@ -65,7 +65,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-pg-pool
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-pg-pool
diff --git a/plugins/node/opentelemetry-plugin-pg-pool/src/enums.ts b/plugins/node/opentelemetry-plugin-pg-pool/src/enums.ts
index 40bb4a0e8d..f2d96a9cd2 100644
--- a/plugins/node/opentelemetry-plugin-pg-pool/src/enums.ts
+++ b/plugins/node/opentelemetry-plugin-pg-pool/src/enums.ts
@@ -15,7 +15,7 @@
*/
export enum AttributeNames {
- // required by https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-database.md
+ // required by https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/data-database.md
COMPONENT = 'component',
DB_TYPE = 'db.type',
DB_INSTANCE = 'db.instance',
diff --git a/plugins/node/opentelemetry-plugin-pg/README.md b/plugins/node/opentelemetry-plugin-pg/README.md
index 3c58c814bb..270dccf607 100644
--- a/plugins/node/opentelemetry-plugin-pg/README.md
+++ b/plugins/node/opentelemetry-plugin-pg/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`pg`](https://github.com/brianc/node-postgres).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -63,7 +63,7 @@ const provider = new NodeTracerProvider({
});
```
-See [examples/postgres](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/examples/postgres) for a short example.
+See [examples/postgres](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/postgres) for a short example.
### PostgreSQL Plugin Options
@@ -71,7 +71,7 @@ PostgreSQL plugin has few options available to choose from. You can set the foll
| Options | Type | Description |
| ------- | ---- | ----------- |
-| [`enhancedDatabaseReporting`](https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-api/src/trace/instrumentation/Plugin.ts#L90) | `boolean` | If true, additional information about query parameters and results will be attached (as `attributes`) to spans representing database operations |
+| [`enhancedDatabaseReporting`](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-api/src/trace/instrumentation/Plugin.ts#L90) | `boolean` | If true, additional information about query parameters and results will be attached (as `attributes`) to spans representing database operations |
## Supported Versions
@@ -89,7 +89,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-pg
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-pg
diff --git a/plugins/node/opentelemetry-plugin-pg/src/enums.ts b/plugins/node/opentelemetry-plugin-pg/src/enums.ts
index 91aa855c4b..ee9f5d3682 100644
--- a/plugins/node/opentelemetry-plugin-pg/src/enums.ts
+++ b/plugins/node/opentelemetry-plugin-pg/src/enums.ts
@@ -15,7 +15,7 @@
*/
export enum AttributeNames {
- // required by https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-database.md
+ // required by https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/data-database.md
COMPONENT = 'component',
DB_TYPE = 'db.type',
DB_INSTANCE = 'db.instance',
diff --git a/plugins/node/opentelemetry-plugin-redis/README.md b/plugins/node/opentelemetry-plugin-redis/README.md
index c361fb2d94..af9fd0565b 100644
--- a/plugins/node/opentelemetry-plugin-redis/README.md
+++ b/plugins/node/opentelemetry-plugin-redis/README.md
@@ -7,7 +7,7 @@
This module provides automatic instrumentation for [`redis@^2.6.0`](https://github.com/NodeRedis/node_redis).
For automatic instrumentation see the
-[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.
+[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-node) package.
## Installation
@@ -44,7 +44,7 @@ const { NodeTracerProvider } = require('@opentelemetry/node');
const provider = new NodeTracerProvider();
```
-See [examples/redis](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/examples/redis) for a short example.
+See [examples/redis](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/redis) for a short example.
## Useful links
- For more information on OpenTelemetry, visit:
@@ -57,7 +57,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-image]: https://badges.gitter.im/open-telemetry/opentelemetry-js.svg
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
-[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
+[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-redis
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-redis
diff --git a/plugins/web/opentelemetry-plugin-document-load/README.md b/plugins/web/opentelemetry-plugin-document-load/README.md
index 374afa2ba5..88af4d8341 100644
--- a/plugins/web/opentelemetry-plugin-document-load/README.md
+++ b/plugins/web/opentelemetry-plugin-document-load/README.md
@@ -57,7 +57,7 @@ Because the browser does not send a trace context header for the initial page na