Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reviewing TODO comments #129

Merged
merged 1 commit into from
Apr 10, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- '16'
- '16.0'
- '14'
- '14.17' # TODO: is this our actual min? same as elastic-apm-node
- '14.17'

runs-on: ubuntu-latest

Expand Down
1 change: 0 additions & 1 deletion packages/opentelemetry-node/lib/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

// TODO: consider having a constants file
const ELASTIC_SDK_VERSION = require('../package.json').version;
const OTEL_SDK_VERSION =
require('@opentelemetry/sdk-node/package.json').version;
Expand Down
2 changes: 0 additions & 2 deletions packages/opentelemetry-node/lib/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class ElasticNodeSDK extends NodeSDK {

// Setup & fix some env
setupEnvironment();
// TODO detect service name
Copy link
Member Author

Choose a reason for hiding this comment

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

Per https://github.com/open-telemetry/semantic-conventions/blob/main/docs/attributes-registry/service.md

If the value was not specified, SDKs MUST fallback to unknown_service: concatenated with process.executable.name, e.g. unknown_service:bash. If process.executable.name is not available, the value MUST be set to unknown_service.

NodeSDK is already handling those MUST requirements. I'd hesitate to diverge from that by looking around in nearby package.json files. We could later add a feature request issue for this if someone wants/needs it.


// - NodeSDK defaults to `TracerProviderWithEnvExporters` if neither
// `spanProcessor` nor `traceExporter` are passed in.
Expand All @@ -62,7 +61,6 @@ class ElasticNodeSDK extends NodeSDK {
processDetectorSync,
// hostDetectorSync is not currently in the OTel default, but may be added
hostDetectorSync,
// TODO cloud/container detectors by default
Copy link
Member Author

Choose a reason for hiding this comment

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

opened #128 for this

],
};

Expand Down
13 changes: 0 additions & 13 deletions packages/opentelemetry-node/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ const {ElasticNodeSDK} = require('./lib/sdk.js');

const sdk = new ElasticNodeSDK();

// TODO sdk shutdown: also SIGINT?
// TODO sdk shutdown handlers: better log on err
// TODO sdk shutdown: make these handlers configurable?
// - If so, could move these into sdk.js and it could use its logger for logging an error.
// - Note, only want luggite.warn over console.warn if errSerializer gets
// all attributes (console.warn shows more data for ECONNREFUSED)
// TODO sdk shutdown beforeExit: skip this for Lambda (also Azure Fns?)
// TODO sdh shutdown: call process.exit?
// TODO: Whether we have a signal handler for sdk.shutdown() is debatable. It
// definitely *can* change program behaviour. Let's reconsider.
// Note: See https://github.com/open-telemetry/opentelemetry-js/issues/1521
// for some thoughts on automatic handling to shutdown the SDK.

Copy link
Member Author

Choose a reason for hiding this comment

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

moved all this to #127

process.on('SIGTERM', async () => {
try {
await sdk.shutdown();
Expand Down
2 changes: 0 additions & 2 deletions packages/opentelemetry-node/test/instr-winston.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const testFixtures = [
recs = stdout.trim().split(/\n/g).map(JSON.parse);
},
checkTelemetry: (t, col) => {
// We expect telemetry like this:
// TODO: waiting for log sending from https://github.com/open-telemetry/opentelemetry-js-contrib/pull/1837 to be in an otel-js-contrib release
Copy link
Member Author

Choose a reason for hiding this comment

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

Already have this. Forgot to remove this TODO comment in the last update to this test file.

const spans = col.sortedSpans;
t.equal(spans.length, 1);

Expand Down
4 changes: 0 additions & 4 deletions packages/opentelemetry-node/test/testutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ class TestCollector {
});
});

// TODO: for now we do not need any type of sorting
// To do so we need to take into account that each metric has a different
// property depending of the DataPointType (GAUGE, HISTOGRAM, ...) they have
return metrics;
}

Expand All @@ -361,7 +358,6 @@ class TestCollector {
});
});

// TODO: sorting required? Or is incoming order sufficient? s/logs/sortedLogs/ if actively sorting.
Copy link
Member Author

Choose a reason for hiding this comment

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

The TODOs removed here didn't add any value. If we need sorting of metrics and logs on the TestCollector, we'll come here to add it.

return logs;
}
}
Expand Down