Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/config-link…
Browse files Browse the repository at this point in the history
…s-amqp-plugin
  • Loading branch information
McSick committed May 29, 2024
2 parents e388cf2 + 27d6503 commit b6470a3
Show file tree
Hide file tree
Showing 472 changed files with 13,805 additions and 6,333 deletions.
11 changes: 5 additions & 6 deletions .github/component-label-map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ pkg:instrumentation-aws-lambda:
- changed-files:
- any-glob-to-any-file:
- plugins/node/opentelemetry-instrumentation-aws-lambda/**
- propagators/opentelemetry-propagator-aws-xray/**
pkg:instrumentation-aws-sdk:
- changed-files:
- any-glob-to-any-file:
Expand All @@ -72,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 Expand Up @@ -225,6 +224,10 @@ pkg:instrumentation-tedious:
- any-glob-to-any-file:
- plugins/node/instrumentation-tedious/**
- packages/opentelemetry-test-utils/**
pkg:instrumentation-undici:
- changed-files:
- any-glob-to-any-file:
- plugins/node/instrumentation-undici/**
pkg:instrumentation-user-interaction:
- changed-files:
- any-glob-to-any-file:
Expand All @@ -242,10 +245,6 @@ pkg:propagation-utils:
- any-glob-to-any-file:
- packages/opentelemetry-propagation-utils/**
- packages/opentelemetry-test-utils/**
pkg:propagator-aws-xray:
- changed-files:
- any-glob-to-any-file:
- propagators/opentelemetry-propagator-aws-xray/**
pkg:propagator-grpc-census-binary:
- changed-files:
- any-glob-to-any-file:
Expand Down
18 changes: 11 additions & 7 deletions .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ components:
detectors/node/opentelemetry-resource-detector-instana:
- basti1302
- kirrg001
incubator/opentelemetry-sampler-aws-xray:
- carolabadeer
metapackages/auto-instrumentations-node:
- dyladan
- pichlermarc
Expand All @@ -27,12 +29,13 @@ components:
- pichlermarc
- legendecas
- blumamir
packages/baggage-span-processor:
- mikegoldsmith
- jamiedanielson
packages/opentelemetry-host-metrics:
- legendecas
packages/opentelemetry-id-generator-aws-xray:
- carolabadeer
packages/opentelemetry-sampler-aws-xray:
- carolabadeer
packages/opentelemetry-propagation-utils:
- dyladan
- pichlermarc
Expand All @@ -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 Expand Up @@ -108,7 +113,7 @@ components:
- rauno56
plugins/node/opentelemetry-instrumentation-net:
- seemk
plugins/node/opentelemetry-instrumentation-runtime-node:
plugins/node/instrumentation-runtime-node:
- d4nyll
plugins/node/opentelemetry-instrumentation-pg:
- maryliag
Expand All @@ -123,6 +128,9 @@ components:
- rauno56
plugins/node/opentelemetry-instrumentation-router:
- rauno56
plugins/node/instrumentation-undici:
- david-luna
- trentm
plugins/node/opentelemetry-instrumentation-winston:
- seemk
plugins/web/opentelemetry-instrumentation-document-load:
Expand All @@ -135,10 +143,6 @@ components:
- obecny
plugins/web/opentelemetry-plugin-react-load:
- martinkuba
propagators/opentelemetry-propagator-aws-xray:
- carolabadeer
propagators/opentelemetry-propagator-grpc-census-binary: []
# Unmaintained?
propagators/opentelemetry-propagator-instana:
- basti1302
- kirrg001
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: 7 additions & 1 deletion .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 @@ -54,11 +54,15 @@ jobs:
# get main again
- name: Checkout Repository
# only checkout if a release has been 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.releases_created }}
run: |
npm ci
npm run compile
Expand All @@ -67,6 +71,8 @@ jobs:
# need to publish all unpublished versions to npm here
# 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.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
64 changes: 63 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +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/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-aws-xray":"1.3.1","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"
}
57 changes: 57 additions & 0 deletions GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,60 @@ 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.
## package.json
### Description
Instrumentation should include a `description` field in the `package.json` file. The description targets human readers and is an opportunity to communicate the use case for the instrumented package and its semconv namespace. It should help users know whether the package fits their application, which is especially helpful if the package has a shortened or obscure name.
The description should be written with this format when applicable:
```text
"OpenTelemetry instrumentation for `<instrumented-package-name>` <package short description>"
```
For example:
```text
"OpenTelemetry instrumentation for `express` http framework"
"OpenTelemetry instrumentation for `winston` logger"
"OpenTelemetry instrumentation for `redis` database client for Redis"
```
If the package is consumed directly, the description should state the package name in `<instrumented-package-name>`. Tools like `nestjs` and `aws-lambda` are examples of packages that are consumed indirectly.
A short description should follow the package name, like "http framework", "logger", "database client for X", "messaging client", etc as appropriate in each case. It is preferable to use the semconv namespace semantics that are emitted by this instrumentation (`http`, `database`, `messaging`, `rpc`, `net`) to give quick context for the scope of the instrumentation.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [2022] OpenTelemetry Authors
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit b6470a3

Please sign in to comment.