Skip to content

Commit 6196ea0

Browse files
committed
Merge branch 'main' of github.com:open-telemetry/opentelemetry-js-contrib into fix-connection-string-in-pool
2 parents e5f643a + 3fc62be commit 6196ea0

File tree

127 files changed

+2388
-1369
lines changed

Some content is hidden

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

127 files changed

+2388
-1369
lines changed

.github/component_owners.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ components:
105105
# Unmaintained
106106
plugins/node/opentelemetry-instrumentation-memcached: []
107107
# Unmaintained
108-
plugins/node/opentelemetry-instrumentation-mongodb: []
109-
# Unmaintained
108+
plugins/node/opentelemetry-instrumentation-mongodb:
109+
- onurtemizkan
110110
plugins/node/opentelemetry-instrumentation-mysql: []
111111
# Unmaintained
112112
plugins/node/opentelemetry-instrumentation-mysql2:

.github/workflows/fossa.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: FOSSA scanning
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
fossa:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
17+
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
18+
with:
19+
api-key: ${{secrets.FOSSA_API_KEY}}
20+
team: OpenTelemetry

.release-please-manifest.json

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
11
{
2-
"detectors/node/opentelemetry-resource-detector-alibaba-cloud": "0.30.0",
3-
"detectors/node/opentelemetry-resource-detector-aws": "1.11.0",
4-
"detectors/node/opentelemetry-resource-detector-azure": "0.6.0",
5-
"detectors/node/opentelemetry-resource-detector-container": "0.6.0",
6-
"detectors/node/opentelemetry-resource-detector-gcp": "0.33.0",
2+
"detectors/node/opentelemetry-resource-detector-alibaba-cloud": "0.30.1",
3+
"detectors/node/opentelemetry-resource-detector-aws": "1.12.0",
4+
"detectors/node/opentelemetry-resource-detector-azure": "0.6.1",
5+
"detectors/node/opentelemetry-resource-detector-container": "0.6.1",
6+
"detectors/node/opentelemetry-resource-detector-gcp": "0.33.1",
77
"detectors/node/opentelemetry-resource-detector-github": "0.30.0",
8-
"detectors/node/opentelemetry-resource-detector-instana": "0.18.0",
9-
"metapackages/auto-configuration-propagators": "0.3.2",
10-
"metapackages/auto-instrumentations-node": "0.56.0",
11-
"metapackages/auto-instrumentations-web": "0.45.0",
8+
"detectors/node/opentelemetry-resource-detector-instana": "0.18.1",
9+
"metapackages/auto-configuration-propagators": "0.3.3",
10+
"metapackages/auto-instrumentations-node": "0.56.1",
11+
"metapackages/auto-instrumentations-web": "0.45.1",
1212
"packages/baggage-span-processor": "0.3.1",
1313
"packages/opentelemetry-host-metrics": "0.35.5",
14-
"packages/opentelemetry-id-generator-aws-xray": "1.2.2",
15-
"packages/opentelemetry-propagation-utils": "0.30.15",
14+
"packages/opentelemetry-id-generator-aws-xray": "1.2.3",
15+
"packages/opentelemetry-propagation-utils": "0.30.16",
1616
"packages/opentelemetry-redis-common": "0.36.2",
1717
"packages/opentelemetry-sql-common": "0.40.1",
18-
"packages/opentelemetry-test-utils": "0.45.0",
19-
"packages/winston-transport": "0.10.0",
20-
"plugins/node/instrumentation-amqplib": "0.46.0",
21-
"plugins/node/instrumentation-cucumber": "0.14.0",
22-
"plugins/node/instrumentation-dataloader": "0.16.0",
23-
"plugins/node/instrumentation-fs": "0.19.0",
24-
"plugins/node/instrumentation-kafkajs": "0.7.0",
25-
"plugins/node/instrumentation-lru-memoizer": "0.44.0",
26-
"plugins/node/instrumentation-mongoose": "0.46.0",
27-
"plugins/node/instrumentation-runtime-node": "0.12.1",
28-
"plugins/node/instrumentation-socket.io": "0.46.0",
29-
"plugins/node/instrumentation-tedious": "0.18.0",
30-
"plugins/node/instrumentation-undici": "0.10.0",
31-
"plugins/node/opentelemetry-instrumentation-aws-lambda": "0.50.2",
32-
"plugins/node/opentelemetry-instrumentation-aws-sdk": "0.49.0",
33-
"plugins/node/opentelemetry-instrumentation-bunyan": "0.45.0",
34-
"plugins/node/opentelemetry-instrumentation-cassandra": "0.45.0",
35-
"plugins/node/opentelemetry-instrumentation-connect": "0.43.0",
36-
"plugins/node/opentelemetry-instrumentation-dns": "0.43.0",
37-
"plugins/node/opentelemetry-instrumentation-express": "0.47.0",
38-
"plugins/node/opentelemetry-instrumentation-fastify": "0.44.1",
39-
"plugins/node/opentelemetry-instrumentation-generic-pool": "0.43.0",
40-
"plugins/node/opentelemetry-instrumentation-graphql": "0.47.0",
41-
"plugins/node/opentelemetry-instrumentation-hapi": "0.45.1",
42-
"plugins/node/opentelemetry-instrumentation-ioredis": "0.47.0",
43-
"plugins/node/opentelemetry-instrumentation-knex": "0.44.0",
44-
"plugins/node/opentelemetry-instrumentation-koa": "0.47.0",
45-
"plugins/node/opentelemetry-instrumentation-memcached": "0.43.0",
46-
"plugins/node/opentelemetry-instrumentation-mongodb": "0.51.0",
47-
"plugins/node/opentelemetry-instrumentation-mysql": "0.45.0",
48-
"plugins/node/opentelemetry-instrumentation-mysql2": "0.45.1",
49-
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.44.0",
50-
"plugins/node/opentelemetry-instrumentation-net": "0.43.0",
51-
"plugins/node/opentelemetry-instrumentation-pg": "0.51.0",
52-
"plugins/node/opentelemetry-instrumentation-pino": "0.46.0",
53-
"plugins/node/opentelemetry-instrumentation-redis": "0.46.0",
54-
"plugins/node/opentelemetry-instrumentation-redis-4": "0.46.0",
55-
"plugins/node/opentelemetry-instrumentation-restify": "0.45.0",
56-
"plugins/node/opentelemetry-instrumentation-router": "0.44.0",
57-
"plugins/node/opentelemetry-instrumentation-winston": "0.44.0",
58-
"plugins/web/opentelemetry-instrumentation-document-load": "0.44.0",
59-
"plugins/web/opentelemetry-instrumentation-long-task": "0.44.0",
60-
"plugins/web/opentelemetry-instrumentation-user-interaction": "0.44.0",
61-
"plugins/web/opentelemetry-plugin-react-load": "0.31.0",
62-
"propagators/opentelemetry-propagator-instana": "0.3.2",
63-
"propagators/opentelemetry-propagator-ot-trace": "0.27.2",
64-
"propagators/propagator-aws-xray": "1.26.1",
65-
"propagators/propagator-aws-xray-lambda": "0.53.1"
18+
"packages/opentelemetry-test-utils": "0.45.1",
19+
"packages/winston-transport": "0.10.1",
20+
"plugins/node/instrumentation-amqplib": "0.46.1",
21+
"plugins/node/instrumentation-cucumber": "0.14.1",
22+
"plugins/node/instrumentation-dataloader": "0.16.1",
23+
"plugins/node/instrumentation-fs": "0.19.1",
24+
"plugins/node/instrumentation-kafkajs": "0.7.1",
25+
"plugins/node/instrumentation-lru-memoizer": "0.44.1",
26+
"plugins/node/instrumentation-mongoose": "0.46.1",
27+
"plugins/node/instrumentation-runtime-node": "0.12.2",
28+
"plugins/node/instrumentation-socket.io": "0.46.1",
29+
"plugins/node/instrumentation-tedious": "0.18.1",
30+
"plugins/node/instrumentation-undici": "0.10.1",
31+
"plugins/node/opentelemetry-instrumentation-aws-lambda": "0.50.3",
32+
"plugins/node/opentelemetry-instrumentation-aws-sdk": "0.49.1",
33+
"plugins/node/opentelemetry-instrumentation-bunyan": "0.45.1",
34+
"plugins/node/opentelemetry-instrumentation-cassandra": "0.45.1",
35+
"plugins/node/opentelemetry-instrumentation-connect": "0.43.1",
36+
"plugins/node/opentelemetry-instrumentation-dns": "0.43.1",
37+
"plugins/node/opentelemetry-instrumentation-express": "0.47.1",
38+
"plugins/node/opentelemetry-instrumentation-fastify": "0.44.2",
39+
"plugins/node/opentelemetry-instrumentation-generic-pool": "0.43.1",
40+
"plugins/node/opentelemetry-instrumentation-graphql": "0.47.1",
41+
"plugins/node/opentelemetry-instrumentation-hapi": "0.45.2",
42+
"plugins/node/opentelemetry-instrumentation-ioredis": "0.47.1",
43+
"plugins/node/opentelemetry-instrumentation-knex": "0.44.1",
44+
"plugins/node/opentelemetry-instrumentation-koa": "0.47.1",
45+
"plugins/node/opentelemetry-instrumentation-memcached": "0.43.1",
46+
"plugins/node/opentelemetry-instrumentation-mongodb": "0.52.0",
47+
"plugins/node/opentelemetry-instrumentation-mysql": "0.45.1",
48+
"plugins/node/opentelemetry-instrumentation-mysql2": "0.45.2",
49+
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.44.1",
50+
"plugins/node/opentelemetry-instrumentation-net": "0.43.1",
51+
"plugins/node/opentelemetry-instrumentation-pg": "0.51.1",
52+
"plugins/node/opentelemetry-instrumentation-pino": "0.46.1",
53+
"plugins/node/opentelemetry-instrumentation-redis": "0.46.1",
54+
"plugins/node/opentelemetry-instrumentation-redis-4": "0.46.1",
55+
"plugins/node/opentelemetry-instrumentation-restify": "0.45.1",
56+
"plugins/node/opentelemetry-instrumentation-router": "0.44.1",
57+
"plugins/node/opentelemetry-instrumentation-winston": "0.44.1",
58+
"plugins/web/opentelemetry-instrumentation-document-load": "0.44.1",
59+
"plugins/web/opentelemetry-instrumentation-long-task": "0.44.1",
60+
"plugins/web/opentelemetry-instrumentation-user-interaction": "0.44.1",
61+
"plugins/web/opentelemetry-plugin-react-load": "0.31.1",
62+
"propagators/opentelemetry-propagator-instana": "0.3.3",
63+
"propagators/opentelemetry-propagator-ot-trace": "0.27.3",
64+
"propagators/propagator-aws-xray": "1.26.2",
65+
"propagators/propagator-aws-xray-lambda": "0.53.2"
6666
}

detectors/node/opentelemetry-resource-detector-alibaba-cloud/CHANGELOG.md

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

3+
## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-alibaba-cloud-v0.30.0...resource-detector-alibaba-cloud-v0.30.1) (2025-02-19)
4+
5+
6+
### Dependencies
7+
8+
* The following workspace dependencies were updated
9+
* devDependencies
10+
* @opentelemetry/contrib-test-utils bumped from ^0.45.0 to ^0.45.1
11+
312
## [0.30.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-alibaba-cloud-v0.29.7...resource-detector-alibaba-cloud-v0.30.0) (2025-01-20)
413

514

detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opentelemetry/resource-detector-alibaba-cloud",
3-
"version": "0.30.0",
3+
"version": "0.30.1",
44
"description": "OpenTelemetry resource detector for Alibaba Cloud",
55
"main": "build/src/index.js",
66
"module": "build/esm/index.js",
@@ -43,7 +43,7 @@
4343
},
4444
"devDependencies": {
4545
"@opentelemetry/api": "^1.0.0",
46-
"@opentelemetry/contrib-test-utils": "^0.45.0",
46+
"@opentelemetry/contrib-test-utils": "^0.45.1",
4747
"@types/mocha": "8.2.3",
4848
"@types/node": "18.18.14",
4949
"@types/sinon": "10.0.20",

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

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

3+
## [1.12.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-aws-v1.11.0...resource-detector-aws-v1.12.0) (2025-02-19)
4+
5+
6+
### Features
7+
8+
* **detector-aws:** add more lambda semconv attributes ([#2589](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2589)) ([bef920a](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/bef920a6470d790e741a300b7b26fb5689f4070e))
9+
10+
11+
### Bug Fixes
12+
13+
* **deps:** update otel core experimental to ^0.57.1 ([#2687](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2687)) ([5e20fe2](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/5e20fe2f450a1be4ea100e8a6d196e33ccff0cda))
14+
* **detector-aws:** replace ecs deprecated semconv consts and hardcoded strings ([#2674](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2674)) ([0057f15](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/0057f15057f8bc330100f1124b426b05025873b9))
15+
16+
17+
### Dependencies
18+
19+
* The following workspace dependencies were updated
20+
* devDependencies
21+
* @opentelemetry/contrib-test-utils bumped from ^0.45.0 to ^0.45.1
22+
* @opentelemetry/instrumentation-fs bumped from ^0.19.0 to ^0.19.1
23+
324
## [1.11.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-aws-v1.10.0...resource-detector-aws-v1.11.0) (2025-01-20)
425

526

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opentelemetry/resource-detector-aws",
3-
"version": "1.11.0",
3+
"version": "1.12.0",
44
"description": "OpenTelemetry SDK resource detector for AWS",
55
"main": "build/src/index.js",
66
"module": "build/esm/index.js",
@@ -42,9 +42,9 @@
4242
},
4343
"devDependencies": {
4444
"@opentelemetry/api": "^1.0.0",
45-
"@opentelemetry/contrib-test-utils": "^0.45.0",
46-
"@opentelemetry/instrumentation-fs": "^0.19.0",
47-
"@opentelemetry/instrumentation-http": "^0.57.1",
45+
"@opentelemetry/contrib-test-utils": "^0.45.1",
46+
"@opentelemetry/instrumentation-fs": "^0.19.1",
47+
"@opentelemetry/instrumentation-http": "^0.57.2",
4848
"@types/mocha": "8.2.3",
4949
"@types/node": "18.18.14",
5050
"@types/sinon": "10.0.20",

detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsLambdaDetectorSync.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ import {
2222
ResourceDetectionConfig,
2323
} from '@opentelemetry/resources';
2424
import {
25-
ATTR_CLOUD_PROVIDER,
25+
ATTR_AWS_LOG_GROUP_NAMES,
2626
ATTR_CLOUD_PLATFORM,
27+
ATTR_CLOUD_PROVIDER,
2728
ATTR_CLOUD_REGION,
28-
ATTR_FAAS_VERSION,
29+
ATTR_FAAS_INSTANCE,
2930
ATTR_FAAS_NAME,
31+
ATTR_FAAS_MAX_MEMORY,
32+
ATTR_FAAS_VERSION,
3033
CLOUD_PROVIDER_VALUE_AWS,
3134
CLOUD_PLATFORM_VALUE_AWS_LAMBDA,
3235
} from '../semconv';
@@ -38,27 +41,37 @@ import {
3841
*/
3942
export class AwsLambdaDetectorSync implements DetectorSync {
4043
detect(_config?: ResourceDetectionConfig): IResource {
41-
const functionName = process.env.AWS_LAMBDA_FUNCTION_NAME;
42-
if (!functionName) {
44+
// Check if running inside AWS Lambda environment
45+
const executionEnv = process.env.AWS_EXECUTION_ENV;
46+
if (!executionEnv?.startsWith('AWS_Lambda_')) {
4347
return Resource.empty();
4448
}
4549

46-
const functionVersion = process.env.AWS_LAMBDA_FUNCTION_VERSION;
50+
// These environment variables are guaranteed to be present in Lambda environment
51+
// https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
4752
const region = process.env.AWS_REGION;
53+
const functionName = process.env.AWS_LAMBDA_FUNCTION_NAME;
54+
const functionVersion = process.env.AWS_LAMBDA_FUNCTION_VERSION;
55+
const memorySize = process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE;
56+
57+
// These environment variables are not available in Lambda SnapStart functions
58+
const logGroupName = process.env.AWS_LAMBDA_LOG_GROUP_NAME;
59+
const logStreamName = process.env.AWS_LAMBDA_LOG_STREAM_NAME;
4860

4961
const attributes: ResourceAttributes = {
50-
[ATTR_CLOUD_PROVIDER]: String(CLOUD_PROVIDER_VALUE_AWS),
51-
[ATTR_CLOUD_PLATFORM]: String(CLOUD_PLATFORM_VALUE_AWS_LAMBDA),
62+
[ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AWS,
63+
[ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AWS_LAMBDA,
64+
[ATTR_CLOUD_REGION]: region,
65+
[ATTR_FAAS_NAME]: functionName,
66+
[ATTR_FAAS_VERSION]: functionVersion,
67+
[ATTR_FAAS_MAX_MEMORY]: parseInt(memorySize!) * 1024 * 1024,
5268
};
53-
if (region) {
54-
attributes[ATTR_CLOUD_REGION] = region;
55-
}
5669

57-
if (functionName) {
58-
attributes[ATTR_FAAS_NAME] = functionName;
70+
if (logGroupName) {
71+
attributes[ATTR_AWS_LOG_GROUP_NAMES] = [logGroupName];
5972
}
60-
if (functionVersion) {
61-
attributes[ATTR_FAAS_VERSION] = functionVersion;
73+
if (logStreamName) {
74+
attributes[ATTR_FAAS_INSTANCE] = logStreamName;
6275
}
6376

6477
return new Resource(attributes);

detectors/node/opentelemetry-resource-detector-aws/src/semconv.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,28 @@ export const ATTR_CONTAINER_NAME = 'container.name';
239239
*/
240240
export const ATTR_FAAS_NAME = 'faas.name';
241241

242+
/**
243+
* The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.
244+
*
245+
* @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de
246+
*
247+
* @note * **AWS Lambda:** Use the (full) log stream name.
248+
*
249+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
250+
*/
251+
export const ATTR_FAAS_INSTANCE = 'faas.instance';
252+
253+
/**
254+
* The amount of memory available to the serverless function converted to Bytes.
255+
*
256+
* @example 134217728
257+
*
258+
* @note It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576).
259+
*
260+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
261+
*/
262+
export const ATTR_FAAS_MAX_MEMORY = 'faas.max_memory';
263+
242264
/**
243265
* The immutable version of the function being executed.
244266
*

detectors/node/opentelemetry-resource-detector-aws/test/detectors/AwsLambdaDetector.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('awsLambdaDetector', () => {
3535

3636
describe('on lambda', () => {
3737
it('fills resource', async () => {
38+
process.env.AWS_EXECUTION_ENV = 'AWS_Lambda_nodejs22.x';
3839
process.env.AWS_LAMBDA_FUNCTION_NAME = 'name';
3940
process.env.AWS_LAMBDA_FUNCTION_VERSION = 'v1';
4041
process.env.AWS_REGION = 'us-east-1';

0 commit comments

Comments
 (0)