Skip to content

Commit

Permalink
Merge branch 'main' into fix/aws-resource-detector-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc authored Jun 13, 2024
2 parents 8363984 + caf7cb5 commit e364811
Show file tree
Hide file tree
Showing 149 changed files with 26,845 additions and 21,240 deletions.
108 changes: 54 additions & 54 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{
"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-alibaba-cloud": "0.28.10",
"detectors/node/opentelemetry-resource-detector-aws": "1.5.1",
"detectors/node/opentelemetry-resource-detector-azure": "0.2.9",
"detectors/node/opentelemetry-resource-detector-container": "0.3.11",
"detectors/node/opentelemetry-resource-detector-gcp": "0.29.10",
"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",
"detectors/node/opentelemetry-resource-detector-instana": "0.10.0",
"metapackages/auto-instrumentations-node": "0.47.1",
"metapackages/auto-instrumentations-web": "0.40.0",
"packages/baggage-span-processor": "0.3.1",
"packages/opentelemetry-host-metrics": "0.35.2",
"packages/opentelemetry-id-generator-aws-xray": "1.2.2",
"packages/opentelemetry-propagation-utils": "0.30.9",
"packages/opentelemetry-propagation-utils": "0.30.10",
"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",
"packages/opentelemetry-test-utils": "0.40.0",
"packages/winston-transport": "0.4.0",
"plugins/node/instrumentation-amqplib": "0.38.0",
"plugins/node/instrumentation-cucumber": "0.7.0",
"plugins/node/instrumentation-dataloader": "0.10.0",
"plugins/node/instrumentation-fs": "0.13.0",
"plugins/node/instrumentation-kafkajs": "0.1.0",
"plugins/node/instrumentation-lru-memoizer": "0.38.0",
"plugins/node/instrumentation-mongoose": "0.39.0",
"plugins/node/instrumentation-runtime-node": "0.5.0",
"plugins/node/instrumentation-socket.io": "0.40.0",
"plugins/node/instrumentation-tedious": "0.11.0",
"plugins/node/instrumentation-undici": "0.3.0",
"plugins/node/opentelemetry-instrumentation-aws-lambda": "0.42.0",
"plugins/node/opentelemetry-instrumentation-aws-sdk": "0.42.0",
"plugins/node/opentelemetry-instrumentation-bunyan": "0.39.0",
"plugins/node/opentelemetry-instrumentation-cassandra": "0.39.0",
"plugins/node/opentelemetry-instrumentation-connect": "0.37.0",
"plugins/node/opentelemetry-instrumentation-dns": "0.37.0",
"plugins/node/opentelemetry-instrumentation-express": "0.40.1",
"plugins/node/opentelemetry-instrumentation-fastify": "0.37.0",
"plugins/node/opentelemetry-instrumentation-generic-pool": "0.37.0",
"plugins/node/opentelemetry-instrumentation-graphql": "0.41.0",
"plugins/node/opentelemetry-instrumentation-hapi": "0.39.0",
"plugins/node/opentelemetry-instrumentation-ioredis": "0.41.0",
"plugins/node/opentelemetry-instrumentation-knex": "0.37.0",
"plugins/node/opentelemetry-instrumentation-koa": "0.41.0",
"plugins/node/opentelemetry-instrumentation-memcached": "0.37.0",
"plugins/node/opentelemetry-instrumentation-mongodb": "0.45.0",
"plugins/node/opentelemetry-instrumentation-mysql": "0.39.0",
"plugins/node/opentelemetry-instrumentation-mysql2": "0.39.0",
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.38.0",
"plugins/node/opentelemetry-instrumentation-net": "0.37.0",
"plugins/node/opentelemetry-instrumentation-pg": "0.42.0",
"plugins/node/opentelemetry-instrumentation-pino": "0.40.0",
"plugins/node/opentelemetry-instrumentation-redis": "0.40.0",
"plugins/node/opentelemetry-instrumentation-redis-4": "0.40.0",
"plugins/node/opentelemetry-instrumentation-restify": "0.39.0",
"plugins/node/opentelemetry-instrumentation-router": "0.38.0",
"plugins/node/opentelemetry-instrumentation-winston": "0.38.0",
"plugins/web/opentelemetry-instrumentation-document-load": "0.39.0",
"plugins/web/opentelemetry-instrumentation-long-task": "0.39.0",
"plugins/web/opentelemetry-instrumentation-user-interaction": "0.39.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"
Expand Down
2 changes: 1 addition & 1 deletion GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ To support this use case, you can choose one of the following options:
...
```

If possible, this is the prefered option, as it uses types from a maintained package.
If possible, this is the preferred option, as it uses types from a maintained package.

Notice that types may introduce breaking changes in major semver releases, and instrumentation should choose a `@types/` package that is compatible with the version range it supports.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.28.10](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-alibaba-cloud-v0.28.9...resource-detector-alibaba-cloud-v0.28.10) (2024-06-06)


### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.39.0 to ^0.40.0

## [0.28.9](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-alibaba-cloud-v0.28.8...resource-detector-alibaba-cloud-v0.28.9) (2024-04-25)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/resource-detector-alibaba-cloud",
"version": "0.28.9",
"version": "0.28.10",
"description": "OpenTelemetry resource detector for Alibaba Cloud",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down Expand Up @@ -40,7 +40,7 @@
},
"devDependencies": {
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.39.0",
"@opentelemetry/contrib-test-utils": "^0.40.0",
"@types/mocha": "8.2.3",
"@types/node": "18.6.5",
"@types/sinon": "10.0.18",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [1.5.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-aws-v1.5.0...resource-detector-aws-v1.5.1) (2024-06-06)


### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.39.0 to ^0.40.0

## [1.5.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-aws-v1.4.2...resource-detector-aws-v1.5.0) (2024-05-15)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/resource-detector-aws",
"version": "1.5.0",
"version": "1.5.1",
"description": "OpenTelemetry SDK resource detector for AWS",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.39.0",
"@opentelemetry/contrib-test-utils": "^0.40.0",
"@types/mocha": "8.2.3",
"@types/node": "18.6.5",
"@types/sinon": "10.0.18",
Expand Down
21 changes: 21 additions & 0 deletions detectors/node/opentelemetry-resource-detector-azure/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [0.2.9](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-azure-v0.2.8...resource-detector-azure-v0.2.9) (2024-06-10)


### Bug Fixes

* **azure-functions-resource-detector:** Update Azure Functions Detector to Consider WEBSITE_SKU ([#2251](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2251)) ([93776fa](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/93776fad10fb46ba4ba2bfe31a4825ec0929fd50))

## [0.2.8](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-azure-v0.2.7...resource-detector-azure-v0.2.8) (2024-06-06)


### Bug Fixes

* Update Azure Functions Detector Collected Attributes ([#2233](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2233)) ([7272ca8](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/7272ca85625248718c6276559b36853ea93ae97e))


### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.39.0 to ^0.40.0

## [0.2.7](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-azure-v0.2.6...resource-detector-azure-v0.2.7) (2024-04-25)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/resource-detector-azure",
"version": "0.2.7",
"version": "0.2.9",
"description": "OpenTelemetry SDK resource detector for Azure",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.39.0",
"@opentelemetry/contrib-test-utils": "^0.40.0",
"@types/mocha": "8.2.3",
"@types/node": "18.6.5",
"@types/sinon": "10.0.18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
WEBSITE_SITE_NAME,
WEBSITE_SLOT_NAME,
CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,
FUNCTIONS_VERSION,
} from '../types';
import {
SEMRESATTRS_CLOUD_REGION,
Expand All @@ -37,7 +36,7 @@ import {
CLOUDPROVIDERVALUES_AZURE,
CLOUDPLATFORMVALUES_AZURE_APP_SERVICE,
} from '@opentelemetry/semantic-conventions';
import { getAzureResourceUri } from '../utils';
import { getAzureResourceUri, isAzureFunction } from '../utils';

const APP_SERVICE_ATTRIBUTE_ENV_VARS = {
[SEMRESATTRS_CLOUD_REGION]: REGION_NAME,
Expand All @@ -55,8 +54,7 @@ class AzureAppServiceDetector implements DetectorSync {
detect(): IResource {
let attributes = {};
const websiteSiteName = process.env[WEBSITE_SITE_NAME];
const isAzureFunction = !!process.env[FUNCTIONS_VERSION];
if (websiteSiteName && !isAzureFunction) {
if (websiteSiteName && !isAzureFunction()) {
attributes = {
...attributes,
[SEMRESATTRS_SERVICE_NAME]: websiteSiteName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ import {
} from '@opentelemetry/semantic-conventions';
import {
WEBSITE_SITE_NAME,
FUNCTIONS_VERSION,
WEBSITE_INSTANCE_ID,
FUNCTIONS_MEM_LIMIT,
REGION_NAME,
CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,
} from '../types';
import { getAzureResourceUri } from '../utils';
import { getAzureResourceUri, isAzureFunction } from '../utils';

const AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS = {
[SEMRESATTRS_SERVICE_NAME]: WEBSITE_SITE_NAME,
Expand All @@ -51,13 +50,13 @@ class AzureFunctionsDetector implements DetectorSync {
detect(): IResource {
let attributes = {};
const serviceName = process.env[WEBSITE_SITE_NAME];
const functionVersion = process.env[FUNCTIONS_VERSION];

/**
* Checks that we are operating within an Azure Function using the function version since WEBSITE_SITE_NAME
* will exist in Azure App Service as well and detectors should be mutually exclusive.
* If the function version is not present, we check for the website sku to determine if it is a function.
*/
if (serviceName && functionVersion) {
if (serviceName && isAzureFunction()) {
const functionInstance = process.env[WEBSITE_INSTANCE_ID];
const functionMemLimit = process.env[FUNCTIONS_MEM_LIMIT];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const WEBSITE_OWNER_NAME = 'WEBSITE_OWNER_NAME';
export const WEBSITE_RESOURCE_GROUP = 'WEBSITE_RESOURCE_GROUP';
export const WEBSITE_SITE_NAME = 'WEBSITE_SITE_NAME';
export const WEBSITE_SLOT_NAME = 'WEBSITE_SLOT_NAME';
export const WEBSITE_SKU = 'WEBSITE_SKU';

export const FUNCTIONS_VERSION = 'FUNCTIONS_EXTENSION_VERSION';
export const FUNCTIONS_MEM_LIMIT = 'WEBSITE_MEMORY_LIMIT_MB';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
* limitations under the License.
*/

import { WEBSITE_OWNER_NAME, WEBSITE_RESOURCE_GROUP } from './types';
import {
FUNCTIONS_VERSION,
WEBSITE_OWNER_NAME,
WEBSITE_RESOURCE_GROUP,
WEBSITE_SKU,
} from './types';

export function getAzureResourceUri(
websiteSiteName: string
Expand All @@ -33,3 +38,10 @@ export function getAzureResourceUri(

return `/subscriptions/${subscriptionId}/resourceGroups/${websiteResourceGroup}/providers/Microsoft.Web/sites/${websiteSiteName}`;
}

export function isAzureFunction(): boolean {
return !!(
process.env[FUNCTIONS_VERSION] ||
process.env[WEBSITE_SKU] === 'FlexConsumption'
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,27 @@ describe('AzureFunctionsDetector', () => {
);
});
});

it('should detect azure functions if websiteSku is defined as FlexConsumption', () => {
assert.ok(!process.env.WEBSITE_SKU && !process.env.FUNCTIONS_VERSION);
process.env.WEBSITE_SITE_NAME = 'test-service';
process.env.REGION_NAME = 'test-region';
process.env.WEBSITE_INSTANCE_ID = 'test-instance-id';
process.env.WEBSITE_SKU = 'FlexConsumption';
process.env.WEBSITE_MEMORY_LIMIT_MB = '1000';
process.env.WEBSITE_OWNER_NAME = 'test-owner-name';
process.env.WEBSITE_RESOURCE_GROUP = 'test-resource-group';

const resource = detectResourcesSync({
detectors: [azureFunctionsDetector, azureAppServiceDetector],
});
assert.ok(resource);
const attributes = resource.attributes;
assert.strictEqual(attributes[SEMRESATTRS_SERVICE_NAME], 'test-service');
assert.strictEqual(attributes[SEMRESATTRS_CLOUD_PROVIDER], 'azure');

// Should not detect app service values
assert.strictEqual(attributes[SEMRESATTRS_SERVICE_INSTANCE_ID], undefined);
assert.strictEqual(attributes[SEMRESATTRS_PROCESS_PID], process.pid);
delete process.env.WEBSITE_SKU;
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [0.3.11](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-container-v0.3.10...resource-detector-container-v0.3.11) (2024-06-10)


### Bug Fixes

* ContainerId not detected post version 0.2.2 ([#2270](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2270)) ([9761a91](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/9761a9160c862b9f8a35c00afc26217973e4462a))

## [0.3.10](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-container-v0.3.9...resource-detector-container-v0.3.10) (2024-06-06)


### Dependencies

* The following workspace dependencies were updated
* devDependencies
* @opentelemetry/contrib-test-utils bumped from ^0.39.0 to ^0.40.0

## [0.3.9](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-container-v0.3.8...resource-detector-container-v0.3.9) (2024-04-25)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/resource-detector-container",
"version": "0.3.9",
"version": "0.3.11",
"description": "Opentelemetry resource detector to get container resource attributes",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"devDependencies": {
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.39.0",
"@opentelemetry/contrib-test-utils": "^0.40.0",
"@types/mocha": "8.2.3",
"@types/node": "18.6.5",
"@types/sinon": "10.0.18",
Expand Down
Loading

0 comments on commit e364811

Please sign in to comment.