Skip to content

Commit 7a98bfd

Browse files
Merge branch 'main' into feat/node/prom-client-implementation
2 parents ade0ab9 + b41797b commit 7a98bfd

File tree

333 files changed

+9036
-4501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+9036
-4501
lines changed

.github/component-label-map.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pkg:instrumentation-bunyan:
7171
- changed-files:
7272
- any-glob-to-any-file:
7373
- plugins/node/opentelemetry-instrumentation-bunyan/**
74-
pkg:instrumentation-cassandra:
74+
pkg:instrumentation-cassandra-driver:
7575
- changed-files:
7676
- any-glob-to-any-file:
7777
- plugins/node/opentelemetry-instrumentation-cassandra/**

.github/component_owners.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ components:
2727
- pichlermarc
2828
- legendecas
2929
- blumamir
30+
packages/baggage-span-processor:
31+
- mikegoldsmith
32+
- jamiedanielson
3033
packages/opentelemetry-host-metrics:
3134
- legendecas
3235
packages/opentelemetry-id-generator-aws-xray:
@@ -55,6 +58,8 @@ components:
5558
- henrinormak
5659
plugins/node/instrumentation-fs:
5760
- rauno56
61+
plugins/node/instrumentation-kafkajs:
62+
- seemk
5863
plugins/node/instrumentation-lru-memoizer:
5964
- blumamir
6065
plugins/node/instrumentation-mongoose:

.github/markdown-lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# MD004 - Unordered list style
2+
# This rule is triggered when the symbols used in the document for unordered list items do not match the configured unordered list style
3+
# * Item 1 // Error: Unordered list style [Expected: dash; Actual: asterisk]
4+
MD004:
5+
style: dash

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- name: Lint markdown files
2020
uses: avto-dev/markdown-lint@v1
2121
with:
22+
config: '.github/markdown-lint.yml'
2223
ignore: "./**/CHANGELOG.md"
2324
args: "./**/*.md"
2425

.github/workflows/release-please.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
npm ci
2626
27-
- uses: google-github-actions/release-please-action@v4
27+
- uses: googleapis/release-please-action@f3969c04a4ec81d7a9aa4010d84ae6a7602f86a7 # v4.1.1
2828
id: release
2929
with:
3030
token: ${{secrets.RELEASE_PR_TOKEN}}
@@ -55,14 +55,14 @@ jobs:
5555
# get main again
5656
- name: Checkout Repository
5757
# only checkout if a release has been created
58-
if: ${{ steps.release.outputs.release_created }}
58+
if: ${{ steps.release.outputs.releases_created }}
5959
uses: actions/checkout@v4
6060
with:
6161
fetch-depth: 0
6262

6363
- name: Rebuild Packages
6464
# only rebuild if a release has been created
65-
if: ${{ steps.release.outputs.release_created }}
65+
if: ${{ steps.release.outputs.releases_created }}
6666
run: |
6767
npm ci
6868
npm run compile
@@ -72,7 +72,7 @@ jobs:
7272
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
7373
- name: Publish to npm
7474
# only publish if a release has been created
75-
if: ${{ steps.release.outputs.release_created }}
75+
if: ${{ steps.release.outputs.releases_created }}
7676
env:
7777
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
7878
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes

.github/workflows/test-all-versions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node: ["14", "16", "18.18.2"]
21+
node: ["14", "16", "18", "20"]
2222
runs-on: ubuntu-latest
2323
services:
2424
mongo:
@@ -53,7 +53,7 @@ jobs:
5353
--health-timeout 5s
5454
--health-retries 5
5555
postgres:
56-
image: postgres:15-alpine
56+
image: postgres:16-alpine
5757
env:
5858
POSTGRES_USER: postgres
5959
POSTGRES_DB: otel_pg_database

.github/workflows/unit-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
node: ["14", "16", "18.18.2"]
12+
node: ["14", "16", "18", "20"]
1313
include:
14-
- node: 18.18.2
14+
- node: 18
1515
code-coverage: true
1616
runs-on: ubuntu-latest
1717
services:
@@ -51,7 +51,7 @@ jobs:
5151
--health-timeout 5s
5252
--health-retries 5
5353
postgres:
54-
image: postgres:15-alpine
54+
image: postgres:16-alpine
5555
env:
5656
POSTGRES_USER: postgres
5757
POSTGRES_DB: otel_pg_database

.release-please-manifest.json

Lines changed: 61 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,63 @@
11
{
2-
"detectors/node/opentelemetry-resource-detector-alibaba-cloud": "0.28.8",
3-
"detectors/node/opentelemetry-resource-detector-aws": "1.4.1",
4-
"detectors/node/opentelemetry-resource-detector-azure": "0.2.6",
5-
"detectors/node/opentelemetry-resource-detector-container": "0.3.8",
6-
"detectors/node/opentelemetry-resource-detector-gcp": "0.29.8",
7-
"detectors/node/opentelemetry-resource-detector-github": "0.28.1",
8-
"detectors/node/opentelemetry-resource-detector-instana": "0.8.0",
9-
"metapackages/auto-instrumentations-node": "0.44.0",
10-
"metapackages/auto-instrumentations-web": "0.38.0",
11-
"packages/opentelemetry-host-metrics": "0.35.0",
12-
"packages/opentelemetry-id-generator-aws-xray": "1.2.1",
13-
"packages/opentelemetry-propagation-utils": "0.30.8",
14-
"packages/opentelemetry-redis-common": "0.36.1",
15-
"packages/opentelemetry-sql-common": "0.40.0",
16-
"packages/opentelemetry-test-utils": "0.38.0",
17-
"packages/winston-transport": "0.2.0",
18-
"plugins/node/instrumentation-amqplib": "0.36.0",
19-
"plugins/node/instrumentation-cucumber": "0.5.0",
20-
"plugins/node/instrumentation-dataloader": "0.8.0",
21-
"plugins/node/instrumentation-fs": "0.11.0",
22-
"plugins/node/instrumentation-lru-memoizer": "0.36.0",
23-
"plugins/node/instrumentation-mongoose": "0.37.0",
24-
"plugins/node/instrumentation-runtime-node": "0.3.0",
25-
"plugins/node/instrumentation-socket.io": "0.38.0",
26-
"plugins/node/instrumentation-tedious": "0.9.0",
27-
"plugins/node/instrumentation-undici": "0.1.0",
28-
"plugins/node/opentelemetry-instrumentation-aws-lambda": "0.40.0",
29-
"plugins/node/opentelemetry-instrumentation-aws-sdk": "0.40.0",
30-
"plugins/node/opentelemetry-instrumentation-bunyan": "0.37.0",
31-
"plugins/node/opentelemetry-instrumentation-cassandra": "0.37.0",
32-
"plugins/node/opentelemetry-instrumentation-connect": "0.35.0",
33-
"plugins/node/opentelemetry-instrumentation-dns": "0.35.0",
34-
"plugins/node/opentelemetry-instrumentation-express": "0.37.0",
35-
"plugins/node/opentelemetry-instrumentation-fastify": "0.35.0",
36-
"plugins/node/opentelemetry-instrumentation-generic-pool": "0.35.0",
37-
"plugins/node/opentelemetry-instrumentation-graphql": "0.39.0",
38-
"plugins/node/opentelemetry-instrumentation-hapi": "0.36.0",
39-
"plugins/node/opentelemetry-instrumentation-ioredis": "0.39.0",
40-
"plugins/node/opentelemetry-instrumentation-knex": "0.35.0",
41-
"plugins/node/opentelemetry-instrumentation-koa": "0.39.0",
42-
"plugins/node/opentelemetry-instrumentation-memcached": "0.35.0",
43-
"plugins/node/opentelemetry-instrumentation-mongodb": "0.42.0",
44-
"plugins/node/opentelemetry-instrumentation-mysql": "0.37.0",
45-
"plugins/node/opentelemetry-instrumentation-mysql2": "0.37.0",
46-
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.36.0",
47-
"plugins/node/opentelemetry-instrumentation-net": "0.35.0",
48-
"plugins/node/opentelemetry-instrumentation-pg": "0.40.0",
49-
"plugins/node/opentelemetry-instrumentation-pino": "0.37.0",
50-
"plugins/node/opentelemetry-instrumentation-redis": "0.38.0",
51-
"plugins/node/opentelemetry-instrumentation-redis-4": "0.38.0",
52-
"plugins/node/opentelemetry-instrumentation-restify": "0.37.0",
53-
"plugins/node/opentelemetry-instrumentation-router": "0.36.0",
54-
"plugins/node/opentelemetry-instrumentation-winston": "0.36.0",
55-
"plugins/web/opentelemetry-instrumentation-document-load": "0.37.0",
56-
"plugins/web/opentelemetry-instrumentation-long-task": "0.37.0",
57-
"plugins/web/opentelemetry-instrumentation-user-interaction": "0.37.0",
58-
"plugins/web/opentelemetry-plugin-react-load": "0.30.0",
59-
"propagators/opentelemetry-propagator-grpc-census-binary": "0.27.1",
60-
"propagators/opentelemetry-propagator-instana": "0.3.1",
61-
"propagators/opentelemetry-propagator-ot-trace": "0.27.1"
2+
"detectors/node/opentelemetry-resource-detector-alibaba-cloud": "0.28.9",
3+
"detectors/node/opentelemetry-resource-detector-aws": "1.5.0",
4+
"detectors/node/opentelemetry-resource-detector-azure": "0.2.7",
5+
"detectors/node/opentelemetry-resource-detector-container": "0.3.9",
6+
"detectors/node/opentelemetry-resource-detector-gcp": "0.29.9",
7+
"detectors/node/opentelemetry-resource-detector-github": "0.28.2",
8+
"detectors/node/opentelemetry-resource-detector-instana": "0.9.0",
9+
"metapackages/auto-instrumentations-node": "0.46.1",
10+
"metapackages/auto-instrumentations-web": "0.39.0",
11+
"packages/baggage-span-processor": "0.2.0",
12+
"packages/opentelemetry-host-metrics": "0.35.1",
13+
"packages/opentelemetry-id-generator-aws-xray": "1.2.2",
14+
"packages/opentelemetry-propagation-utils": "0.30.9",
15+
"packages/opentelemetry-redis-common": "0.36.2",
16+
"packages/opentelemetry-sql-common": "0.40.1",
17+
"packages/opentelemetry-test-utils": "0.39.0",
18+
"packages/winston-transport": "0.3.0",
19+
"plugins/node/instrumentation-amqplib": "0.37.0",
20+
"plugins/node/instrumentation-cucumber": "0.6.0",
21+
"plugins/node/instrumentation-dataloader": "0.9.0",
22+
"plugins/node/instrumentation-fs": "0.12.0",
23+
"plugins/node/instrumentation-kafkajs": "0.0.1",
24+
"plugins/node/instrumentation-lru-memoizer": "0.37.0",
25+
"plugins/node/instrumentation-mongoose": "0.38.1",
26+
"plugins/node/instrumentation-runtime-node": "0.4.0",
27+
"plugins/node/instrumentation-socket.io": "0.39.0",
28+
"plugins/node/instrumentation-tedious": "0.10.1",
29+
"plugins/node/instrumentation-undici": "0.2.0",
30+
"plugins/node/opentelemetry-instrumentation-aws-lambda": "0.41.1",
31+
"plugins/node/opentelemetry-instrumentation-aws-sdk": "0.41.0",
32+
"plugins/node/opentelemetry-instrumentation-bunyan": "0.38.0",
33+
"plugins/node/opentelemetry-instrumentation-cassandra": "0.38.0",
34+
"plugins/node/opentelemetry-instrumentation-connect": "0.36.1",
35+
"plugins/node/opentelemetry-instrumentation-dns": "0.36.1",
36+
"plugins/node/opentelemetry-instrumentation-express": "0.39.0",
37+
"plugins/node/opentelemetry-instrumentation-fastify": "0.36.1",
38+
"plugins/node/opentelemetry-instrumentation-generic-pool": "0.36.0",
39+
"plugins/node/opentelemetry-instrumentation-graphql": "0.40.0",
40+
"plugins/node/opentelemetry-instrumentation-hapi": "0.38.0",
41+
"plugins/node/opentelemetry-instrumentation-ioredis": "0.40.0",
42+
"plugins/node/opentelemetry-instrumentation-knex": "0.36.1",
43+
"plugins/node/opentelemetry-instrumentation-koa": "0.40.0",
44+
"plugins/node/opentelemetry-instrumentation-memcached": "0.36.0",
45+
"plugins/node/opentelemetry-instrumentation-mongodb": "0.43.0",
46+
"plugins/node/opentelemetry-instrumentation-mysql": "0.38.1",
47+
"plugins/node/opentelemetry-instrumentation-mysql2": "0.38.1",
48+
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.37.1",
49+
"plugins/node/opentelemetry-instrumentation-net": "0.36.0",
50+
"plugins/node/opentelemetry-instrumentation-pg": "0.41.0",
51+
"plugins/node/opentelemetry-instrumentation-pino": "0.39.0",
52+
"plugins/node/opentelemetry-instrumentation-redis": "0.39.1",
53+
"plugins/node/opentelemetry-instrumentation-redis-4": "0.39.0",
54+
"plugins/node/opentelemetry-instrumentation-restify": "0.38.0",
55+
"plugins/node/opentelemetry-instrumentation-router": "0.37.0",
56+
"plugins/node/opentelemetry-instrumentation-winston": "0.37.0",
57+
"plugins/web/opentelemetry-instrumentation-document-load": "0.38.0",
58+
"plugins/web/opentelemetry-instrumentation-long-task": "0.38.0",
59+
"plugins/web/opentelemetry-instrumentation-user-interaction": "0.38.0",
60+
"plugins/web/opentelemetry-plugin-react-load": "0.30.1",
61+
"propagators/opentelemetry-propagator-instana": "0.3.2",
62+
"propagators/opentelemetry-propagator-ot-trace": "0.27.2"
6263
}

GUIDELINES.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,36 @@ To support this use case, you can choose one of the following options:
164164
};
165165
...
166166
```
167+
168+
## Diag Logging
169+
170+
The OpenTelemetry diagnostic logging channel can be used to troubleshoot issues with instrumentation packages.
171+
172+
### Patching Messages
173+
174+
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:
175+
176+
- 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.
177+
- 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.
178+
179+
It can also be useful to know when the instrumentation is loaded and patched, to understand the order of operations in the application.
180+
181+
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:
182+
183+
```shell
184+
@opentelemetry/instrumentation-foo Applying instrumentation patch for module on require hook {
185+
module: 'foo',
186+
version: '1.2.3',
187+
baseDir: '<your directory>/node_modules/foo'
188+
}
189+
```
190+
191+
Instrumentation should not add additional debug messages for triggering the patching and unpatching callbacks, as the base class will handle this.
192+
193+
Instrumentation may add additional patch/unpatch messages for specific functions if it is expected to help in troubleshooting issues with the instrumentation. Few examples:
194+
195+
- 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.
196+
- 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`.
197+
- 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.
198+
199+
The cases above are not covered by the base class and offer additional context to the user troubleshooting an issue with the instrumentation.

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ A repository for OpenTelemetry JavaScript contributions that are not part of the
4242

4343
This project includes:
4444

45-
* [Instrumentations & other plugins](./plugins),
46-
* [Metapackages](./metapackages),
47-
* [Context Propagators](./propagators),
48-
* [Resource Detectors](./detectors).
45+
- [Instrumentations & other plugins](./plugins),
46+
- [Metapackages](./metapackages),
47+
- [Context Propagators](./propagators),
48+
- [Resource Detectors](./detectors).
4949

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

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

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

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

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

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

8080
## Useful links
8181

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

8686
## License
8787

0 commit comments

Comments
 (0)