question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

consider eliding span.sync=false because it is the typical case

See original GitHub issue

tl;dr: Setting span.sync to true or false on every APM span results in unhelpful UI noise in Kibana. Let’s only set it when it is “interesting”. For Node.js the typical case is that spans are async (most traced work span event loop async operations). That leaves “span.sync==true” as the “interesting” case.

The span.sync field can be true, false, null or not set per the api-server spec.

Here is the Kibana code that adds a SyncBadge to spans in the Waterfall view and the code for the SyncBadge element. I.e. sync: true will showing “blocking” in the ui, sync: false will show “async”, sync: null (or not specified) will show nothing. E.g.:

Screen Shot 2020-11-17 at 2 28 08 PM

From chat discussion (this came up when discussing elastic/apm-agent-nodejs#1878):

“Felix I remember that we’ve talked about the usefulness of having all spans marked as sync=false in Node.js. Setting sync=false makes the UI add a async flag next to the span name. But as async is the default in Node.js, it would probably make more sense to not set the sync flag in the default async case but only set sync=true when there’s a blocking operation, which makes the UI show a blocking label. This is what the RUM agent is doing.”

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
trentmcommented, Aug 23, 2021

[Alan]

Also – I’d also lightly push back on the idea that Node’s default behavior is async. …

Alan, would you object to language that a “typical” Node.js traced span is async? I.e. we get away from using the term “default”.


tl;dr: My votes are to (a) close this issue (i.e. have the Node.js APM agent report what it knows and not attempt to only report what it thinks is “interesting”) and (b) continue with https://github.com/elastic/kibana/issues/109661 (though I would say “when interesting”, rather than “when relevant”).

  • AFAICT the “sync” field isn’t discussed in the APM agent specs at all. The Python async examples above show that it might be useful to at some point to have an cross-agent discussion clarifying span.sync. I don’t think we need to get into it now, however. (FWIW, my naive read of the Python APM agent code is that span.sync is set False when asyncio is used, and otherwise is almost always left blank, i.e. almost never set True.)
  • I think the “async” badge in the UI on almost all spans in Node.js traces is visual clutter, so I think https://github.com/elastic/kibana/issues/109661 is a good idea.
  • Note that the “blocking” badge on all the ES spans in @sqren’s screenshot in https://github.com/elastic/kibana/issues/109661 is a bug. Those ES spans are async. I hope to fix that in upcoming working.
0reactions
trentmcommented, Sep 2, 2021

My votes are to (a) close this issue …

Closing. Alan had no objections.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Portable, Modular Expression of Locality - CiteSeerX
This thesis presents a performance model that makes thread and object locality explicit. Zones form a runtime hierarchy that reflects the ...
Read more >
pebble - Go Packages
Pebble inherits the RocksDB file formats and a few extensions such as range deletion tombstones, table-level bloom filters, and updates to the MANIFEST...
Read more >
Code coverage report for node-npmtest-mocha ...
afterEach; context.run = mocha.options.delay && common. ... beforeEach(name, fn); }, /** * Execute after each test case.
Read more >
Portable, Modular Expression of Locality - ICSI
cality, and implementation concerns when systems span more than one address ... ation that depends on it, in which case that operation is...
Read more >
https://reviews.freebsd.org/rS365340?diff=1
We need * to log this history once to each pool, and bypass * the normal history ... filesystem | snapshot * *...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found