Skip to content

Commit

Permalink
Merge branch 'main' into feat/node/prom-client-implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
pikalovArtemN authored May 17, 2024
2 parents ade0ab9 + b41797b commit 7a98bfd
Show file tree
Hide file tree
Showing 333 changed files with 9,036 additions and 4,501 deletions.
2 changes: 1 addition & 1 deletion .github/component-label-map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pkg:instrumentation-bunyan:
- changed-files:
- any-glob-to-any-file:
- plugins/node/opentelemetry-instrumentation-bunyan/**
pkg:instrumentation-cassandra:
pkg:instrumentation-cassandra-driver:
- changed-files:
- any-glob-to-any-file:
- plugins/node/opentelemetry-instrumentation-cassandra/**
Expand Down
5 changes: 5 additions & 0 deletions .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ components:
- pichlermarc
- legendecas
- blumamir
packages/baggage-span-processor:
- mikegoldsmith
- jamiedanielson
packages/opentelemetry-host-metrics:
- legendecas
packages/opentelemetry-id-generator-aws-xray:
Expand Down Expand Up @@ -55,6 +58,8 @@ components:
- henrinormak
plugins/node/instrumentation-fs:
- rauno56
plugins/node/instrumentation-kafkajs:
- seemk
plugins/node/instrumentation-lru-memoizer:
- blumamir
plugins/node/instrumentation-mongoose:
Expand Down
5 changes: 5 additions & 0 deletions .github/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MD004 - Unordered list style
# This rule is triggered when the symbols used in the document for unordered list items do not match the configured unordered list style
# * Item 1 // Error: Unordered list style [Expected: dash; Actual: asterisk]
MD004:
style: dash
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- name: Lint markdown files
uses: avto-dev/markdown-lint@v1
with:
config: '.github/markdown-lint.yml'
ignore: "./**/CHANGELOG.md"
args: "./**/*.md"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
npm ci
- uses: google-github-actions/release-please-action@v4
- uses: googleapis/release-please-action@f3969c04a4ec81d7a9aa4010d84ae6a7602f86a7 # v4.1.1
id: release
with:
token: ${{secrets.RELEASE_PR_TOKEN}}
Expand Down Expand Up @@ -55,14 +55,14 @@ jobs:
# get main again
- name: Checkout Repository
# only checkout if a release has been created
if: ${{ steps.release.outputs.release_created }}
if: ${{ steps.release.outputs.releases_created }}
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Rebuild Packages
# only rebuild if a release has been created
if: ${{ steps.release.outputs.release_created }}
if: ${{ steps.release.outputs.releases_created }}
run: |
npm ci
npm run compile
Expand All @@ -72,7 +72,7 @@ jobs:
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
- name: Publish to npm
# only publish if a release has been created
if: ${{ steps.release.outputs.release_created }}
if: ${{ steps.release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes
4 changes: 2 additions & 2 deletions .github/workflows/test-all-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ["14", "16", "18.18.2"]
node: ["14", "16", "18", "20"]
runs-on: ubuntu-latest
services:
mongo:
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:15-alpine
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_DB: otel_pg_database
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ["14", "16", "18.18.2"]
node: ["14", "16", "18", "20"]
include:
- node: 18.18.2
- node: 18
code-coverage: true
runs-on: ubuntu-latest
services:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:15-alpine
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_DB: otel_pg_database
Expand Down
121 changes: 61 additions & 60 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
{
"detectors/node/opentelemetry-resource-detector-alibaba-cloud": "0.28.8",
"detectors/node/opentelemetry-resource-detector-aws": "1.4.1",
"detectors/node/opentelemetry-resource-detector-azure": "0.2.6",
"detectors/node/opentelemetry-resource-detector-container": "0.3.8",
"detectors/node/opentelemetry-resource-detector-gcp": "0.29.8",
"detectors/node/opentelemetry-resource-detector-github": "0.28.1",
"detectors/node/opentelemetry-resource-detector-instana": "0.8.0",
"metapackages/auto-instrumentations-node": "0.44.0",
"metapackages/auto-instrumentations-web": "0.38.0",
"packages/opentelemetry-host-metrics": "0.35.0",
"packages/opentelemetry-id-generator-aws-xray": "1.2.1",
"packages/opentelemetry-propagation-utils": "0.30.8",
"packages/opentelemetry-redis-common": "0.36.1",
"packages/opentelemetry-sql-common": "0.40.0",
"packages/opentelemetry-test-utils": "0.38.0",
"packages/winston-transport": "0.2.0",
"plugins/node/instrumentation-amqplib": "0.36.0",
"plugins/node/instrumentation-cucumber": "0.5.0",
"plugins/node/instrumentation-dataloader": "0.8.0",
"plugins/node/instrumentation-fs": "0.11.0",
"plugins/node/instrumentation-lru-memoizer": "0.36.0",
"plugins/node/instrumentation-mongoose": "0.37.0",
"plugins/node/instrumentation-runtime-node": "0.3.0",
"plugins/node/instrumentation-socket.io": "0.38.0",
"plugins/node/instrumentation-tedious": "0.9.0",
"plugins/node/instrumentation-undici": "0.1.0",
"plugins/node/opentelemetry-instrumentation-aws-lambda": "0.40.0",
"plugins/node/opentelemetry-instrumentation-aws-sdk": "0.40.0",
"plugins/node/opentelemetry-instrumentation-bunyan": "0.37.0",
"plugins/node/opentelemetry-instrumentation-cassandra": "0.37.0",
"plugins/node/opentelemetry-instrumentation-connect": "0.35.0",
"plugins/node/opentelemetry-instrumentation-dns": "0.35.0",
"plugins/node/opentelemetry-instrumentation-express": "0.37.0",
"plugins/node/opentelemetry-instrumentation-fastify": "0.35.0",
"plugins/node/opentelemetry-instrumentation-generic-pool": "0.35.0",
"plugins/node/opentelemetry-instrumentation-graphql": "0.39.0",
"plugins/node/opentelemetry-instrumentation-hapi": "0.36.0",
"plugins/node/opentelemetry-instrumentation-ioredis": "0.39.0",
"plugins/node/opentelemetry-instrumentation-knex": "0.35.0",
"plugins/node/opentelemetry-instrumentation-koa": "0.39.0",
"plugins/node/opentelemetry-instrumentation-memcached": "0.35.0",
"plugins/node/opentelemetry-instrumentation-mongodb": "0.42.0",
"plugins/node/opentelemetry-instrumentation-mysql": "0.37.0",
"plugins/node/opentelemetry-instrumentation-mysql2": "0.37.0",
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.36.0",
"plugins/node/opentelemetry-instrumentation-net": "0.35.0",
"plugins/node/opentelemetry-instrumentation-pg": "0.40.0",
"plugins/node/opentelemetry-instrumentation-pino": "0.37.0",
"plugins/node/opentelemetry-instrumentation-redis": "0.38.0",
"plugins/node/opentelemetry-instrumentation-redis-4": "0.38.0",
"plugins/node/opentelemetry-instrumentation-restify": "0.37.0",
"plugins/node/opentelemetry-instrumentation-router": "0.36.0",
"plugins/node/opentelemetry-instrumentation-winston": "0.36.0",
"plugins/web/opentelemetry-instrumentation-document-load": "0.37.0",
"plugins/web/opentelemetry-instrumentation-long-task": "0.37.0",
"plugins/web/opentelemetry-instrumentation-user-interaction": "0.37.0",
"plugins/web/opentelemetry-plugin-react-load": "0.30.0",
"propagators/opentelemetry-propagator-grpc-census-binary": "0.27.1",
"propagators/opentelemetry-propagator-instana": "0.3.1",
"propagators/opentelemetry-propagator-ot-trace": "0.27.1"
"detectors/node/opentelemetry-resource-detector-alibaba-cloud": "0.28.9",
"detectors/node/opentelemetry-resource-detector-aws": "1.5.0",
"detectors/node/opentelemetry-resource-detector-azure": "0.2.7",
"detectors/node/opentelemetry-resource-detector-container": "0.3.9",
"detectors/node/opentelemetry-resource-detector-gcp": "0.29.9",
"detectors/node/opentelemetry-resource-detector-github": "0.28.2",
"detectors/node/opentelemetry-resource-detector-instana": "0.9.0",
"metapackages/auto-instrumentations-node": "0.46.1",
"metapackages/auto-instrumentations-web": "0.39.0",
"packages/baggage-span-processor": "0.2.0",
"packages/opentelemetry-host-metrics": "0.35.1",
"packages/opentelemetry-id-generator-aws-xray": "1.2.2",
"packages/opentelemetry-propagation-utils": "0.30.9",
"packages/opentelemetry-redis-common": "0.36.2",
"packages/opentelemetry-sql-common": "0.40.1",
"packages/opentelemetry-test-utils": "0.39.0",
"packages/winston-transport": "0.3.0",
"plugins/node/instrumentation-amqplib": "0.37.0",
"plugins/node/instrumentation-cucumber": "0.6.0",
"plugins/node/instrumentation-dataloader": "0.9.0",
"plugins/node/instrumentation-fs": "0.12.0",
"plugins/node/instrumentation-kafkajs": "0.0.1",
"plugins/node/instrumentation-lru-memoizer": "0.37.0",
"plugins/node/instrumentation-mongoose": "0.38.1",
"plugins/node/instrumentation-runtime-node": "0.4.0",
"plugins/node/instrumentation-socket.io": "0.39.0",
"plugins/node/instrumentation-tedious": "0.10.1",
"plugins/node/instrumentation-undici": "0.2.0",
"plugins/node/opentelemetry-instrumentation-aws-lambda": "0.41.1",
"plugins/node/opentelemetry-instrumentation-aws-sdk": "0.41.0",
"plugins/node/opentelemetry-instrumentation-bunyan": "0.38.0",
"plugins/node/opentelemetry-instrumentation-cassandra": "0.38.0",
"plugins/node/opentelemetry-instrumentation-connect": "0.36.1",
"plugins/node/opentelemetry-instrumentation-dns": "0.36.1",
"plugins/node/opentelemetry-instrumentation-express": "0.39.0",
"plugins/node/opentelemetry-instrumentation-fastify": "0.36.1",
"plugins/node/opentelemetry-instrumentation-generic-pool": "0.36.0",
"plugins/node/opentelemetry-instrumentation-graphql": "0.40.0",
"plugins/node/opentelemetry-instrumentation-hapi": "0.38.0",
"plugins/node/opentelemetry-instrumentation-ioredis": "0.40.0",
"plugins/node/opentelemetry-instrumentation-knex": "0.36.1",
"plugins/node/opentelemetry-instrumentation-koa": "0.40.0",
"plugins/node/opentelemetry-instrumentation-memcached": "0.36.0",
"plugins/node/opentelemetry-instrumentation-mongodb": "0.43.0",
"plugins/node/opentelemetry-instrumentation-mysql": "0.38.1",
"plugins/node/opentelemetry-instrumentation-mysql2": "0.38.1",
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.37.1",
"plugins/node/opentelemetry-instrumentation-net": "0.36.0",
"plugins/node/opentelemetry-instrumentation-pg": "0.41.0",
"plugins/node/opentelemetry-instrumentation-pino": "0.39.0",
"plugins/node/opentelemetry-instrumentation-redis": "0.39.1",
"plugins/node/opentelemetry-instrumentation-redis-4": "0.39.0",
"plugins/node/opentelemetry-instrumentation-restify": "0.38.0",
"plugins/node/opentelemetry-instrumentation-router": "0.37.0",
"plugins/node/opentelemetry-instrumentation-winston": "0.37.0",
"plugins/web/opentelemetry-instrumentation-document-load": "0.38.0",
"plugins/web/opentelemetry-instrumentation-long-task": "0.38.0",
"plugins/web/opentelemetry-instrumentation-user-interaction": "0.38.0",
"plugins/web/opentelemetry-plugin-react-load": "0.30.1",
"propagators/opentelemetry-propagator-instana": "0.3.2",
"propagators/opentelemetry-propagator-ot-trace": "0.27.2"
}
33 changes: 33 additions & 0 deletions GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,36 @@ To support this use case, you can choose one of the following options:
};
...
```

## Diag Logging

The OpenTelemetry diagnostic logging channel can be used to troubleshoot issues with instrumentation packages.

### Patching Messages

When OpenTelemetry is installed in a user application, and expected spans are missing from generated traces, it is often useful to differentiate between the following scenarios:

- The instrumentation is not auto loaded - due to issue with the require/import interception, an unsupported version of the instrumented package, or some other issue. This knowledge can pin-point the issue to the instrumentation package.
- The instrumentation patch was applied but expected spans are missing -- this can suggest an issue with instrumented package logic, configuration, limits, otel sdk, or other issues.

It can also be useful to know when the instrumentation is loaded and patched, to understand the order of operations in the application.

Instrumentation packages should use the `@opentelemetry/instrumentation` package `InstrumentationBase` class to register patches and unpatch callbacks for specific require/import of the instrumented package, it's dependency or an internal module file. When this mechanism is used, the base class will automatically emit a debug message on instrumentation diag component logger, looking like this:
```shell
@opentelemetry/instrumentation-foo Applying instrumentation patch for module on require hook {
module: 'foo',
version: '1.2.3',
baseDir: '<your directory>/node_modules/foo'
}
```
Instrumentation should not add additional debug messages for triggering the patching and unpatching callbacks, as the base class will handle this.
Instrumentation may add additional patch/unpatch messages for specific functions if it is expected to help in troubleshooting issues with the instrumentation. Few examples:
- If the patch logic is conditional, and user can benefit from ensuring the condition is met and the patch happened. `koa` patching logic examine an object and branch between patching it as router vs middleware, which is applied at runtime. `aws-lambda` will abort patching if the environment is not configured properly.
- When the patch is not applied directly on a `moduleExports` object in the `InstrumentationBase` callbacks, but rather from an event in the package, like creating new client instance, registering a listener, etc. `fastify` instrumentation applies a patch when a hook is added to the fastify app instance, which is patched from `moduleExports`.
- In situations where the patch logic is not trivial and it helps to specify patch events in the right context and nuances. `aws-lambda` logs additional properties extracted from the lambda framework and exposes them for troubleshooting.
The cases above are not covered by the base class and offer additional context to the user troubleshooting an issue with the instrumentation.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ A repository for OpenTelemetry JavaScript contributions that are not part of the

This project includes:

* [Instrumentations & other plugins](./plugins),
* [Metapackages](./metapackages),
* [Context Propagators](./propagators),
* [Resource Detectors](./detectors).
- [Instrumentations & other plugins](./plugins),
- [Metapackages](./metapackages),
- [Context Propagators](./propagators),
- [Resource Detectors](./detectors).

**Instrumentations**: OpenTelemetry can collect tracing data automatically using instrumentations. Vendors/Users can also create and use their own.

Expand All @@ -59,9 +59,9 @@ Stability level for components in this repository follow the definitions in [CON

Packages in this repository have a variable range of support for Node.JS and browser versions which for each package depend on

* the activeness of the owners of those packages,
* used techniques or runtime features and
* in the case of the auto-instrumentations, the supported runtime versions for the underlying package.
- the activeness of the owners of those packages,
- used techniques or runtime features and
- in the case of the auto-instrumentations, the supported runtime versions for the underlying package.

See the `README.md` files and the `engines` field in the `package.json` files for the respective packages for support information about that package.

Expand All @@ -79,9 +79,9 @@ We'd love your help! Use tags [up-for-grabs][up-for-grabs-issues] and [good firs

## Useful links

* For more information on OpenTelemetry, visit [OpenTelemetry.io](https://opentelemetry.io/)
* For help or feedback on this project, join us in [GitHub Discussions][discussions-url] or in [Slack](https://cloud-native.slack.com/archives/C01NL1GRPQR)
* For more 3rd party components for JS as well as other languages, check [OpenTelemetry Registry](https://opentelemetry.io/registry/)
- For more information on OpenTelemetry, visit [OpenTelemetry.io](https://opentelemetry.io/)
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url] or in [Slack](https://cloud-native.slack.com/archives/C01NL1GRPQR)
- For more 3rd party components for JS as well as other languages, check [OpenTelemetry Registry](https://opentelemetry.io/registry/)

## License

Expand Down
36 changes: 18 additions & 18 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ For posterity, or in the event of any failures with release-please, the process

Manual Release Process Steps:

* [Update to latest locally](#update-to-latest-locally)
* [Create a new branch](#create-a-new-branch)
* [Prepare each package for release](#prepare-each-package-for-release)
* [Use the Changelog to create a GitHub Release](#use-the-changelog-to-create-a-github-release)
* [Create a new PR](#create-a-new-pr)
* [Merge and pull](#merge-and-pull)
* [Publish all packages](#publish-all-packages)
* [Publish the GitHub Release](#publish-the-github-release)
* [Update CHANGELOG](#update-changelog)
- [Update to latest locally](#update-to-latest-locally)
- [Create a new branch](#create-a-new-branch)
- [Prepare each package for release](#prepare-each-package-for-release)
- [Use the Changelog to create a GitHub Release](#use-the-changelog-to-create-a-github-release)
- [Create a new PR](#create-a-new-pr)
- [Merge and pull](#merge-and-pull)
- [Publish all packages](#publish-all-packages)
- [Publish the GitHub Release](#publish-the-github-release)
- [Update CHANGELOG](#update-changelog)

## Update to latest locally

Expand All @@ -31,9 +31,9 @@ Create a new branch called `x.y.z-proposal` from the current commit.

Decide on the next `major.minor.patch` release number based on [semver](http://semver.org/) guidelines.

* Use `npm install` command to initialize all package directories
* Use `lerna publish --skip-npm --no-git-tag-version --no-push` to bump the version in all `package.json`
* Use `npm run bootstrap` to generate latest `version.ts` files
- Use `npm install` command to initialize all package directories
- Use `lerna publish --skip-npm --no-git-tag-version --no-push` to bump the version in all `package.json`
- Use `npm run bootstrap` to generate latest `version.ts` files

## Use the Changelog to create a GitHub Release

Expand All @@ -58,10 +58,10 @@ It will print something like:
## Unreleased (2018-05-24)

#### :bug: Bug Fix
* [#198](https://github.com/my-org/my-repo/pull/198) Avoid an infinite loop ([@helpful-hacker](https://github.com/helpful-hacker))
- [#198](https://github.com/my-org/my-repo/pull/198) Avoid an infinite loop ([@helpful-hacker](https://github.com/helpful-hacker))

#### :house: Internal
* [#183](https://github.com/my-org/my-repo/pull/183) Standardize error messages ([@careful-coder](https://github.com/careful-coder))
- [#183](https://github.com/my-org/my-repo/pull/183) Standardize error messages ([@careful-coder](https://github.com/careful-coder))

#### Commiters: 2
- Helpful Hacker ([@helpful-hacker](https://github.com/helpful-hacker))
Expand Down Expand Up @@ -112,10 +112,10 @@ 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/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 main branch.
- 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 main branch.

## Known Issues

* The `examples/` and `getting-started/` folders are not part of lerna packages, we need to manually bump the version in `package.json`.
- The `examples/` and `getting-started/` folders are not part of lerna packages, we need to manually bump the version in `package.json`.
Loading

0 comments on commit 7a98bfd

Please sign in to comment.