Skip to content

Commit ca771f5

Browse files
authored
Merge branch 'main' into sqs-batch-receive
2 parents 6d30fa6 + a4fcd26 commit ca771f5

File tree

45 files changed

+707
-249
lines changed

Some content is hidden

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

45 files changed

+707
-249
lines changed

.release-please-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"detectors/node/opentelemetry-resource-detector-alibaba-cloud": "0.29.3",
33
"detectors/node/opentelemetry-resource-detector-aws": "1.6.2",
44
"detectors/node/opentelemetry-resource-detector-azure": "0.2.11",
5-
"detectors/node/opentelemetry-resource-detector-container": "0.4.3",
5+
"detectors/node/opentelemetry-resource-detector-container": "0.4.4",
66
"detectors/node/opentelemetry-resource-detector-gcp": "0.29.12",
77
"detectors/node/opentelemetry-resource-detector-github": "0.29.0",
88
"detectors/node/opentelemetry-resource-detector-instana": "0.13.0",
99
"metapackages/auto-configuration-propagators": "0.3.1",
10-
"metapackages/auto-instrumentations-node": "0.50.2",
10+
"metapackages/auto-instrumentations-node": "0.51.0",
1111
"metapackages/auto-instrumentations-web": "0.41.0",
1212
"packages/baggage-span-processor": "0.3.1",
1313
"packages/opentelemetry-host-metrics": "0.35.4",
@@ -48,7 +48,7 @@
4848
"plugins/node/opentelemetry-instrumentation-mysql2": "0.41.0",
4949
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.40.0",
5050
"plugins/node/opentelemetry-instrumentation-net": "0.39.0",
51-
"plugins/node/opentelemetry-instrumentation-pg": "0.45.1",
51+
"plugins/node/opentelemetry-instrumentation-pg": "0.46.0",
5252
"plugins/node/opentelemetry-instrumentation-pino": "0.42.0",
5353
"plugins/node/opentelemetry-instrumentation-redis": "0.42.0",
5454
"plugins/node/opentelemetry-instrumentation-redis-4": "0.42.1",

detectors/node/opentelemetry-resource-detector-container/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.4.4](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-container-v0.4.3...resource-detector-container-v0.4.4) (2024-10-16)
4+
5+
6+
### Bug Fixes
7+
8+
* **detector-container:** properly detect container ID when using Podman ([#2448](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2448)) ([ad560df](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/ad560dfc5f662d418a74b0b197b3f48e4ae002d0))
9+
310
## [0.4.3](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-container-v0.4.2...resource-detector-container-v0.4.3) (2024-10-10)
411

512

detectors/node/opentelemetry-resource-detector-container/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opentelemetry/resource-detector-container",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"description": "Opentelemetry resource detector to get container resource attributes",
55
"main": "build/src/index.js",
66
"types": "build/src/index.d.ts",

metapackages/auto-instrumentations-node/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## [0.51.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-node-v0.50.2...auto-instrumentations-node-v0.51.0) (2024-10-16)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* **auto-instrumentations-node:** disable @opentelemetry/instrumentation-fs by default ([#2467](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2467))
9+
10+
### Features
11+
12+
* **auto-instrumentations-node:** disable @opentelemetry/instrumentation-fs by default ([#2467](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2467)) ([a558044](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/a55804415d39c751a3f5f58c00cf27747821302f))
13+
14+
15+
### Dependencies
16+
17+
* The following workspace dependencies were updated
18+
* dependencies
19+
* @opentelemetry/instrumentation-pg bumped from ^0.45.1 to ^0.46.0
20+
* @opentelemetry/resource-detector-container bumped from ^0.4.3 to ^0.4.4
21+
322
## [0.50.2](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-node-v0.50.1...auto-instrumentations-node-v0.50.2) (2024-10-10)
423

524

metapackages/auto-instrumentations-node/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ For example, to enable only the `env`, `host` detectors:
7777
export OTEL_NODE_RESOURCE_DETECTORS="env,host"
7878
```
7979

80-
By default, all [Supported Instrumentations](#supported-instrumentations) are enabled.
81-
You can use the environment variable `OTEL_NODE_ENABLED_INSTRUMENTATIONS` to enable only certain instrumentations,
80+
By default, all [Supported Instrumentations](#supported-instrumentations) are enabled, unless they are annotated with "default disabled".
81+
You can use the environment variable `OTEL_NODE_ENABLED_INSTRUMENTATIONS` to enable only certain instrumentations, including "default disabled" ones
8282
OR the environment variable `OTEL_NODE_DISABLED_INSTRUMENTATIONS` to disable only certain instrumentations,
8383
by providing a comma-separated list of the instrumentation package names without the `@opentelemetry/instrumentation-` prefix.
8484

@@ -91,10 +91,10 @@ instrumentations:
9191
export OTEL_NODE_ENABLED_INSTRUMENTATIONS="http,nestjs-core"
9292
```
9393

94-
To disable only [@opentelemetry/instrumentation-fs](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-fs):
94+
To disable only [@opentelemetry/instrumentation-net](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-net):
9595

9696
```shell
97-
export OTEL_NODE_DISABLED_INSTRUMENTATIONS="fs"
97+
export OTEL_NODE_DISABLED_INSTRUMENTATIONS="net"
9898
```
9999

100100
If both environment variables are set, `OTEL_NODE_ENABLED_INSTRUMENTATIONS` is applied first, and then `OTEL_NODE_DISABLED_INSTRUMENTATIONS` is applied to that list.
@@ -170,6 +170,7 @@ registerInstrumentations({
170170
- [@opentelemetry/instrumentation-dns](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-dns)
171171
- [@opentelemetry/instrumentation-express](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-express)
172172
- [@opentelemetry/instrumentation-fastify](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-fastify)
173+
- [@opentelemetry/instrumentation-fs](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-fs) (default disabled)
173174
- [@opentelemetry/instrumentation-generic-pool](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-generic-pool)
174175
- [@opentelemetry/instrumentation-graphql](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-graphql)
175176
- [@opentelemetry/instrumentation-grpc](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-grpc)

metapackages/auto-instrumentations-node/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opentelemetry/auto-instrumentations-node",
3-
"version": "0.50.2",
3+
"version": "0.51.0",
44
"description": "Metapackage which bundles opentelemetry node core and contrib instrumentations",
55
"author": "OpenTelemetry Authors",
66
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node#readme",
@@ -79,7 +79,7 @@
7979
"@opentelemetry/instrumentation-mysql2": "^0.41.0",
8080
"@opentelemetry/instrumentation-nestjs-core": "^0.40.0",
8181
"@opentelemetry/instrumentation-net": "^0.39.0",
82-
"@opentelemetry/instrumentation-pg": "^0.45.1",
82+
"@opentelemetry/instrumentation-pg": "^0.46.0",
8383
"@opentelemetry/instrumentation-pino": "^0.42.0",
8484
"@opentelemetry/instrumentation-redis": "^0.42.0",
8585
"@opentelemetry/instrumentation-redis-4": "^0.42.1",
@@ -92,7 +92,7 @@
9292
"@opentelemetry/resource-detector-alibaba-cloud": "^0.29.3",
9393
"@opentelemetry/resource-detector-aws": "^1.6.2",
9494
"@opentelemetry/resource-detector-azure": "^0.2.11",
95-
"@opentelemetry/resource-detector-container": "^0.4.3",
95+
"@opentelemetry/resource-detector-container": "^0.4.4",
9696
"@opentelemetry/resource-detector-gcp": "^0.29.12",
9797
"@opentelemetry/resources": "^1.24.0",
9898
"@opentelemetry/sdk-node": "^0.53.0"

metapackages/auto-instrumentations-node/src/utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ const InstrumentationMap = {
136136
'@opentelemetry/instrumentation-winston': WinstonInstrumentation,
137137
};
138138

139+
const defaultExcludedInstrumentations = ['@opentelemetry/instrumentation-fs'];
140+
139141
// Config types inferred automatically from the first argument of the constructor
140142
type ConfigArg<T> = T extends new (...args: infer U) => unknown ? U[0] : never;
141143
export type InstrumentationConfigMap = {
@@ -208,10 +210,14 @@ function getInstrumentationsFromEnv(envVar: string): string[] {
208210

209211
/**
210212
* Returns the list of instrumentations that are enabled based on the environment variable.
213+
* If the environment variable is unset, returns all instrumentation that are enabled by default.
211214
*/
212215
function getEnabledInstrumentationsFromEnv() {
213216
if (!process.env.OTEL_NODE_ENABLED_INSTRUMENTATIONS) {
214-
return Object.keys(InstrumentationMap);
217+
// all keys in the InstrumentationMap except for everything that is not enabled by default.
218+
return Object.keys(InstrumentationMap).filter(
219+
key => !defaultExcludedInstrumentations.includes(key)
220+
);
215221
}
216222

217223
const instrumentationsFromEnv = getInstrumentationsFromEnv(

metapackages/auto-instrumentations-node/test/utils.test.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ import { getResourceDetectorsFromEnv } from '../src/utils';
2323

2424
describe('utils', () => {
2525
describe('getNodeAutoInstrumentations', () => {
26-
it('should include all installed instrumentations', () => {
26+
it('should include all default instrumentations', () => {
2727
const instrumentations = getNodeAutoInstrumentations();
2828
const installedInstrumentations = Object.keys(
2929
require('../package.json').dependencies
3030
).filter(depName => {
31-
return depName.startsWith('@opentelemetry/instrumentation-');
31+
return (
32+
depName.startsWith('@opentelemetry/instrumentation-') &&
33+
depName !== '@opentelemetry/instrumentation-fs'
34+
);
3235
});
3336

3437
assert.deepStrictEqual(
@@ -89,6 +92,20 @@ describe('utils', () => {
8992
}
9093
});
9194

95+
it('should allow enabling non-default instrumentations via OTEL_NODE_ENABLED_INSTRUMENTATIONS environment variable', () => {
96+
process.env.OTEL_NODE_ENABLED_INSTRUMENTATIONS = 'fs'; // separator with and without whitespaces should be allowed
97+
try {
98+
const instrumentations = getNodeAutoInstrumentations();
99+
100+
assert.deepStrictEqual(
101+
new Set(instrumentations.map(i => i.instrumentationName)),
102+
new Set(['@opentelemetry/instrumentation-fs'])
103+
);
104+
} finally {
105+
delete process.env.OTEL_NODE_ENABLED_INSTRUMENTATIONS;
106+
}
107+
});
108+
92109
it('should include all instrumentations except those disabled via OTEL_NODE_DISABLED_INSTRUMENTATIONS environment variable', () => {
93110
process.env.OTEL_NODE_DISABLED_INSTRUMENTATIONS =
94111
'fs,aws-sdk, aws-lambda'; // separator with and without whitespaces should be allowed

0 commit comments

Comments
 (0)