Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ To check for security updates, go to [Security announcements for the Elastic sta
% ### Fixes [edot-node-X.X.X-fixes]
% *

## version.next [edot-node-X.X.X-release-notes]

### Features and enhancements [edot-node-X.X.X-features-enhancements]
*

### Fixes [edot-node-X.X.X-fixes]
Comment on lines +32 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this will show in the docs if merged to main, I think. We sure about that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we had used next rather than X.X.X before. The next is better when this is public. I'm guessing it was me that changed the commented out template above to use X.X.X to attempt to remind me/others to put the actual version in there when doing a release.


* Restore upstream Google Cloud Platorm resource detector. ([#1042](https://github.com/elastic/elastic-otel-node/pull/1042))

## 1.5.0 [edot-node-1.5.0-release-notes]

### Chores [edot-node-1.5.0-chores]
Expand Down
150 changes: 0 additions & 150 deletions packages/opentelemetry-node/lib/detector-gcp.js

This file was deleted.

5 changes: 2 additions & 3 deletions packages/opentelemetry-node/lib/detectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const {
const {
containerDetector,
} = require('@opentelemetry/resource-detector-container');
const {gcpDetector} = require('@opentelemetry/resource-detector-gcp');

const {
envDetector,
hostDetector,
Expand All @@ -35,7 +37,6 @@ const {
} = require('@opentelemetry/resources');

const {log} = require('./logging');
const {gcpDetector} = require('./detector-gcp');

// @ts-ignore - compiler options do not allow lookp outside `lib` folder
const ELASTIC_SDK_VERSION = require('../package.json').version;
Expand Down Expand Up @@ -72,8 +73,6 @@ const defaultDetectors = {
awsEksDetector,
awsLambdaDetector,
],
// TODO: Switch back to `@opentelemetry/resource-detector-gcp` when
// https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2320 is complete
gcp: gcpDetector,
azure: [azureAppServiceDetector, azureFunctionsDetector, azureVmDetector],
};
Expand Down
10 changes: 10 additions & 0 deletions packages/opentelemetry-node/lib/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

const os = require('os');

const {
AsyncLocalStorageContextManager,
} = require('@opentelemetry/context-async-hooks');
const {
getBooleanFromEnv,
getStringFromEnv,
Expand Down Expand Up @@ -66,7 +69,7 @@
try {
await shutdownFn();
} catch (err) {
console.warn('warning: error shutting down OTel SDK', err);

Check warning on line 72 in packages/opentelemetry-node/lib/sdk.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
}
process.exit(128 + os.constants.signals.SIGTERM);
});
Expand All @@ -76,7 +79,7 @@
try {
await shutdownFn();
} catch (err) {
console.warn('warning: error shutting down OTel SDK', err);

Check warning on line 82 in packages/opentelemetry-node/lib/sdk.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
}
});
}
Expand All @@ -94,6 +97,13 @@
function startNodeSDK(cfg = {}) {
log.trace('startNodeSDK cfg:', cfg);

// This is a temporary fix for traces being sent for GCP resource detector
// ref: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2320
// which hopefully will be fixed in https://github.com/open-telemetry/opentelemetry-js/pull/5930
// TL;DR: context manager is Noop hen calling `detect`, hence the suppress tracing key
// in the context is not propagated to other functions
api.context.setGlobalContextManager(new AsyncLocalStorageContextManager());

// TODO: test behaviour with OTEL_SDK_DISABLED.
// Do we still log preamble? See NodeSDK _disabled handling.
// Do we still attempt to enableHostMetrics()?
Expand Down
Loading
Loading