profile
viewpoint

Dynatrace/zakzak 32

Makes microbenchmarking in node.js projects easier by using a "unit test"-like approach.

Dynatrace/OneAgent-SDK-for-NodeJs 9

Enables custom tracing of Node.js applications in Dynatrace

Dynatrace/agent-nodejs 7

Dynatrace agent for PaaS environments

dynatrace-oss-contrib/DefinitelyTyped 0

The repository for high quality TypeScript type definitions.

dynatrace-oss-contrib/nan 0

Native Abstractions for Node.js

dynatrace-oss-contrib/node 0

Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:

dynatrace-oss-contrib/sinon 0

Test spies, stubs and mocks for JavaScript.

Flarna/DefinitelyTyped 0

The repository for high quality TypeScript type definitions.

Flarna/diagnostics 0

Node.js Diagnostics Working Group

Flarna/nan 0

Native Abstractions for Node.js

pull request commentnodejs/node

events: convert errorMonitor to normal property

Friendly ping, would be nice if someone could move this forward.

Flarna

comment created time in 9 hours

Pull request review commentnodejs/diagnostics

docs(documentation): improve process crash

 To find out if the process exited because of a `process.exit()` call, follow [Us  ### Process exits with Native Stack Trace -TBD+Some Node.js application uses native modules to re-use existing components or+performance optimize specific areas. A common example for native modules are+database drivers. In the case our native module has an issue it can crash the+Node.js application which will generate a native stack trace. -### Process exits with unmeaningful Stack Trace+You can find the most common scenarios for native crashes here: -TBD+1. Native module crashes due bug

Yes thats better. Other cases I have seen several times:

  • Access garbage collected data
  • Call v8 APIs without HandleScope
  • Call v8 APIs from wrong Thread
hekike

comment created time in 10 hours

Pull request review commentnodejs/diagnostics

docs(documentation): improve process crash

 To find out if the process exited because of a `process.exit()` call, follow [Us  ### Process exits with Native Stack Trace -TBD+Some Node.js application uses native modules to re-use existing components or+performance optimize specific areas. A common example for native modules are+database drivers. In the case our native module has an issue it can crash the+Node.js application which will generate a native stack trace. -### Process exits with unmeaningful Stack Trace+You can find the most common scenarios for native crashes here: -TBD+1. Native module crashes due bug+2. Native module crashes due memory leak (native memory leak)+3. Bugs in Node.js runtime and dependencies+  - For example: V8 checks, when input checking is missing can lead to crash

Maybe For example, V8 checks, when input data checking to v8 APIs checking is missing can lead to a crash.

hekike

comment created time in 10 hours

issue commentopen-telemetry/opentelemetry-js

SpanOptions.isRecording and it's default in Tracer.startSpan

@mayurkale22 Your links point to span.isRecording() which is fine. https://github.com/open-telemetry/opentelemetry-js/blob/c87e521255ff49f87ae2db4c61d249e6d21622f4/packages/opentelemetry-api/src/trace/span.ts#L102

But I would like to discuss SpanOptions.isRecording. https://github.com/open-telemetry/opentelemetry-js/blob/c87e521255ff49f87ae2db4c61d249e6d21622f4/packages/opentelemetry-api/src/trace/SpanOptions.ts#L40

Flarna

comment created time in 10 hours

Pull request review commentnodejs/node

async_hooks: add sync enterWith to async storage

 If this method is called outside of an asynchronous context initialized by calling `asyncLocalStorage.run` or `asyncLocalStorage.runAndReturn`, it will return `undefined`. +### `asyncLocalStorage.enterWith(store)`+<!-- YAML+added: REPLACEME+-->++* `store` {any}++Calling `asyncLocalStorage.enterWith(store)` will transition into the context+for the remainder of the current synchronous execution and will persist+through any following asynchronous calls.++Example:++```js+const store = { id: 1 };+asyncLocalStorage.enterWith(store);+asyncLocalStorage.getStore(); // Returns the store object+someAsyncOperation(() => {+  asyncLocalStorage.getStore(); // Returns the same object+});+```++This transition will continue for the _entire_ synchronous execution.

@vdeturckheim I will wait on the result of this one first.

Qard

comment created time in 17 hours

Pull request review commentnodejs/node

async_hooks: add sync enterWith to async storage

 If this method is called outside of an asynchronous context initialized by calling `asyncLocalStorage.run` or `asyncLocalStorage.runAndReturn`, it will return `undefined`. +### `asyncLocalStorage.enterWith(store)`+<!-- YAML+added: REPLACEME+-->++* `store` {any}++Calling `asyncLocalStorage.enterWith(store)` will transition into the context+for the remainder of the current synchronous execution and will persist+through any following asynchronous calls.++Example:++```js+const store = { id: 1 };+asyncLocalStorage.enterWith(store);+asyncLocalStorage.getStore(); // Returns the store object+someAsyncOperation(() => {+  asyncLocalStorage.getStore(); // Returns the same object+});+```++This transition will continue for the _entire_ synchronous execution.

Sorry, but I think my last statements were quite unclear as I often wrote just run() but actually meant runSyncAndReturn().

Nesting the async run is not problem as actually they are not really nested. Mixing it with enterWith() should be quite ok as the enterWith() just move from one store to the next.

Problematic seems to be only the nesting of runSyncAndReturn(), independent of enterWith(). I haven't discovered this during the initial PR, just noticed it here even it's not caused by this PR. Maybe better to move this discussion to a separated issue.

Qard

comment created time in 17 hours

Pull request review commentnodejs/diagnostics

docs(documentation): improve process crash

 To find out if the process exited because of a `process.exit()` call, follow [Us  ### Process exits with Native Stack Trace -TBD+Some Node.js application uses native modules to re-use existing components or+performance optimize specific areas. A common example for native modules are+database drivers. In the case our native module has an issue it can crash the+Node.js application which will generate a native stack trace. -### Process exits with unmeaningful Stack Trace+You can find the most common scenarios for native crashes here: -TBD+1. Native module crashes due bug+2. Native module crashes due memory leak (native memory leak)+3. Bugs in Node.js runtime and dependencies+  - For example: V8 checks, when input checking is missing can lead to crash

checks in v8 are actually no bugs. missing validation in user code is not a bug in Node.js or it's dependencies.

hekike

comment created time in 17 hours

Pull request review commentnodejs/diagnostics

docs(documentation): improve process crash

 To find out if the process exited because of a `process.exit()` call, follow [Us  ### Process exits with Native Stack Trace -TBD+Some Node.js application uses native modules to re-use existing components or+performance optimize specific areas. A common example for native modules are+database drivers. In the case our native module has an issue it can crash the+Node.js application which will generate a native stack trace. -### Process exits with unmeaningful Stack Trace+You can find the most common scenarios for native crashes here: -TBD+1. Native module crashes due bug

This is quite generic and includes point 2 and 3.

hekike

comment created time in 17 hours

Pull request review commentnodejs/node

async_hooks: add sync enterWith to async storage

 If this method is called outside of an asynchronous context initialized by calling `asyncLocalStorage.run` or `asyncLocalStorage.runAndReturn`, it will return `undefined`. +### `asyncLocalStorage.enterWith(store)`+<!-- YAML+added: REPLACEME+-->++* `store` {any}++Calling `asyncLocalStorage.enterWith(store)` will transition into the context+for the remainder of the current synchronous execution and will persist+through any following asynchronous calls.++Example:++```js+const store = { id: 1 };+asyncLocalStorage.enterWith(store);+asyncLocalStorage.getStore(); // Returns the store object+someAsyncOperation(() => {+  asyncLocalStorage.getStore(); // Returns the same object+});+```++This transition will continue for the _entire_ synchronous execution.

Yes, nesting is already problematic now, even this fails:

cls.runSyncAndReturn(() => {
  cls.getStore().set('foo', 'bar')
  cls.runSyncAndReturn(() => {})
  cls.getStore().get('foo') // it's not bar
})

The enterWith(getStore() || my_new_store) pattern won't solve above problem.

I think throwing is better then silently overwriting/clearing. I can imaging that it may be incredible hard to debug why a store is missing at some place. Could be normal context loss or silent overwrite...

An overwriting enterWith() sounds somehow ok as it is a transition. Users could implement a stack on their own if really needed. Seems the statement below that the actual problem is exit holds true.

By the way, enterWith(undefined) is actually an exit. Is this intended?

But in any case it should be documented.

Qard

comment created time in 17 hours

Pull request review commentnodejs/node

async_hooks: add sync enterWith to async storage

 If this method is called outside of an asynchronous context initialized by calling `asyncLocalStorage.run` or `asyncLocalStorage.runAndReturn`, it will return `undefined`. +### `asyncLocalStorage.enterWith(store)`+<!-- YAML+added: REPLACEME+-->++* `store` {any}++Calling `asyncLocalStorage.enterWith(store)` will transition into the context+for the remainder of the current synchronous execution and will persist+through any following asynchronous calls.++Example:++```js+const store = { id: 1 };+asyncLocalStorage.enterWith(store);+asyncLocalStorage.getStore(); // Returns the store object+someAsyncOperation(() => {+  asyncLocalStorage.getStore(); // Returns the same object+});+```++This transition will continue for the _entire_ synchronous execution.

I understand that it is the intention to use either run or enterWith() and it's not built for being use inside the callback passed to run().

But it's not ensured nor does the user get any hint about wrong usage. I have usecases in mind where a high layer abstraction of some driver does sync calls to an lower layer. Both are instrumented by an APM as the lower layer can be use also standalone. I think in such cases it may happen easily that enterWith() is called twice or inside a run() callback.

The question is should we disallow this? Warn the user about it? or just document what happens. A user can always do a getStore() first to check if a context is active or not.

Regarding stack/value: Currently a nested run or enterWith() overwrites the store in the resource. So after the inner run is done the store is undefined. Using as stack would restore the previous store.

Qard

comment created time in 18 hours

Pull request review commentnodejs/node

async_hooks: add sync enterWith to async storage

 If this method is called outside of an asynchronous context initialized by calling `asyncLocalStorage.run` or `asyncLocalStorage.runAndReturn`, it will return `undefined`. +### `asyncLocalStorage.enterWith(store)`+<!-- YAML+added: REPLACEME+-->++* `store` {any}++Calling `asyncLocalStorage.enterWith(store)` will transition into the context+for the remainder of the current synchronous execution and will persist+through any following asynchronous calls.++Example:++```js+const store = { id: 1 };+asyncLocalStorage.enterWith(store);+asyncLocalStorage.getStore(); // Returns the store object+someAsyncOperation(() => {+  asyncLocalStorage.getStore(); // Returns the same object+});+```++This transition will continue for the _entire_ synchronous execution.

This is actually not true if enterWith() is called within run() as there is no stack, just a value.

Qard

comment created time in 19 hours

PR opened nodejs/node

[v12.x] deps: V8: cherry-pick cb1c2b0fbfe7

Original commit message:

Remove noscript_shared_function_infos

SharedFunctionInfos that do not belong to a script were tracked in
noscript_shared_function_infos. However this was only used in object-stats.
Remove this since it was actually leaking memory in some use cases.

Bug: v8:9674
Change-Id: I9482f7e5dedf975666a70684b3d2ea04c9a23518
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1798423
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63685}

Refs: https://github.com/v8/v8/commit/cb1c2b0fbfe730ed46d2b7a1ad3f58a21facc477 Refs: https://github.com/nodejs/node/issues/31914

Checklist
  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] commit message follows commit guidelines
+1 -110

0 comment

12 changed files

pr created time in a day

create barnchdynatrace-oss-contrib/node

branch : backport-cb1c2b0

created branch time in a day

pull request commentopen-telemetry/opentelemetry-js

Add propagation API

Maybe I'm not understanding this fully but I miss the Composite Propagator. Or is this added by a separate PR?

dyladan

comment created time in a day

push eventdynatrace-oss-contrib/node

Gerhard Stoebich

commit sha cbe78d1806505d2a5c00baa532f868022c7a0d71

ignore asyncIds created before test hook is installed

view details

push time in a day

issue openedopen-telemetry/opentelemetry-js

SpanOptions.isRecording and it's default in Tracer.startSpan

  • [x] This only affects the JavaScript OpenTelemetry library
  • [ ] This may affect other libraries, but I would like to get opinions here first

I'm confused about the SpanOptions.isRecording field and in special that it is defaulted to false in Tracer.startSpan().

On the other hand this default false is anyway only in case sampler decides to not sample this span.

I took a look into the spec and haven't found anything like this.

I think a better name for SpanOptions.isRecording would be SpanOptions.forceRecording. But I wonder if this option is needed at all.

created time in 2 days

push eventdynatrace-oss-contrib/opentelemetry-js

Daniel Dyla

commit sha 3d5879a124acc9172a2c9d87e6cb7b4ea018809e

change testing glob to be windows compatible (#784)

view details

Daniel Dyla

commit sha d67cb8c03cb32be501c8c32c6daf2a0c5c269fed

fix: left pad jaeger trace ids (#743)

view details

Mayur Kale

commit sha 014b324f8d43cb531dbc8b7e16c2d10656ed635c

Chore: minor fixes to API docs (#779) * chore: fix API docs * update WEB Readme: WebTracer => WebTracerProvider

view details

Mayur Kale

commit sha d35ac4f8830b085ff9964c208f38c74030a71b4c

feat: Metrics SDK - aggregator, batcher, controller (#738) * add Batcher and Aggregator * JSDoc comments * final patch * Descriptor to MetricDescriptor * merge createMeasure PR and fix the tests * move Aggregator interface to types

view details

Daniel Dyla

commit sha 92b41bcf80403e75dd9dfca915e35affc7c94ff9

Separate context propagation (OTEP 66) (#769) * feat: separate context propagation

view details

Daniel Dyla

commit sha 218b2909bb389fed7e8b4694de452ff6e6d6b0ae

chore: lint api package (#771) Co-Authored-By: Mark Wolff <marwolff@microsoft.com>

view details

Mayur Kale

commit sha 6616bb17910eba2f38eef4665c717d207823b904

remove Gauge instrument (#791) * remove Gauge instrument

view details

Mayur Kale

commit sha cdec5574d4c8f8a69f03607f0b2e5487d176dca3

chore: clear Prometheus todo and rename ReadableMetric -> MetricRecord (#799)

view details

Valentin Marchaud

commit sha 5e0d2c9749a28a20e0d25aef9fcc73f182a93e5a

feat: add express plugin #666 (#685) * feat: add express plugin #666 * feat: set http.route attribute on http server span if possible * feat: add config to ignore express layers * chore: add documentation about express layer store

view details

Mayur Kale

commit sha 28b9b744da818da468ccefc2174d01244fe49ad4

remove getDefaultBound and setCallback from Metric API (#793)

view details

Daniel Dyla

commit sha 5fc957673ef9c5aa07eca84430194829bfd378ec

Add context API (#792) * chore: add context API

view details

Daniel Dyla

commit sha 5228dfa6cfed1e188608a419c5c895c34b425400

Respect sampled bit in probability sampler (#798)

view details

Bartlomiej Obecny

commit sha 12570c9e02bf5163b385e13dad784ae36f656d67

chore: aligning names for npm linting scripts (#807) * chore: aligning names for npm linting scripts * chore: grouping lint scripts together

view details

Mayur Kale

commit sha 03bf1917dda28f702bab161e637000363a5cd390

plugin(grpc): use HttpTextFormat instead of Binary propagator (#762) * feat: update HttpTraceContext for gRPC metadata * keep textformat interface intact * update the usage based on new implementation Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

view details

push time in 2 days

push eventdynatrace-oss-contrib/opentelemetry-java

Bogdan Drutu

commit sha c19174ee53ddf6b2a1a0b8265432b9256d8a4b1c

Rename Tracestate to TraceState (#816) * Rename Tracestate to TraceState Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com> * More renames Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha c2843a1c6d341dde08c9c43392a33ce7f1bb85ec

Rename MeasureBatchRecorded to BatchRecorder (#817) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha 7365426d855e8d794f41d9074b39ec07176e8585

Add @ThreadSafe annotation to Bounds (#820) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha 65179f857c5959d82cab46643f89146d5da92b5e

Make instrument's builder private class (#819) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Uladzislau Kiva

commit sha 2a1a76530b5e1e024f1509d10cc92eea2d4c2a95

style: format jmh.gradle, use not deprecated archiveFileName (#821)

view details

Giovanni Liva

commit sha 54b5b2eff13da637b777e0f552fa5ccd84127c6b

Fix API doc (#825)

view details

Bogdan Drutu

commit sha 9f1e87c616402586cb6a2d30199bcea79887c34c

Add initial implementation for Observers (#818) * Add initial implementation for Observers Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com> * ./gradlew goJF Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha bfc199a8b3f5324c2fb66f417d5693fd0963cf4b

Use a more clean pattern for putIfAbsent (#827) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha 10b975b3cb3a5aa0a735e9a4feb6c7b851b01d4c

Remove unnecessary class BaseInstrumentWithBinding (#828) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha e9a44a210fbfd09a73cdb2d4d000786857274c6e

Add unit to BaseInstrument (#829) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha 7a832e632605ef90cb3b4dabda32db6fe534619c

Rename base classes to abstract class (#832) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha 2dd7612477dbbb98c599eddd393e833bb632e901

Remove guage from the API. (#830) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha c779885e5be8fc694d39e22702d40dfbf06fea91

Refactor Aggregator to avoid too many templates. (#833) * Refactor Aggregator to avoid too many templates. Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com> * Fix comments from review Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha e7be01474ad36d1865d6587a7bf05e2e51daec08

Move unbind to the Bound to simplify usage (#834) * Move unbind to the Bound to simplify usage Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com> * Change names to be English friendly Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Bogdan Drutu

commit sha a9a31a09461a026d585a5a9d5fe5a13a5f3a111e

Fix direct record methods on instrument to call unbind. (#836) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

Uladzislau Kiva

commit sha 049a5918adcb4906f1c3d7dde4fc4cb67d37dd07

JMH jar pack all sources (#839) * style: format jmh.gradle, use not deprecated archiveFileName * feat: pack sources that may be needed for running jmh

view details

Bogdan Drutu

commit sha 38740c10f7aa468b5bf1c4a0cb8002dbb7ad4ea5

Add getters and tests for AbstractInstrument (#841) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

John Watson

commit sha 0014fff95b129def39590ea132cd794d4cbd8bf8

Add counters to the batch recorder. (#838) * Add counters to the batch recorder. Also, allow non-monotonic batch recordings. * remove the throws on the javadoc * put the proper since tags on the new methods * remove an import that seems only necessary for IDEA * formatting

view details

John Watson

commit sha 69b9c09d60129354b2f71df365a1bb9586655cae

Remove the Android API level enforcement. (#823) * Remove the Android API level enforcement. Keep the Java 7 enforcement. * put android 14 enforcement back onto the API * update based on PR comments * put back android verification at api level 24

view details

Bogdan Drutu

commit sha 2b19a1d9134dd8cee36692ac2242a3aa15eb3d39

Use ThreadLocalRandom insted of our own class. (#846) Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>

view details

push time in 2 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 1d80426a8f29451ea76b9aca3ae885a950623dc0

chore: lint

view details

push time in 2 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 8091be74a1fd492072292c8995194140b3a2f3a7

chore: fix merge issues

view details

push time in 2 days

pull request commentopen-telemetry/opentelemetry-js

feat: introduce ended property on Span

@dyladan @mayurkale22 Is there any chance to move this forward? I'm not that clear if we really have to wait on spec or not. Or if the current mix between Api.Span, Core.Span and ReadableSpan and where they are used something we have to change?

Flarna

comment created time in 2 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 118a66dc57e0b383e6b6d69db3eeaf8424189d95

chore: adapt after merge from master

view details

push time in 2 days

push eventdynatrace-oss-contrib/opentelemetry-js

Daniel Dyla

commit sha 3d5879a124acc9172a2c9d87e6cb7b4ea018809e

change testing glob to be windows compatible (#784)

view details

Daniel Dyla

commit sha d67cb8c03cb32be501c8c32c6daf2a0c5c269fed

fix: left pad jaeger trace ids (#743)

view details

Mayur Kale

commit sha 014b324f8d43cb531dbc8b7e16c2d10656ed635c

Chore: minor fixes to API docs (#779) * chore: fix API docs * update WEB Readme: WebTracer => WebTracerProvider

view details

Mayur Kale

commit sha d35ac4f8830b085ff9964c208f38c74030a71b4c

feat: Metrics SDK - aggregator, batcher, controller (#738) * add Batcher and Aggregator * JSDoc comments * final patch * Descriptor to MetricDescriptor * merge createMeasure PR and fix the tests * move Aggregator interface to types

view details

Daniel Dyla

commit sha 92b41bcf80403e75dd9dfca915e35affc7c94ff9

Separate context propagation (OTEP 66) (#769) * feat: separate context propagation

view details

Daniel Dyla

commit sha 218b2909bb389fed7e8b4694de452ff6e6d6b0ae

chore: lint api package (#771) Co-Authored-By: Mark Wolff <marwolff@microsoft.com>

view details

Mayur Kale

commit sha 6616bb17910eba2f38eef4665c717d207823b904

remove Gauge instrument (#791) * remove Gauge instrument

view details

Mayur Kale

commit sha cdec5574d4c8f8a69f03607f0b2e5487d176dca3

chore: clear Prometheus todo and rename ReadableMetric -> MetricRecord (#799)

view details

Valentin Marchaud

commit sha 5e0d2c9749a28a20e0d25aef9fcc73f182a93e5a

feat: add express plugin #666 (#685) * feat: add express plugin #666 * feat: set http.route attribute on http server span if possible * feat: add config to ignore express layers * chore: add documentation about express layer store

view details

Mayur Kale

commit sha 28b9b744da818da468ccefc2174d01244fe49ad4

remove getDefaultBound and setCallback from Metric API (#793)

view details

Daniel Dyla

commit sha 5fc957673ef9c5aa07eca84430194829bfd378ec

Add context API (#792) * chore: add context API

view details

Daniel Dyla

commit sha 5228dfa6cfed1e188608a419c5c895c34b425400

Respect sampled bit in probability sampler (#798)

view details

Bartlomiej Obecny

commit sha 12570c9e02bf5163b385e13dad784ae36f656d67

chore: aligning names for npm linting scripts (#807) * chore: aligning names for npm linting scripts * chore: grouping lint scripts together

view details

Mayur Kale

commit sha 03bf1917dda28f702bab161e637000363a5cd390

plugin(grpc): use HttpTextFormat instead of Binary propagator (#762) * feat: update HttpTraceContext for gRPC metadata * keep textformat interface intact * update the usage based on new implementation Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

view details

Gerhard Stoebich

commit sha 62a8d3a79c6b09cf993c159980f96515a072c660

Merge remote-tracking branch 'upstream/master' into ids-as-uint8array

view details

push time in 2 days

push eventdynatrace-oss-contrib/opentelemetry-js

Daniel Dyla

commit sha 4faac48f88c32439a4196b045ccb6d590487b048

chore: add typing to propagator carrier (#772)

view details

Mayur Kale

commit sha 82723ef6826f210b7cb8f56652b5c7cd9b1a8025

cleanup: remove unsed tsconfig-release.json (#775)

view details

Valentin Marchaud

commit sha b6a2ccdf29383d1d9402d15df22cb5413d768cba

feat: warn user when a instrumented package was already required #636 (#654) * feat: warn user when a instrumented package was already required #636 * chore: address PR comments * chore: extract package name from require.cache * chore: use find instead of some * chore: use require.resolve to find already required modules * chore: try/catch require.resolve Co-authored-by: Mayur Kale <mayurkale@google.com>

view details

Mayur Kale

commit sha 56a97454c3946d11a0dee493e2e7854258f3ae5f

chore: fix npm img for api package (#778)

view details

Valentin Marchaud

commit sha b1fe2c81b9842dca18dba7db7d87c15fc95820b6

Prevent loading plugins for incorrect module #626 (#653) * fix: do not load plugin when they patch a different module than defined in config #626

view details

Daniel Dyla

commit sha 9b2737abf3f16e8c2c4f7445223422726daadce8

fix: prevent crash when SDT exporter constructed without options (#780)

view details

Gerhard Stöbich

commit sha 274b05f53736fb676899cc0e6a2e324f692f0f28

fix: allow multi tenant vendor keys in TraceState (#781) * fix: allow multi tenant vendor keys in TraceState Improve checking of TraceState keys to allow '@' char used in multi tenant vendor scenarios. See https://www.w3.org/TR/trace-context/#key for details * chore: update jsdoc, use single RegEx * chore: fix regex

view details

Daniel Dyla

commit sha 3d5879a124acc9172a2c9d87e6cb7b4ea018809e

change testing glob to be windows compatible (#784)

view details

Daniel Dyla

commit sha d67cb8c03cb32be501c8c32c6daf2a0c5c269fed

fix: left pad jaeger trace ids (#743)

view details

Mayur Kale

commit sha 014b324f8d43cb531dbc8b7e16c2d10656ed635c

Chore: minor fixes to API docs (#779) * chore: fix API docs * update WEB Readme: WebTracer => WebTracerProvider

view details

Mayur Kale

commit sha d35ac4f8830b085ff9964c208f38c74030a71b4c

feat: Metrics SDK - aggregator, batcher, controller (#738) * add Batcher and Aggregator * JSDoc comments * final patch * Descriptor to MetricDescriptor * merge createMeasure PR and fix the tests * move Aggregator interface to types

view details

Daniel Dyla

commit sha 92b41bcf80403e75dd9dfca915e35affc7c94ff9

Separate context propagation (OTEP 66) (#769) * feat: separate context propagation

view details

Daniel Dyla

commit sha 218b2909bb389fed7e8b4694de452ff6e6d6b0ae

chore: lint api package (#771) Co-Authored-By: Mark Wolff <marwolff@microsoft.com>

view details

Mayur Kale

commit sha 6616bb17910eba2f38eef4665c717d207823b904

remove Gauge instrument (#791) * remove Gauge instrument

view details

Mayur Kale

commit sha cdec5574d4c8f8a69f03607f0b2e5487d176dca3

chore: clear Prometheus todo and rename ReadableMetric -> MetricRecord (#799)

view details

Valentin Marchaud

commit sha 5e0d2c9749a28a20e0d25aef9fcc73f182a93e5a

feat: add express plugin #666 (#685) * feat: add express plugin #666 * feat: set http.route attribute on http server span if possible * feat: add config to ignore express layers * chore: add documentation about express layer store

view details

Mayur Kale

commit sha 28b9b744da818da468ccefc2174d01244fe49ad4

remove getDefaultBound and setCallback from Metric API (#793)

view details

Daniel Dyla

commit sha 5fc957673ef9c5aa07eca84430194829bfd378ec

Add context API (#792) * chore: add context API

view details

Daniel Dyla

commit sha 5228dfa6cfed1e188608a419c5c895c34b425400

Respect sampled bit in probability sampler (#798)

view details

Bartlomiej Obecny

commit sha 12570c9e02bf5163b385e13dad784ae36f656d67

chore: aligning names for npm linting scripts (#807) * chore: aligning names for npm linting scripts * chore: grouping lint scripts together

view details

push time in 2 days

pull request commentnodejs/node

async_hooks: executionAsyncResource matches in hooks

Seems the test I added here fails in node-test-commit-custom-suites-freestyle. Will take a look later. Any hints whats spacial about this CI job are welcome.

Flarna

comment created time in 3 days

Pull request review commentnodejs/node

async_hooks: add AsyncLocal

 const server = net.createServer((conn) => { Promise contexts may not get valid `triggerAsyncId`s by default. See the section on [promise execution tracking][]. +### Class: `AsyncLocal`++<!-- YAML+added: REPLACEME+-->++This class can be used to store a value which follows asynchronous execution+flow. Any value set on an `AsyncLocal` instance is propagated to any callback+or promise executed within the flow. Because of that, a continuation local+storage can be build with an `AsyncLocal` instance. This API is similar to+thread local storage in other runtimes and languages.++The implementation relies on async hooks to follow the execution flow.+So, if an application or a library does not play nicely with async hooks,+the same problems will be seen with the `AsyncLocal` API. In order to fix+such issues the `AsyncResource` API should be used.++The following example shows how to use `AsyncLocal` to build a simple logger+that assignes ids to HTTP requests and includes them into messages logged+within each request.++```js+const http = require('http');+const { AsyncLocal } = require('async_hooks');+const asyncLocal = new AsyncLocal();+function print(msg) {+  const id = asyncLocal.unwrap();+  console.log(`${id !== undefined ? id : '-'}:`, msg);+}+let idSeq = 0;+http.createServer((req, res) => {+  asyncLocal.store(idSeq++);+  print('start');+  setImmediate(() => {+    print('finish');+    res.end();+  });+}).listen(8080);+http.get('http://localhost:8080');+http.get('http://localhost:8080');+// Prints:+//   0: start+//   1: start+//   0: finish+//   1: finish+```++#### `new AsyncLocal()`

Fully agree here.

If you think about it, the "before" and "after" pairing in async_hooks is actually kind of redundant...

I tried to model the transitions in https://github.com/nodejs/node/pull/27172 (similar as .NET but they even have an ExecutionContext class to signal) to hide the before/after callbacks of async hooks but it didn't make much people happy.

Qard

comment created time in 3 days

Pull request review commentnodejs/node

async-hooks: introduce async-storage API

 class AsyncResource {   } } +const storageList = [];+const storageHook = createHook({+  init(asyncId, type, triggerAsyncId, resource) {+    const currentResource = executionAsyncResource();+    // Value of currentResource is always a non null object+    for (let i = 0; i < storageList.length; ++i) {+      storageList[i]._propagate(resource, currentResource);+    }+  }+});++class AsyncLocalStorage {+  constructor() {+    this.kResourceStore = Symbol('kResourceStore');+    this.enabled = false;+  }++  disable() {+    if (this.enabled) {+      this.enabled = false;+      // If this.enabled, the instance must be in storageList+      storageList.splice(storageList.indexOf(this), 1);+      if (storageList.length === 0) {+        storageHook.disable();+      }+    }+  }++  // Propagate the context from a parent resource to a child one+  _propagate(resource, triggerResource) {+    const store = triggerResource[this.kResourceStore];+    if (this.enabled) {+      resource[this.kResourceStore] = store;+    }+  }++  _enter() {

Adding store as first argument to the run* calls sounds fine as there is still the ability to just wrap existing callbacks without the need to modify their signature. Using a dedicated .withStore() function seems to be more error prone as it is not that clear if this store is valid just for the next .run call or till setStore() is called again,...?

vdeturckheim

comment created time in 3 days

Pull request review commentopen-telemetry/opentelemetry-js

Respect sampled bit in probability sampler

 export class ProbabilitySampler implements Sampler {   }    shouldSample(parentContext?: SpanContext) {+    // Respect the parent sampling decision if there is one+    if (parentContext && parentContext.traceFlags !== undefined) {

at least in node this seems to be not possible. What if someone overrides typeof? I would prefer != null in general as it includes null and undefined.

dyladan

comment created time in 4 days

pull request commentnodejs/node

events: allow monitoring error events

Follow-up PR: https://github.com/nodejs/node/pull/31848

Flarna

comment created time in 5 days

Pull request review commentnodejs/node

events: convert errorMonitor to normal property

 ObjectDefineProperty(EventEmitter, 'captureRejections', { });  ObjectDefineProperty(EventEmitter, 'errorMonitor', {-  value: kErrorMonitor,-  writable: false,-  configurable: true,

Non enumerable seems wrong to me as it is a public API. If tools like extend are not copying this property it's also a problem.

Flarna

comment created time in 5 days

pull request commentopen-telemetry/opentelemetry-js

Respect sampled bit in probability sampler

Looks good. I agree that keeping it out of tracer is the better choice.

The checks in processors seem to be redundant as unsampled spans are not forwarded to processors anyway.

dyladan

comment created time in 6 days

pull request commentopen-telemetry/opentelemetry-js

Respect sampled bit in probability sampler

I think we should respect the trace flag not only in the true case.

Maybe move this check to the tracer and call the sampler only for root spans?

dyladan

comment created time in 6 days

Pull request review commentnodejs/node

events: convert errorMonitor to getter

 ObjectDefineProperty(EventEmitter, 'captureRejections', { });  ObjectDefineProperty(EventEmitter, 'errorMonitor', {-  value: kErrorMonitor,-  writable: false,-  configurable: true,

Changed to a normal property. I thought it's a bad idea to allow anyone to accidentally change this property but it seems I was wrong.

Regarding configurable: I copied this over from other locations in events.js (captureRejections, kCapture).

Flarna

comment created time in 8 days

push eventdynatrace-oss-contrib/node

Gerhard Stoebich

commit sha e00a3fb598e79e26b9e7aefd1658d4d32d6c2d4f

events: convert errorMonitor to a normal property Convert property errorMonitor to a normal property as non-writable caused unwanted side effects. Refs: https://github.com/nodejs/node/pull/30932#discussion_r379679982

view details

push time in 8 days

Pull request review commentnodejs/node

events: convert errorMonitor to getter

 ObjectDefineProperty(EventEmitter, 'captureRejections', { });  ObjectDefineProperty(EventEmitter, 'errorMonitor', {-  value: kErrorMonitor,-  writable: false,-  configurable: true,

But writing doesn't throw anymore now, it's silently ignored.

Flarna

comment created time in 8 days

PR opened nodejs/node

events: convert errorMonitor to getter

Convert property errorMonitor to a getter as using a non-writable property caused unwanted side effects.

Refs: https://github.com/nodejs/node/pull/30932#discussion_r379679982

Checklist
  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] commit message follows commit guidelines
+3 -3

0 comment

1 changed file

pr created time in 8 days

create barnchdynatrace-oss-contrib/node

branch : events-error-monitor

created branch time in 8 days

push eventdynatrace-oss-contrib/node

Jeremiah Senkpiel

commit sha 4d6c861800cc6ac1dc6a0fd9d3a8b0053baec62a

doc: move @Fishrock123 to a previous releaser I have not done a release in well over a year, maybe even two. I also don't really plan to do more, as Node.js releases are very tedious. PR-URL: https://github.com/nodejs/node/pull/31725 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Jeremiah Senkpiel

commit sha 928c210a611fb6b4575843708e7cb921f311ebde

doc: move @Fishrock123 to TSC Emeriti It was a good run. Almost 5 years. I haven't really been involved in the last 3+? months though, so it's time I call it and 'retire'. I think it is unlikely that I'll be on the TSC again, as node is unfortunately becoming increasingly disinteresting (& frustrating) to me. (So long and thanks for all the fish!) PR-URL: https://github.com/nodejs/node/pull/31725 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Jeremiah Senkpiel

commit sha 30e6049c75590dec8d5edbf033edbc20e79efcb7

doc: pronouns for @Fishrock123 might as well while I'm at it feels a bit weird being the first person on this list with '/they' but I guess someone's gota do it PR-URL: https://github.com/nodejs/node/pull/31725 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Gireesh Punathil

commit sha 4c746a6cfda980c1cd0de6246781c0083d9e416c

doc: move gireeshpunathil to TSC emeritus PR-URL: https://github.com/nodejs/node/pull/31770 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

James M Snell

commit sha 5bef2ccf20cceda7975f8bce860e0f60595482fc

test: add known issue test for sync writable callback If the write callbacks are invoked synchronously with an error, onwriteError would cause the error event to be emitted synchronously, making it impossible to attach an error handler after the call that triggered it. PR-URL: https://github.com/nodejs/node/pull/31756 Refs: https://github.com/nodejs/quic/commit/b0d469c69c49c9186c1a581a7cebce4c5d398947 Refs: https://github.com/nodejs/quic/pull/341 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>

view details

Robert Nagy

commit sha 85c6fcd1cd11ec6ee22891e48a67cc97f60880e8

stream: avoid writing to writable A remainder from a previous refactoring. Refs: https://github.com/nodejs/node/pull/31197 PR-URL: https://github.com/nodejs/node/pull/31805 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Rich Trott

commit sha 99428e0858bb3cce820190770ca8217460d95c80

doc: reword possessive form of Node.js in debugger.md Throughout the docs, we sometimes write the possessive of _Node.js_ as _Node.js'_ and other times as _Node.js's_. The former conforms with some generally accepted style guides (e.g., Associated Press Stylebook) while the latter complies with others (e.g., Chicago Manual of Style). Since there is no clear authoritative answer as to which form is correct, and since (at least to me) both are visually jarring and sometimes cause a pause to understand, I'd like to reword things to eliminate the possessive form where possible. This is one of those examples. PR-URL: https://github.com/nodejs/node/pull/31748 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Rich Trott

commit sha d40c648e884bd64028fa0a67122a0af87c60f467

doc: reword possessive form of Node.js in process.md Throughout the docs, we sometimes write the possessive of _Node.js_ as _Node.js'_ and other times as _Node.js's_. The former conforms with some generally accepted style guides (e.g., Associated Press Stylebook) while the latter complies with others (e.g., Chicago Manual of Style). Since there is no clear authoritative answer as to which form is correct, and since (at least to me) both are visually jarring and sometimes cause a pause to understand, I'd like to reword things to eliminate the possessive form where possible. This is one of those examples. PR-URL: https://github.com/nodejs/node/pull/31748 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Rich Trott

commit sha d25fcb0c201286d18c07653347258ce02951ddf8

doc: reword possessive form of Node.js in http.md Throughout the docs, we sometimes write the possessive of _Node.js_ as _Node.js'_ and other times as _Node.js's_. The former conforms with some generally accepted style guides (e.g., Associated Press Stylebook) while the latter complies with others (e.g., Chicago Manual of Style). Since there is no clear authoritative answer as to which form is correct, and since (at least to me) both are visually jarring and sometimes cause a pause to understand, I'd like to reword things to eliminate the possessive form where possible. This is one of those examples. PR-URL: https://github.com/nodejs/node/pull/31748 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Rich Trott

commit sha eb0ade10a7af855ecdaa822dea028d661664cd43

doc: reword possessive form of Node.js in adding-new-napi-api.md Throughout the docs, we sometimes write the possessive of _Node.js_ as _Node.js'_ and other times as _Node.js's_. The former conforms with some generally accepted style guides (e.g., Associated Press Stylebook) while the latter complies with others (e.g., Chicago Manual of Style). Since there is no clear authoritative answer as to which form is correct, and since (at least to me) both are visually jarring and sometimes cause a pause to understand, I'd like to reword things to eliminate the possessive form where possible. This is one of those examples. PR-URL: https://github.com/nodejs/node/pull/31748 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Anna Henningsen

commit sha fab3eff2e53eb9bfbb890e5ac45523ae68ae95e5

src: inform callback scopes about exceptions in HTTP parser Refs: https://github.com/nodejs/node/commit/4aca277f16b8649b5fc21d41f340fad0a47c2e61 Refs: https://github.com/nodejs/node/pull/30236 Fixes: https://github.com/nodejs/node/issues/31796 PR-URL: https://github.com/nodejs/node/pull/31801 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>

view details

Rich Trott

commit sha 794bfacb26c4059c2eab7efb475489b7010054c3

test: remove common.PORT from test-net-timeout Switch test-net-timeout from common.PORT to a port assigned by the operating system. PR-URL: https://github.com/nodejs/node/pull/31749 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Rich Trott

commit sha 76fd17a7dff6b89b8851044b17125a88a3043b4e

test: remove common.PORT from test-net-throttle Switch test-net-throttle from common.PORT to a port assigned by the operating system. PR-URL: https://github.com/nodejs/node/pull/31749 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Rich Trott

commit sha a092886b1d29d17c94683348430e062cf7ae2fc9

test: remove common.PORT from test-tls-server-large-request Switch test-tls-server-large-request from common.PORT to a port assigned by the operating system. PR-URL: https://github.com/nodejs/node/pull/31749 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Rich Trott

commit sha af19f4116c5c3ce0fc7b18b62ffb05e8138bf74b

test: remove common.PORT from test-net-pause Switch test-net-pause from common.PORT to a port assigned by the operating system. PR-URL: https://github.com/nodejs/node/pull/31749 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Guy Bedford

commit sha 58de9b46b80fd3e48f5faf9db8101930a6493fc4

module: package "exports" error refinements PR-URL: https://github.com/nodejs/node/pull/31625 Reviewed-By: Jan Krems <jan.krems@gmail.com>

view details

push time in 8 days

create barnchdynatrace-oss-contrib/node

branch : async-hooks-streampipe-reuse

created branch time in 8 days

pull request commentDefinitelyTyped/DefinitelyTyped

feat(node, perf_hooks): add `entryType` to all types and interfaces that use it

Seems to be unrelated and I think I have seen this also in other PRs. @sandersn any hint what could cause errors like this:

Error in boom/vv3

Error: ENOENT: no such file or directory, open '/home/travis/build/DefinitelyTyped/DefinitelyTyped/types/boom/vv3/index.d.ts'

Error in concurrently/vv4

Error: ENOENT: no such file or directory, open '/home/travis/build/DefinitelyTyped/DefinitelyTyped/types/concurrently/vv4/index.d.ts'
Ryan-Willpower

comment created time in 8 days

pull request commentnodejs/node

events: allow monitoring error events

@MylesBorins Thanks. I will take care to create followup PRs in this.

Flarna

comment created time in 8 days

pull request commentnodejs/node

timers: captureRejections for timers

I agree that routing to uncaughtException is a better choice here.

jasnell

comment created time in 8 days

issue openedopen-telemetry/opentelemetry-js

ProbabilitySampler doesn't honor W3C sampled flag

What version of OpenTelemetry are you using?

0.4.0

What version of Node are you using?

12.16.0

What did you do?

const spanContext = {
  traceId: 'd4cda95b652f4a1592b449d5929fda1b',
  spanId: '6e0c63257de34c92',
  traceFlags: TraceFlags.UNSAMPLED,
};
// Create a span. A span must be closed.
const span = tracer.startSpan("main", { parent: spanContext });

What did you expect to see?

I would expect that above span is a NoRecordingSpan as the incoming sampling flag indicates that trace is unsampled.

What did you see instead?

The ProbabilitySampler ignores the sampling flag and a normal, recording Span is created.

Additional context

I'm not sure if this is really a bug or intended behavior of the ProbabilitySampler.

I found following in W3C spec regarding this: Probability sampling (sample 1 out of 100 distributed traces by flipping a coin).

My interpretation of this is that the first tier flips the coin an tells the others about it's decision via the sampling flag.

I think it doesn't make much sense to re-decide on each tier as this would result in each distributed trace having gaps.

created time in 9 days

pull request commentDefinitelyTyped/DefinitelyTyped

feat(node): add `entryType` to all types and interfaces that use it

Assuming you have checked out your branch.

  • Configure this repo as remote named upstream: git remote add upstream https://github.com/DefinitelyTyped/DefinitelyTyped.git
  • Fetch remotes: git fetch --all
  • rebase: git rebase upstream/master
  • force push your branch: git push -f
  • reopen this PR (if github allows) or create a new one
Ryan-Willpower

comment created time in 9 days

pull request commentDefinitelyTyped/DefinitelyTyped

feat(node): add `entryType` to all types and interfaces that use it

Bot closes PRs based on commit date. You should rebase your branch to tip of master and retry.

Ryan-Willpower

comment created time in 9 days

pull request commentopen-telemetry/opentelemetry-js

feat: use Uint8Array for ids

I think we should be also careful in interpretation of the benchmarks as they show ops/sec but the real usecase don't do the ops independent. e.g. you will always have at least one created spans for inject and one more for extract. Maybe they should display time/op instead which would allow to sum up.

Examples: #startSpan:parent improved from 11.4us/op to 10.3us/op #inject degraded from 0.063us/op to 0.69us/op #extract degraded from 0.28us/op to 0.94us/op

summing this up (2 spans + inject + extract): 23,14us => 22.23us

But I'm still not sure if the added complexity is it worth to do this.

Flarna

comment created time in 9 days

PR opened nodejs/node

async_hooks: executionAsyncResource matches in hooks

Ensure that resource returned by executionAsyncResource() in before and after hook matches that resource causing this before/after calls.

Checklist
  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] tests and/or benchmarks are included
  • [x] commit message follows commit guidelines

Refs: #30959 fyi @Qard

+53 -9

0 comment

2 changed files

pr created time in 9 days

create barnchdynatrace-oss-contrib/node

branch : async-exe-resoure-match

created branch time in 9 days

Pull request review commentnodejs/node

events: allow monitoring error events

 ObjectDefineProperty(EventEmitter, 'captureRejections', {   enumerable: true }); +ObjectDefineProperty(EventEmitter, 'errorMonitor', {+  value: kErrorMonitor,+  writable: false,+  configurable: true,+  enumerable: true

Should we change this to a normal property? I used non writable simply because a write to this is usually a bug. I haven't seen any reasonable usecase to change this value but kept it configurable to allow any sort of hack if really needed.

In principle also a normal property added could be seen a breaking if some user added a property with the same name already before in it's code.

Flarna

comment created time in 9 days

pull request commentnodejs/node

timers: captureRejections for timers

To me it looks a little bit inconsistent that an exception throw in a normal function ends up unhandled whereas an exception thrown in an async function is redirected to an error event on process.

Would it make sense to redirect all exceptions to process error?

jasnell

comment created time in 9 days

push eventdynatrace-oss-contrib/node

Anna Henningsen

commit sha a7c523e26df468782691c7e16b2e033c6256beb3

src: prefer 3-argument Array::New() This is nicer, because: 1. It reduces overall code size, 2. It’s faster, because `Object::Set()` calls are relatively slow, and 3. It helps avoid invalid `.Check()`/`.FromJust()` calls. PR-URL: https://github.com/nodejs/node/pull/31775 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>

view details

Robert Nagy

commit sha c776a37791007e0d570355b731647e58ea5885be

http: end with data can cause write after end Calling end() with data while ending should trigger a write after end error. PR-URL: https://github.com/nodejs/node/pull/28666 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Robert Nagy

commit sha 568fdfb1658bfcaa7832759e03661f2cb958c155

fs: fix WriteStream autoClose order WriteStream autoClose was implemented by manually calling .destroy() instead of using autoDestroy and callback. This caused some invariants related to order of events to be broken. Fixes: https://github.com/nodejs/node/issues/31776 PR-URL: https://github.com/nodejs/node/pull/31790 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Samuel Attard

commit sha 093639614fa1cea7a1bc3493d28119a924c97bc9

doc: claim ABI version 82 for Electron 10 PR-URL: https://github.com/nodejs/node/pull/31778 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Anna Henningsen

commit sha 26e49d83323c78e89b2664b6eeaee90757d52868

worker: unroll file extension regexp Refs: https://github.com/nodejs/node/pull/31662#discussion_r377016190 PR-URL: https://github.com/nodejs/node/pull/31779 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Jeff

commit sha e028ea0291b845e4bec3c7cff7319a027b8c815e

doc: fix typos in doc/api/https.md PR-URL: https://github.com/nodejs/node/pull/31793 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

push time in 9 days

Pull request review commentnodejs/node

async-hooks: introduce async-storage API

 class AsyncResource {   } } -const locals = [];+let activeAsyncLocalStorageCount = 0;+const kLocalStorageList = Symbol('kLocalStorageList'); const asyncContextHook = createHook({   init(asyncId, type, triggerAsyncId, resource) {-    for (let i = 0; i < locals.length; ++i) {-      locals[i]._propagate(resource, executionAsyncResource());+    const triggerResource = executionAsyncResource();

nit: triggerResource is confusing here as it doesn't match the triggerId. Maybe use executionResource or currentResource.

vdeturckheim

comment created time in 9 days

Pull request review commentnodejs/node

timers: captureRejections for timers

 The timer functions within Node.js implement a similar API as the timers API provided by Web Browsers but use a different internal implementation that is built around the Node.js [Event Loop][]. +## Capture Rejections of Promises++> Stability: 1 - captureRejections is experimental.++Using `async` functions with timers is problematic because it can lead to+unhandled rejection in case of a thrown exception:++```js+setTimeout(async () => {+  throw new Error('kaboom');+}, 1000);+```++The `captureRejections` property can be used to change this behavior,+allowing a `then(undefined, handler)` handler on the `Promise`. This+handler routes the exception asynchronously to the `process.on('error')`+event handler.++```js+const timers = require('timers');+timers.captureRejections = true;++setTimeout(async () => {+  throw new Error('kaboom');+}, 1000);++process.on('error', (err, timer) => {

Implementation doesn't pass timer as second arg.

jasnell

comment created time in 10 days

Pull request review commentnodejs/node

timers: captureRejections for timers

 function getTimerCallbacks(runNextTicks) {        try {         const args = timer._timerArgs;+        let result;         if (args === undefined)-          timer._onTimeout();+          result = timer._onTimeout();         else-          timer._onTimeout(...args);+          result = timer._onTimeout(...args);++        if (result !== undefined && result !== null)
        if (result != null)
jasnell

comment created time in 10 days

pull request commentopen-telemetry/opentelemetry-js

feat: use Uint8Array for ids

I updated benchmark results above. I noticed that I forgot to adapt the benchmarks therefore measurements for propagators were garbage. It still looks like the improvement is quite low. Most likely the main overhead of Otel is in other areas then string/buffer conversions.

Flarna

comment created time in 11 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 42c135f8d110d2a3437c09f622bf34c192e93838

fix: adapt benchmarks

view details

push time in 11 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 2ee06462c5b87cebb1921af3efc22be7ca031c04

chore: avoid unneeded copy

view details

push time in 11 days

push eventdynatrace-oss-contrib/node

Derek Lewis

commit sha a751389a14ddb3571e3ade22ac472b9aeb912bc0

tools: update Markdown linter to be cross-platform Prior to this commit, the dependencies were not matching the build procedure. This has been corrected and it has the added benefit of being able to be built on Windows as well. * continue using `rollup` rather than `ncc` * do not require `fs-event`s for non-macOS * use `npx` and `shx` for cross-platform building * ensure `lint-md-rollup` runs before `lint-md` PR-URL: https://github.com/nodejs/node/pull/31239 Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

ZYSzys

commit sha 3e9302b2b34ab0309de8eda45c17efc8fd9cc2f5

fs: validate the input data before opening file PR-URL: https://github.com/nodejs/node/pull/31731 Refs: https://github.com/nodejs/node/pull/31030 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com>

view details

Denys Otrishko

commit sha 84b8857098b2a846855bb2420f3a1144ef68cce3

src: allow to reuse env options handling PR-URL: https://github.com/nodejs/node/pull/31711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>

view details

Denys Otrishko

commit sha d63bcdd9cd81b10b6158f40d44bf6f37e5f54385

worker: properly handle env and NODE_OPTIONS in workers PR-URL: https://github.com/nodejs/node/pull/31711 Fixes: https://github.com/nodejs/node/issues/30627 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>

view details

Ben Noordhuis

commit sha b32fa7bcc69aec0acb63792c799a22eeae7424c6

src: add ExclusiveAccess class Similar to Rust's `std::sync::Mutex` in that it requires one to unwrap the object before accessing it, acquiring the mutex in the process. PR-URL: https://github.com/nodejs/node/pull/31717 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: David Carlier <devnexen@gmail.com>

view details

Ben Noordhuis

commit sha 303e2fdc598cbc82af401f12f3cc9169ed31598b

src: wrap HostPort in ExclusiveAccess I found it exceedingly hard to figure out if there is a race condition where one thread reads the inspector agent's HostPort's properties while another modifies them concurrently. I think the answer is "no, there isn't" but with this commit use sites are forced to unwrap the object (and acquire the mutex in the process), making it a great deal easier to reason about correctness. PR-URL: https://github.com/nodejs/node/pull/31717 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: David Carlier <devnexen@gmail.com>

view details

Rich Trott

commit sha 481fa1ca989a36f850f844f1df50a6db0cfb1dd3

util: add coverage for util.inspect.colors alias setter Add test to confirm that the setter for aliases in `util.inspect.colors` keeps the alias reference-equal to the target value. Refs: https://coverage.nodejs.org/coverage-5b0308cd823a5110/lib/internal/util/inspect.js.html#L357 Refs: https://codecov.io/gh/nodejs/node/src/5b0308cd823a511098dadf9ddd5a35e3a9dbb424/lib/internal/util/inspect.js#L357 PR-URL: https://github.com/nodejs/node/pull/31743 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Rich Trott

commit sha a18b437e6a6115e30309a1f200f614e27e650aa4

util: throw if unreachable TypedArray checking code is reached If a comparison code path that is supposed to be unreachable is reached, throw. Add a c8 comment to ignore coverage for the line, as it should be unreachable. PR-URL: https://github.com/nodejs/node/pull/31737 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Rich Trott

commit sha a3eb6f2b5255d87ea5e207598ef87be5be204eba

meta: move calvinmetcalf to emeritus calvinmetcalf confirmed in email that moving to emeritus seemed like the right move for them right now. Move a separate entry that wasn't in the correct place in the list. PR-URL: https://github.com/nodejs/node/pull/31736 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com>

view details

Rich Trott

commit sha c3cebf55129d5337cc446163d63ae1405069595c

meta: move vkurchatkin to emeritus vkurchatkin confirmed in email that it's time to move to emeritus. PR-URL: https://github.com/nodejs/node/pull/31729 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>

view details

Rich Trott

commit sha ff82b76ff044ea66f2f7155a1b154e333b827b6d

meta: move princejwesley to emeritus princejwesley confirmed in email that moving to emeritus at this time was appropriate. PR-URL: https://github.com/nodejs/node/pull/31730 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>

view details

Tobias Nießen

commit sha 09b6894fe8b5eb8a0625effdc701d6da765078ab

doc: update foundation name in onboarding PR-URL: https://github.com/nodejs/node/pull/31719 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Anna Henningsen

commit sha 5e41765f47a4dfb519047428026dff9be4f7e0a9

doc: expand C++ README with information about exception handling Add more information about why it is advisable not to use `.FromJust()` etc. on Maybe(Local)s, and general information about termination exceptions. PR-URL: https://github.com/nodejs/node/pull/31720 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Danielle Adams

commit sha e5e011d9bc71c7d651db47950a5af0e738f68784

doc: add directions to mark a release line as lts Moves directions for LTS release from the Release repo to Node docs. Fixes: https://github.com/nodejs/Release/issues/530 PR-URL: https://github.com/nodejs/node/pull/31724 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Rich Trott

commit sha d5650418762ed3562db8f7fabbca575a2fde35a5

test: improve test-fs-stat-bigint Remove magic number and measure amount of difference should be allowable between consecutive stat() calls. PR-URL: https://github.com/nodejs/node/pull/31726 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Ruben Bridgewater

commit sha 9da57a86ee7d9cb7b27ab8fa9ee241dc047bbd0e

test: fix flaky parallel/test-repl-history-navigation test Two scenarios should be tested: 1. The completion is triggered and the result is printed before the next invocation. 2. The completion is triggered multiple times right after each other without waiting for the result. In that case only the last result should be printed. The first scenario did not need a timeout while the latter did not need a timeout for the second invocation. PR-URL: https://github.com/nodejs/node/pull/31708 Fixes: https://github.com/nodejs/node/issues/31094 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Denys Otrishko

commit sha bc55b57e64a374e5b677644c857c3d26247c72ef

lib: fix few comment typos in fs/watchers.js PR-URL: https://github.com/nodejs/node/pull/31705 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Robert Nagy

commit sha b9a7625fdf0a8217195300f5a8844b6da1a5a35a

stream: removed outdated TODO Was resolved in https://github.com/nodejs/node/commit/e559842188f541b884abff2ffad4d2d3e1b841a6. PR-URL: https://github.com/nodejs/node/pull/31701 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Andrey Pechkurov

commit sha 26cb448b0d74fa6440ca77ca83b1adba6cc50a87

doc: fix default server timeout description for https PR-URL: https://github.com/nodejs/node/pull/31692 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Ujjwal Sharma

commit sha 917914112341da2de7215d304dcc1bf33184e53b

doc: update contact email for @ryzokuken Update my personal email address from usharma1998@gmail.com (tired) to ryzokuken@disroot.org (wired). PR-URL: https://github.com/nodejs/node/pull/31670 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>

view details

push time in 11 days

pull request commentopen-telemetry/opentelemetry-js

WIP feat: use Uint8Array for ids

Result of benchmarks:

<details><summary>IDs as Uint8Array</summary> <p>

Beginning NoopTracerProvider Benchmark...
  5 tests completed.

  #startSpan                     x 1,058,162,929 ops/sec ±1.27% (20 runs sampled)
  #startSpan:parent              x 1,063,564,332 ops/sec ±0.88% (20 runs sampled)
  #startSpan with attribute      x 1,077,125,467 ops/sec ±1.59% (20 runs sampled)
  #startSpan with 30 attributes  x    11,368,997 ops/sec ±1.11% (20 runs sampled)
  #startSpan with 100 attributes x     3,650,037 ops/sec ±1.37% (20 runs sampled)

Beginning BasicTracerProvider Benchmark...
  5 tests completed.

  #startSpan                     x 211,424 ops/sec ±1.32% (20 runs sampled)
  #startSpan:parent              x 121,566 ops/sec ±0.40% (20 runs sampled)
  #startSpan with attribute      x 210,011 ops/sec ±1.47% (20 runs sampled)
  #startSpan with 30 attributes  x  63,721 ops/sec ±1.13% (20 runs sampled)
  #startSpan with 100 attributes x   5,861 ops/sec ±1.25% (20 runs sampled)

Beginning BasicTracerProvider with SimpleSpanProcessor Benchmark...
  5 tests completed.

  #startSpan                     x 166,317 ops/sec ±3.91% (20 runs sampled)
  #startSpan:parent              x  93,415 ops/sec ±2.93% (20 runs sampled)
  #startSpan with attribute      x 146,727 ops/sec ±9.58% (20 runs sampled)
  #startSpan with 30 attributes  x  51,164 ops/sec ±1.63% (20 runs sampled)
  #startSpan with 100 attributes x   5,666 ops/sec ±1.55% (20 runs sampled)

Beginning BasicTracerProvider with BatchSpanProcessor Benchmark...
  5 tests completed.

  #startSpan                     x 159,150 ops/sec ±4.39% (20 runs sampled)
  #startSpan:parent              x  89,954 ops/sec ±3.95% (20 runs sampled)
  #startSpan with attribute      x 107,403 ops/sec ±32.79% (20 runs sampled)
  #startSpan with 30 attributes  x  48,727 ops/sec ±1.53% (20 runs sampled)
  #startSpan with 100 attributes x   5,279 ops/sec ±3.48% (20 runs sampled)


Beginning B3Format Benchmark...
  2 tests completed.

  #Inject  x 1,066,780,692 ops/sec ±0.53% (100 runs sampled)
  #Extract x     1,316,447 ops/sec ±0.37% (100 runs sampled)

Beginning HttpTraceContext Benchmark...
  2 tests completed.

  #Inject  x   872,326 ops/sec ±0.39% (100 runs sampled)
  #Extract x 1,044,658 ops/sec ±0.79% (100 runs sampled)

</p> </details>

<details><summary>IDs as hex strings</summary> <p>

Beginning NoopTracerProvider Benchmark...
  5 tests completed.

  #startSpan                     x 1,059,885,282 ops/sec ±2.87% (20 runs sampled)
  #startSpan:parent              x 1,040,236,747 ops/sec ±2.38% (20 runs sampled)
  #startSpan with attribute      x 1,054,605,044 ops/sec ±2.23% (20 runs sampled)
  #startSpan with 30 attributes  x    11,243,262 ops/sec ±1.37% (20 runs sampled)
  #startSpan with 100 attributes x     3,674,193 ops/sec ±0.79% (20 runs sampled)

Beginning BasicTracerProvider Benchmark...
  5 tests completed.

  #startSpan                     x 146,849 ops/sec ±1.65% (20 runs sampled)
  #startSpan:parent              x  97,562 ops/sec ±0.57% (20 runs sampled)
  #startSpan with attribute      x 148,188 ops/sec ±0.45% (20 runs sampled)
  #startSpan with 30 attributes  x  54,051 ops/sec ±0.30% (20 runs sampled)
  #startSpan with 100 attributes x   5,793 ops/sec ±1.01% (20 runs sampled)

Beginning BasicTracerProvider with SimpleSpanProcessor Benchmark...
  5 tests completed.

  #startSpan                     x 131,322 ops/sec ±3.49% (20 runs sampled)
  #startSpan:parent              x  87,738 ops/sec ±2.40% (20 runs sampled)
  #startSpan with attribute      x 135,653 ops/sec ±1.92% (20 runs sampled)
  #startSpan with 30 attributes  x  43,870 ops/sec ±14.04% (20 runs sampled)
  #startSpan with 100 attributes x   5,693 ops/sec ±1.21% (20 runs sampled)

Beginning BasicTracerProvider with BatchSpanProcessor Benchmark...
  5 tests completed.

  #startSpan                     x 132,999 ops/sec ±2.03% (20 runs sampled)
  #startSpan:parent              x  85,832 ops/sec ±2.31% (20 runs sampled)
  #startSpan with attribute      x 131,084 ops/sec ±2.65% (20 runs sampled)
  #startSpan with 30 attributes  x  47,688 ops/sec ±1.20% (20 runs sampled)
  #startSpan with 100 attributes x   5,545 ops/sec ±2.47% (20 runs sampled)


Beginning B3Format Benchmark...
  2 tests completed.

  #Inject  x 5,770,521 ops/sec ±0.33% (100 runs sampled)
  #Extract x 5,599,810 ops/sec ±0.48% (100 runs sampled)

Beginning HttpTraceContext Benchmark...
  2 tests completed.

  #Inject  x 15,769,315 ops/sec ±1.15% (100 runs sampled)
  #Extract x  3,545,804 ops/sec ±0.39% (100 runs sampled)

</p> </details>

Don't know if this is enough for a conclusion. As expected span creation and binary propagation is faster but text propagation is slower. An end2end setup using text tagging and a few internal spans with e.g. jaeger exporter would be better.

Flarna

comment created time in 11 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 64474a99b922f54429b4129f847b53f04d92c3ed

fix: add idToBase64

view details

push time in 11 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha e8db7f988d8696b5b15651c2e59d868286bb2aa0

fix: exporter-collector

view details

push time in 11 days

pull request commentopen-telemetry/opentelemetry-js

WIP feat: use Uint8Array for ids

Can we get quick benchmark ? Like ab test would be acceptable to me.

Are there somewhere instructions how to run OTel benchmarks?

Flarna

comment created time in 11 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha abc1ccf77cd33b40596b53dd9e335ad695691cc1

chore: lint

view details

push time in 11 days

Pull request review commentopen-telemetry/opentelemetry-js

WIP feat: use Uint8Array for ids

 describe('API', () => {    describe('GlobalTracerProvider', () => {     const spanContext = {-      traceId: 'd4cda95b652f4a1592b449d5929fda1b',-      spanId: '6e0c63257de34c92',+      traceId: new Uint8Array([0xd4, 0xcd, 0xa9, 0x5b, 0x65, 0x2f, 0x4a, 0x15, 0x92, 0xb4, 0x49, 0xd5, 0x92, 0x9f, 0xda, 0x1b]),

Does this work for Browser?

Flarna

comment created time in 11 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha ff8e144d2cafc74615aaa68e03cf8b94217e13bd

fix: grpc tests

view details

push time in 11 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 2767587596c4f179d304cc48dd8bdad1d5370448

chore: lint

view details

Gerhard Stoebich

commit sha e5d5174855fe655834330d6e8cb52dde11403c92

fix: redis test

view details

push time in 11 days

PR opened open-telemetry/opentelemetry-js

Reviewers
feat: use Uint8Array for ids

Which problem is this PR solving?

closes #698

Short description of the changes

Use Uint8Array for traceId/spandId to avoid conversion from buffer to hex string during creation and from hex string to buffer during export.

The opentelemetry protocol uses also a byte array in protobuf.

There are still conversions needed for propagation via HTTP headers but overall the number of conversions should be reduced.

+378 -293

0 comment

49 changed files

pr created time in 11 days

create barnchdynatrace-oss-contrib/opentelemetry-js

branch : ids-as-uint8array

created branch time in 11 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stöbich

commit sha 274b05f53736fb676899cc0e6a2e324f692f0f28

fix: allow multi tenant vendor keys in TraceState (#781) * fix: allow multi tenant vendor keys in TraceState Improve checking of TraceState keys to allow '@' char used in multi tenant vendor scenarios. See https://www.w3.org/TR/trace-context/#key for details * chore: update jsdoc, use single RegEx * chore: fix regex

view details

push time in 11 days

delete branch dynatrace-oss-contrib/opentelemetry-js

delete branch : trace-state-vendor

delete time in 12 days

Pull request review commentnodejs/node

async_hooks: add AsyncLocal API mk2

 const server = net.createServer((conn) => { Promise contexts may not get valid `triggerAsyncId`s by default. See the section on [promise execution tracking][]. +### Class: `AsyncLocal`++<!-- YAML+added: REPLACEME+-->++This class can be used to store a value which follows asynchronous execution+flow. Any value set on an `AsyncLocal` instance is propagated to any callback+or promise executed within the flow. Because of that, a continuation local+storage can be build with an `AsyncLocal` instance. This API is similar to+thread local storage in other runtimes and languages.++The implementation relies on async hooks to follow the execution flow.+So, if an application or a library does not play nicely with async hooks,+the same problems will be seen with the `AsyncLocal` API. In order to fix+such issues the `AsyncResource` API should be used.++The following example shows how to use `AsyncLocal` to build a simple logger+that assignes ids to HTTP requests and includes them into messages logged+within each request.++```js+const http = require('http');+const { AsyncLocal } = require('async_hooks');++const asyncLocal = new AsyncLocal();++function print(msg) {+  const id = asyncLocal.get();+  console.log(`${id !== undefined ? id : '-'}:`, msg);+}++let idSeq = 0;+http.createServer((req, res) => {+  asyncLocal.set(idSeq++);+  print('start');+  setImmediate(() => {+    print('finish');+    res.end();+  });+}).listen(8080);++http.get('http://localhost:8080');+http.get('http://localhost:8080');+// Prints:+//   0: start+//   1: start+//   0: finish+//   1: finish+```++#### `new AsyncLocal()`++Creates a new instance of `AsyncLocal`.++### `asyncLocal.get()`++* Returns: {any}++Returns the value of the `AsyncLocal` in current execution context,+or `undefined` if the value is not set or the `AsyncLocal` was removed.++### `asyncLocal.set(value)`++* `value` {any}++Sets the value for the `AsyncLocal` within current execution context.++Once set, the value will be kept through the subsequent asynchronous calls,+unless overridden by calling `asyncLocal.set(value)`:++```js+const asyncLocal = new AsyncLocal();++setImmediate(() => {+  asyncLocal.set('A');++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: A++    asyncLocal.set('B');+    console.log(asyncLocal.get());+    // Prints: B+  });++  console.log(asyncLocal.get());+  // Prints: A++  // Stop further value propagation+  asyncLocal.set(undefined);++  console.log(asyncLocal.get());+  // Prints: undefined++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: undefined+  });+});+```++If the `AsyncLocal` was removed before this call is made,+[`ERR_ASYNC_LOCAL_CANNOT_SET_VALUE`][] is thrown.

I don't think we should offer .enable(). I would vote for .disable() or .destroy() but others are also ok.

puzpuzpuz

comment created time in 13 days

push eventDynatrace/agent-nodejs

Gerhard Stoebich

commit sha 3cc9b2cd7f8ecf48eda76a579836b9c902b4da49

Update OneAgent to 1.185.137

view details

push time in 13 days

push eventDynatrace/agent-nodejs

Gerhard Stoebich

commit sha 3cc9b2cd7f8ecf48eda76a579836b9c902b4da49

Update OneAgent to 1.185.137

view details

push time in 13 days

Pull request review commentnodejs/node

async_hooks: add AsyncLocal API mk2

 const server = net.createServer((conn) => { Promise contexts may not get valid `triggerAsyncId`s by default. See the section on [promise execution tracking][]. +### Class: `AsyncLocal`++<!-- YAML+added: REPLACEME+-->++This class can be used to store a value which follows asynchronous execution+flow. Any value set on an `AsyncLocal` instance is propagated to any callback+or promise executed within the flow. Because of that, a continuation local+storage can be build with an `AsyncLocal` instance. This API is similar to+thread local storage in other runtimes and languages.++The implementation relies on async hooks to follow the execution flow.+So, if an application or a library does not play nicely with async hooks,+the same problems will be seen with the `AsyncLocal` API. In order to fix+such issues the `AsyncResource` API should be used.++The following example shows how to use `AsyncLocal` to build a simple logger+that assignes ids to HTTP requests and includes them into messages logged+within each request.++```js+const http = require('http');+const { AsyncLocal } = require('async_hooks');++const asyncLocal = new AsyncLocal();++function print(msg) {+  const id = asyncLocal.get();+  console.log(`${id !== undefined ? id : '-'}:`, msg);+}++let idSeq = 0;+http.createServer((req, res) => {+  asyncLocal.set(idSeq++);+  print('start');+  setImmediate(() => {+    print('finish');+    res.end();+  });+}).listen(8080);++http.get('http://localhost:8080');+http.get('http://localhost:8080');+// Prints:+//   0: start+//   1: start+//   0: finish+//   1: finish+```++#### `new AsyncLocal()`++Creates a new instance of `AsyncLocal`.++### `asyncLocal.get()`++* Returns: {any}++Returns the value of the `AsyncLocal` in current execution context,+or `undefined` if the value is not set or the `AsyncLocal` was removed.++### `asyncLocal.set(value)`++* `value` {any}++Sets the value for the `AsyncLocal` within current execution context.++Once set, the value will be kept through the subsequent asynchronous calls,+unless overridden by calling `asyncLocal.set(value)`:++```js+const asyncLocal = new AsyncLocal();++setImmediate(() => {+  asyncLocal.set('A');++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: A++    asyncLocal.set('B');+    console.log(asyncLocal.get());+    // Prints: B+  });++  console.log(asyncLocal.get());+  // Prints: A++  // Stop further value propagation+  asyncLocal.set(undefined);++  console.log(asyncLocal.get());+  // Prints: undefined++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: undefined+  });+});+```++If the `AsyncLocal` was removed before this call is made,+[`ERR_ASYNC_LOCAL_CANNOT_SET_VALUE`][] is thrown.

Are you expecting users to call .remove() in typical scenarios? I miss the usecase (except dealing with problems like leaks to avoid further breakdowns). I expect that calls to .set() are spread in the whole application therefore you either have to check everywhere if the async local is still alive or use a try/catch.

puzpuzpuz

comment created time in 13 days

push eventdynatrace-oss-contrib/opentelemetry-js

Daniel Dyla

commit sha 9b2737abf3f16e8c2c4f7445223422726daadce8

fix: prevent crash when SDT exporter constructed without options (#780)

view details

push time in 13 days

pull request commentopen-telemetry/opentelemetry-js

fix: allow multi tenant vendor keys in TraceState

not sure if I understood you correct. tracecontext holds always the parent span id so everyone creating a span and further propagate has to modify the parent span id there. tracestate is a pass through on default. You modify only your entry but don't touch the fields of other vendors.

Flarna

comment created time in 13 days

Pull request review commentnodejs/node

async_hooks: add AsyncLocal API mk2

 const server = net.createServer((conn) => { Promise contexts may not get valid `triggerAsyncId`s by default. See the section on [promise execution tracking][]. +### Class: `AsyncLocal`++<!-- YAML+added: REPLACEME+-->++This class can be used to store a value which follows asynchronous execution+flow. Any value set on an `AsyncLocal` instance is propagated to any callback+or promise executed within the flow. Because of that, a continuation local+storage can be build with an `AsyncLocal` instance. This API is similar to+thread local storage in other runtimes and languages.++The implementation relies on async hooks to follow the execution flow.+So, if an application or a library does not play nicely with async hooks,+the same problems will be seen with the `AsyncLocal` API. In order to fix+such issues the `AsyncResource` API should be used.++The following example shows how to use `AsyncLocal` to build a simple logger+that assignes ids to HTTP requests and includes them into messages logged+within each request.++```js+const http = require('http');+const { AsyncLocal } = require('async_hooks');++const asyncLocal = new AsyncLocal();++function print(msg) {+  const id = asyncLocal.get();+  console.log(`${id !== undefined ? id : '-'}:`, msg);+}++let idSeq = 0;+http.createServer((req, res) => {+  asyncLocal.set(idSeq++);+  print('start');+  setImmediate(() => {+    print('finish');+    res.end();+  });+}).listen(8080);++http.get('http://localhost:8080');+http.get('http://localhost:8080');+// Prints:+//   0: start+//   1: start+//   0: finish+//   1: finish+```++#### `new AsyncLocal()`++Creates a new instance of `AsyncLocal`.++### `asyncLocal.get()`++* Returns: {any}++Returns the value of the `AsyncLocal` in current execution context,+or `undefined` if the value is not set or the `AsyncLocal` was removed.++### `asyncLocal.set(value)`++* `value` {any}++Sets the value for the `AsyncLocal` within current execution context.++Once set, the value will be kept through the subsequent asynchronous calls,+unless overridden by calling `asyncLocal.set(value)`:++```js+const asyncLocal = new AsyncLocal();++setImmediate(() => {+  asyncLocal.set('A');++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: A++    asyncLocal.set('B');+    console.log(asyncLocal.get());+    // Prints: B+  });++  console.log(asyncLocal.get());+  // Prints: A++  // Stop further value propagation+  asyncLocal.set(undefined);++  console.log(asyncLocal.get());+  // Prints: undefined++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: undefined+  });+});+```++If the `AsyncLocal` was removed before this call is made,+[`ERR_ASYNC_LOCAL_CANNOT_SET_VALUE`][] is thrown.++### `asyncLocal.remove()`++When called, removes all values stored in the `AsyncLocal` and disables+callbacks for the internal `AsyncHook` instance. Calling `asyncLocal.remove()`

I think this holds too much implementation details. What about something like Disables context propagation for this asyncLocal and releases all values stored by it?

puzpuzpuz

comment created time in 13 days

Pull request review commentnodejs/node

async_hooks: add AsyncLocal API mk2

 const server = net.createServer((conn) => { Promise contexts may not get valid `triggerAsyncId`s by default. See the section on [promise execution tracking][]. +### Class: `AsyncLocal`++<!-- YAML+added: REPLACEME+-->++This class can be used to store a value which follows asynchronous execution+flow. Any value set on an `AsyncLocal` instance is propagated to any callback+or promise executed within the flow. Because of that, a continuation local+storage can be build with an `AsyncLocal` instance. This API is similar to+thread local storage in other runtimes and languages.++The implementation relies on async hooks to follow the execution flow.+So, if an application or a library does not play nicely with async hooks,+the same problems will be seen with the `AsyncLocal` API. In order to fix+such issues the `AsyncResource` API should be used.++The following example shows how to use `AsyncLocal` to build a simple logger+that assignes ids to HTTP requests and includes them into messages logged+within each request.++```js+const http = require('http');+const { AsyncLocal } = require('async_hooks');++const asyncLocal = new AsyncLocal();++function print(msg) {+  const id = asyncLocal.get();+  console.log(`${id !== undefined ? id : '-'}:`, msg);+}++let idSeq = 0;+http.createServer((req, res) => {+  asyncLocal.set(idSeq++);+  print('start');+  setImmediate(() => {+    print('finish');+    res.end();+  });+}).listen(8080);++http.get('http://localhost:8080');+http.get('http://localhost:8080');+// Prints:+//   0: start+//   1: start+//   0: finish+//   1: finish+```++#### `new AsyncLocal()`++Creates a new instance of `AsyncLocal`.++### `asyncLocal.get()`++* Returns: {any}++Returns the value of the `AsyncLocal` in current execution context,+or `undefined` if the value is not set or the `AsyncLocal` was removed.++### `asyncLocal.set(value)`++* `value` {any}++Sets the value for the `AsyncLocal` within current execution context.++Once set, the value will be kept through the subsequent asynchronous calls,+unless overridden by calling `asyncLocal.set(value)`:++```js+const asyncLocal = new AsyncLocal();++setImmediate(() => {+  asyncLocal.set('A');++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: A++    asyncLocal.set('B');+    console.log(asyncLocal.get());+    // Prints: B+  });++  console.log(asyncLocal.get());+  // Prints: A++  // Stop further value propagation+  asyncLocal.set(undefined);++  console.log(asyncLocal.get());+  // Prints: undefined++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: undefined+  });+});+```++If the `AsyncLocal` was removed before this call is made,+[`ERR_ASYNC_LOCAL_CANNOT_SET_VALUE`][] is thrown.++### `asyncLocal.remove()`

I think disable would be a better name.

puzpuzpuz

comment created time in 13 days

Pull request review commentnodejs/node

async_hooks: add AsyncLocal API mk2

 const server = net.createServer((conn) => { Promise contexts may not get valid `triggerAsyncId`s by default. See the section on [promise execution tracking][]. +### Class: `AsyncLocal`++<!-- YAML+added: REPLACEME+-->++This class can be used to store a value which follows asynchronous execution+flow. Any value set on an `AsyncLocal` instance is propagated to any callback+or promise executed within the flow. Because of that, a continuation local+storage can be build with an `AsyncLocal` instance. This API is similar to+thread local storage in other runtimes and languages.++The implementation relies on async hooks to follow the execution flow.+So, if an application or a library does not play nicely with async hooks,+the same problems will be seen with the `AsyncLocal` API. In order to fix+such issues the `AsyncResource` API should be used.++The following example shows how to use `AsyncLocal` to build a simple logger+that assignes ids to HTTP requests and includes them into messages logged+within each request.++```js+const http = require('http');+const { AsyncLocal } = require('async_hooks');++const asyncLocal = new AsyncLocal();++function print(msg) {+  const id = asyncLocal.get();+  console.log(`${id !== undefined ? id : '-'}:`, msg);+}++let idSeq = 0;+http.createServer((req, res) => {+  asyncLocal.set(idSeq++);+  print('start');+  setImmediate(() => {+    print('finish');+    res.end();+  });+}).listen(8080);++http.get('http://localhost:8080');+http.get('http://localhost:8080');+// Prints:+//   0: start+//   1: start+//   0: finish+//   1: finish+```++#### `new AsyncLocal()`++Creates a new instance of `AsyncLocal`.++### `asyncLocal.get()`++* Returns: {any}++Returns the value of the `AsyncLocal` in current execution context,+or `undefined` if the value is not set or the `AsyncLocal` was removed.++### `asyncLocal.set(value)`++* `value` {any}++Sets the value for the `AsyncLocal` within current execution context.++Once set, the value will be kept through the subsequent asynchronous calls,+unless overridden by calling `asyncLocal.set(value)`:++```js+const asyncLocal = new AsyncLocal();++setImmediate(() => {+  asyncLocal.set('A');++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: A++    asyncLocal.set('B');+    console.log(asyncLocal.get());+    // Prints: B+  });++  console.log(asyncLocal.get());+  // Prints: A++  // Stop further value propagation+  asyncLocal.set(undefined);++  console.log(asyncLocal.get());+  // Prints: undefined++  setImmediate(() => {+    console.log(asyncLocal.get());+    // Prints: undefined+  });+});+```++If the `AsyncLocal` was removed before this call is made,+[`ERR_ASYNC_LOCAL_CANNOT_SET_VALUE`][] is thrown.

Not sure if it is that nice for users to get an exception in this case. What about silently ignoring calls to set and add asyncLocal.enabled (or similar)?

puzpuzpuz

comment created time in 13 days

pull request commentopen-telemetry/opentelemetry-js

fix: allow multi tenant vendor keys in TraceState

Yes, the version has to be managed by the vendors. W3C only specifies which chars are allowed but not what's inside and how this has to be interpreted.

One use case regarding added value: Think about two services, one calls the other and both use OTel to create spans, propagate tracecontext and export their spans to the same backend. Everything fine so far. Now some load balancer or similar is put between them (e.g. by the hoster service). If it just forwards tracecontext nothing has changed. But if it also uses OTel and creates spans for in/out but doesn't export to the same backend it's no longer possible to link the two services. They still belong to the same trace but parent spanid seen by the second doesn't match to the out spanid of the first. A vendor can add some info on tracestate which is passed through by the foreign tier in the middle therefore linking is still possible then.

Flarna

comment created time in 13 days

pull request commentopen-telemetry/opentelemetry-js

fix: allow multi tenant vendor keys in TraceState

LGTM, question: How do you propagate tracestate ?

For HTTP the TraceState is propagated via HTTP header tracestate:

  • For incoming requests HttpTextFormat.extract parses tracestate header (along with traceparent) and puts it on SpanContext.traceState.
  • For internal spans TraceState is just forwarded unmodified from parent span to child's
  • For outgoing requests HttpTextFormat.inject serializes SpanContext.traceState into HTTP header tracestate.

So on default tracestate is passed through without modifications (if present at all as it is optional). Vendors can use it to add their own data. To do this they have to either modify SpanContext.traceState before HttpTextFormat.inject is called or replace/enhance the HttpTextFormat() implementation by their own. I think I will go for the second variant but not decided yet.

Flarna

comment created time in 13 days

push eventdynatrace-oss-contrib/opentelemetry-js

Daniel Dyla

commit sha 9b2737abf3f16e8c2c4f7445223422726daadce8

fix: prevent crash when SDT exporter constructed without options (#780)

view details

Gerhard Stoebich

commit sha 179d1c2790702e5515143433ce582480f61e03d8

Merge remote-tracking branch 'upstream/master' into trace-state-vendor

view details

push time in 13 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 511e1be0001694de7ce0d6199fe2e70ae22a7b03

chore: fix regex

view details

push time in 13 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha 241414845d0cd552411af1f53ad8b550cad0f1ef

chore: update jsdoc, use single RegEx

view details

push time in 13 days

pull request commentnodejs/node

async_hooks: add AsyncLocal API mk2

@puzpuzpuz No problem. I don't care much about my authorship and this PR had already a link to the previous PR. The important point for me is that people starting to review now have a chance to get the full history - which is quite long meanwhile.

puzpuzpuz

comment created time in 13 days

Pull request review commentopen-telemetry/opentelemetry-js

fix: allow multi tenant vendor keys in TraceState

  * limitations under the License.  */ -const VALID_KEY_REGEX = /^[a-z][_0-9a-z-*/]{0,255}$/;+const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';+const VALID_KEY_REGEX = new RegExp(`^[a-z]${VALID_KEY_CHAR_RANGE}{0,255}$`);+const VALID_KEY_VENDOR_REGEX = new RegExp(+  `^[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}$`

This is how I interpret the W3C spec:

key = lcalpha 0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
key = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) "@" lcalpha 0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
lcalpha    = %x61-7A ; a-z
Flarna

comment created time in 14 days

pull request commentnodejs/node

async_hooks: add AsyncLocal

I took the idea of AsyncLocal from .NET and ported it to node.js in #27172 which stalled fast. @puzpuzpuz created #31016 as followup - removing parts, adding new stuff and porting on top of #30959

Qard

comment created time in 14 days

push eventdynatrace-oss-contrib/opentelemetry-js

Gerhard Stoebich

commit sha cd6b94fa87dab91930eb63b49254b990734da07e

fix: allow multi tenant vendor keys in TraceState Improve checking of TraceState keys to allow '@' char used in multi tenant vendor scenarios. See https://www.w3.org/TR/trace-context/#key for details

view details

push time in 14 days

PR opened open-telemetry/opentelemetry-js

Reviewers
fix: allow multi tenant vendor keys in TraceState

Which problem is this PR solving?

TraceState doesn't allow keys holding '@' char even W3C specifies them for multi tenant vendor scenarios.

Short description of the changes

Improve checking of TraceState keys to allow '@' char used in multi tenant vendor scenarios.

See https://www.w3.org/TR/trace-context/#key for details

+9 -4

0 comment

2 changed files

pr created time in 14 days

create barnchdynatrace-oss-contrib/opentelemetry-js

branch : trace-state-vendor

created branch time in 14 days

push eventdynatrace-oss-contrib/opentelemetry-js

Bartlomiej Obecny

commit sha 33e3da6053cd102c170f945d36e53a637096cf96

chore: adding information to main readme about user interaction plugin (#767)

view details

Mayur Kale

commit sha 2ee5a9c683d81da52da7f190beb49f4bbd52790a

chore: upgrade lerna-changelog to ^1.0.0 (#765) Co-authored-by: Olivier Albertini <olivier.albertini@montreal.ca> Co-authored-by: Valentin Marchaud <thisismac47@gmail.com>

view details

Mayur Kale

commit sha 89e03dba9047e34bcecf062bde00b0c05c861be9

chore: fix npm image (#768)

view details

Mayur Kale

commit sha c6b29233d4bfae1d1e983edf6c830ee1e3a9f2e7

chore: post release update (#766)

view details

Daniel Dyla

commit sha 4faac48f88c32439a4196b045ccb6d590487b048

chore: add typing to propagator carrier (#772)

view details

Mayur Kale

commit sha 82723ef6826f210b7cb8f56652b5c7cd9b1a8025

cleanup: remove unsed tsconfig-release.json (#775)

view details

Valentin Marchaud

commit sha b6a2ccdf29383d1d9402d15df22cb5413d768cba

feat: warn user when a instrumented package was already required #636 (#654) * feat: warn user when a instrumented package was already required #636 * chore: address PR comments * chore: extract package name from require.cache * chore: use find instead of some * chore: use require.resolve to find already required modules * chore: try/catch require.resolve Co-authored-by: Mayur Kale <mayurkale@google.com>

view details

Mayur Kale

commit sha 56a97454c3946d11a0dee493e2e7854258f3ae5f

chore: fix npm img for api package (#778)

view details

Valentin Marchaud

commit sha b1fe2c81b9842dca18dba7db7d87c15fc95820b6

Prevent loading plugins for incorrect module #626 (#653) * fix: do not load plugin when they patch a different module than defined in config #626

view details

push time in 14 days

pull request commentnodejs/node

async_hooks: add executionAsyncResource

I did a fast look and I think the root cause is that destroy hook is called via setImmediate and therefore the executionAsyncResource points to the setImmediate resource (which is actually executed) and not that one which is destroyed.

Qard

comment created time in 14 days

push eventdynatrace-oss-contrib/node

Anna Henningsen

commit sha 875a4d1a58d6dec80518c9d2a05ae6107c70b066

worker: add ability to take heap snapshot from parent thread PR-URL: https://github.com/nodejs/node/pull/31569 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Guy Bedford

commit sha 0f96dc266fd0cd8c1baa82ce7eb951c11b29a331

esm: import.meta.resolve with nodejs: builtins PR-URL: https://github.com/nodejs/node/pull/31032 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>

view details

ConorDavenport

commit sha d4660aba6324096198bc17772ba16fce6259967d

src: change Fill() to use ParseArrayIndex() Changed Fill() to use ParseArrayIndex() when getting start and end of buffers instead of Uint32Value, supporting buffers of greater than 2**32 Fixes: https://github.com/nodejs/node/issues/31514 Co-Authored-By: Rich Trott <rtrott@gmail.com> PR-URL: https://github.com/nodejs/node/pull/31591 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Anna Henningsen

commit sha d435dc47f3d303ff1669fa711a0af287a9df973a

test: unset NODE_OPTIONS for cctest The test may fail otherwise because of behaviour changes caused by setting the environment variable. Fixes: https://github.com/nodejs/node/issues/31585 PR-URL: https://github.com/nodejs/node/pull/31594 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

bcoe

commit sha 3f70d7720333dd0996dfd6ca21beb4a24d561e1b

fs: set path when mkdir recursive called on file PR-URL: https://github.com/nodejs/node/pull/31607 Fixes: https://github.com/nodejs/node/issues/28015 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

Rusty Conover

commit sha ee9e689df2dd219084820d1adb7a97d104726794

net: track state of setNoDelay() and prevent unnecessary system calls The state of .setNoDelay() is now tracked and code will prevent repeated system calls to setsockopt() when the value has already been set to the desired value for the socket. Change and expand the appropriate test. PR-URL: https://github.com/nodejs/node/pull/31543 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Anna Henningsen

commit sha 60de60a0ce21378c80353489759dc70f05156cc7

src: remove unused `Worker::child_port_` member This fixes a compiler warning introduced in 9225939528590f652e6. PR-URL: https://github.com/nodejs/node/pull/31599 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Kirill Fomichev

commit sha 018c3e8949e925efc8077801d44c2b2feb974750

perf_hooks: add property flags to GCPerformanceEntry PR-URL: https://github.com/nodejs/node/pull/29547 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>

view details

James M Snell

commit sha 2d8febceef35bdd52624028bdee2e0d58830ae7f

fs: deprecate closing FileHandle on garbage collection Closing the FileHandle on garbage collection is a bad practice. Runtime deprecate and indicate that an error will be thrown in the future. PR-URL: https://github.com/nodejs/node/pull/28396 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Ruben Bridgewater

commit sha fb6df3bfac8ca38a7012eabf0563d7a799ce1acc

fs: validate the input data to be of expected types The input was not validated so far and that caused unwanted side effects. E.g., `undefined` became the string `'undefined'`. It was expected to fail or to end up as empty string. Now all input is validated to be either some type of array buffer view or a string. That way it's always clear what the user intents. PR-URL: https://github.com/nodejs/node/pull/31030 Fixes: https://github.com/nodejs/node/issues/31025 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Juan José Arboleda

commit sha afe353061b3c0543ebaa40668f27c12384e6c5d6

doc: fs.write is not longer coercing strings PR-URL: https://github.com/nodejs/node/pull/31030 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>

view details

Ruben Bridgewater

commit sha f295ba5d2ce13c2a53f405d5915ad920431331be

test: refactor test-readline-interface.js This reduces the code lines required to run the tests by abstracting the constructor call. It also moves tests out of a for loop that where miss placed. PR-URL: https://github.com/nodejs/node/pull/31423 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Ruben Bridgewater

commit sha 1fb4bd1fc4b970c5154159ad6734bc722052af3b

test: abstract common assertions in readline-interface test PR-URL: https://github.com/nodejs/node/pull/31423 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Anna Henningsen

commit sha 6a6279ef2a38c17a761cc15366e615c620328587

doc: add AsyncResource + Worker pool example Use Worker thread pools as an example of how `AsyncResource` can be used to track async state across callbacks. PR-URL: https://github.com/nodejs/node/pull/31601 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>

view details

Robert Nagy

commit sha 234de6f1fd90ece1edc1a12d989ab0f15a1f19b8

stream: fix finished w/ 'close' before 'finish' Emitting 'close' before 'finish' on a Writable should result in a premature close error. PR-URL: https://github.com/nodejs/node/pull/31534 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Anna Henningsen

commit sha c1da4e4aa4583c14f87c8d230ce7580f3b157ff0

src: fix inspecting `MessagePort` from `init` async hook During the `init()` async hook, the C++ object is not finished creating yet (i.e. it is an `AsyncWrap`, but not yet a `HandleWrap` or `MessagePort`). Accessing the `handle_` field is not valid in that case. However, the custom inspect function for `MessagePort`s calls `HasRef()` on the object, which would crash when the object is not fully constructed. Fix that by guarding the access of the libuv handle on that condition. PR-URL: https://github.com/nodejs/node/pull/31600 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Conor ONeill

commit sha 7e911d8b03a838e5ac6bb06c5b313533e89673ef

doc: add example to fs.promises.readdir PR-URL: https://github.com/nodejs/node/pull/31552 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

James M Snell

commit sha 907c07fa850e128c695482cd47554b5bce5e4b0c

stream: move _writableState.buffer to EOL API was deprecated back in the 0.11 days. PR-URL: https://github.com/nodejs/node/pull/31165 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>

view details

James M Snell

commit sha bffa5044c576003198ccfee5a751c23036d0744f

crypto: move pbkdf2 without digest to EOL API has been being incrementally deprecated since 6.0.0 PR-URL: https://github.com/nodejs/node/pull/31166 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

James M Snell

commit sha ec0dd6fa1cfa03b3983419acedb27ef95d297c82

lib: move GLOBAL and root aliases to EOL GLOBAL and root have been long deprecated. PR-URL: https://github.com/nodejs/node/pull/31167 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

push time in 14 days

push eventDynatrace/agent-nodejs

Gerhard Stoebich

commit sha 97fbcb6d7ae23ecffdca49038bef99c31d928a9a

Update OneAgent to 1.185.131

view details

push time in 15 days

push eventDynatrace/agent-nodejs

Gerhard Stoebich

commit sha 97fbcb6d7ae23ecffdca49038bef99c31d928a9a

Update OneAgent to 1.185.131

view details

push time in 15 days

delete branch dynatrace-oss-contrib/opentelemetry-js

delete branch : rename-provider-examples

delete time in 15 days

delete branch dynatrace-oss-contrib/opentelemetry-js

delete branch : publish-docs-all-tags

delete time in 15 days

delete branch dynatrace-oss-contrib/node

delete branch : remove-dead-code-callbackscope

delete time in 18 days

Pull request review commentopen-telemetry/opentelemetry-js

Separate context propagation (OTEP 66)

   "publishConfig": {     "access": "public"   },+  "dependencies": {

Maybe Context and the dummy implementation should be moved like it was done with a other parts recently?

dyladan

comment created time in 19 days

Pull request review commentopen-telemetry/opentelemetry-js

Separate context propagation (OTEP 66)

+/*!+ * Copyright 2020, OpenTelemetry Authors+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ *      https://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++/** Map of identifiers to an unknown value used internally to store context */+type Store = { [identifer: string]: unknown };++/**+ * Class which stores and manages current context values. All methods which+ * update context such as get and delete do not modify an existing context,+ * but create a new one with updated values.+ */+export class Context {+  private _context: Store;++  public static readonly ROOT_CONTEXT = new Context();++  /**+   * Construct a new context which inherits values from an optional parent context.+   *+   * @param context a context from which to inherit values+   */+  protected constructor(parentContext: Store = {}) {

Noone should extend it. Or what is the use case of extending it? I think if user defined Context classes should be supported an abstract API like createContext() would be needed.

dyladan

comment created time in 19 days

more