Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: dropped span stats #2707

Merged
merged 40 commits into from
Jun 6, 2022
Merged

feat: dropped span stats #2707

merged 40 commits into from
Jun 6, 2022

Conversation

astorm
Copy link
Contributor

@astorm astorm commented May 19, 2022

Closes: #2302 (part 3 of 3)

Dependent on #2694

This PR creates a class/object for collecting statistic on the dropped spans, uses that new object to collect statistics on non-sampled spans and ensures this data is serialized/encoded along with the transaction object.

The implementation is based on the same implementation in the java agent.

Spec: https://github.com/elastic/apm/blob/main/specs/agents/handling-huge-traces/tracing-spans-dropped-stats.md

Checklist

  • Implement code
  • Add tests
  • [ ] Update TypeScript typings
  • [ ] Update documentation
  • Add CHANGELOG.asciidoc entry

Alan Storm and others added 23 commits May 13, 2022 09:29
…eSpan-returns-null.js to test the intended OTelTracer.startSpan case where the internal createSpan API returns a null
The change away from `NODE_VERSION` in #2627 surprisingly
broke running the benchmarks. `NODE_VERSION` is used by nvm
and exporting it (?) makes a difference?
…ue with github deps (#2696)

[email protected] (and only that version) has a github dep:
    "@types/mysql": "types/mysql",
Attempting to install that version with npm v6 (the npm in node v10, v12, and
v14) hits npm/cli#4896 which results in an
install so slow that is hits the default 2 minute 'npm install' timeout
in the `tav` tool.
This adds a 'links' option to `createTransaction` and `createSpan` APIs
for specifying span links.
    apm.startSpan('name', { links: [ ... ] })
https://github.com/elastic/apm/blob/main/specs/agents/span-links.md
Span links support is added to the OTel Bridge as well:
    tracer.startSpan('name', { links: [ ... ] })

This adds a `traceContinutationStrategy` configuration option to allow
some control over how the APM Agent uses incoming trace-context headers
for context propagation.
https://github.com/elastic/apm/blob/main/specs/agents/trace-continuation.md

This also fixes a whitespace parsing issue in TraceState.

Closes: #2592
Closes: #2673
Closes: #2554
Obsoletes: #2555
AFAIK the "compatible runtimes" flag on Lambda layers is just advisory.
This avoids the name collision with the "exitSpan" option when creating
a span in the public API.

Closes: #2680
The old 'hapi' package was itself deprecated about 2 years ago.  The APM
agent now deprecates instrumenting it. The instrumentation code remains,
but it is no longer tested and will be removed in the next major.

Note that '@hapi/hapi' is still supported, this is just about the old
package name and versions. Any versions starting with 17.9.0, 18.2.0,
19 and later are the newer '@hapi/hapi'.

Refs: #2691
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label May 19, 2022
@apmmachine
Copy link
Contributor

apmmachine commented May 19, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-06-01T22:03:56.963+0000

  • Duration: 27 min 39 sec

Test stats 🧪

Test Results
Failed 0
Passed 257131
Skipped 0
Total 257131

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run module tests for <modules> : Run TAV tests for one or more modules, where <modules> can be either a comma separated list of modules (e.g. memcached,redis) or the string literal ALL to test all modules

  • run benchmark tests : Run the benchmark test only.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@astorm astorm marked this pull request as ready for review May 20, 2022 03:28
@astorm astorm requested a review from trentm May 20, 2022 03:28
lib/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
CHANGELOG.asciidoc Outdated Show resolved Hide resolved
lib/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
lib/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
lib/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
test/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
lib/instrumentation/dropped-span-stats.js Show resolved Hide resolved
lib/instrumentation/index.js Show resolved Hide resolved
test/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
test/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
@astorm astorm requested review from trentm and removed request for trentm May 25, 2022 16:41
@astorm astorm requested a review from trentm May 26, 2022 00:22
@astorm astorm self-assigned this May 26, 2022
lib/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
test/instrumentation/transaction.test.js Outdated Show resolved Hide resolved
@astorm astorm requested a review from trentm May 29, 2022 02:35
@trentm
Copy link
Member

trentm commented May 30, 2022

astorm requested a review from trentm 2 days ago

Was there another change since my last review? If so, I don't see it.

lib/instrumentation/transaction.js Outdated Show resolved Hide resolved
lib/instrumentation/dropped-span-stats.js Outdated Show resolved Hide resolved
@astorm astorm requested a review from trentm June 1, 2022 23:15
Copy link
Member

@trentm trentm left a comment

Choose a reason for hiding this comment

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

LGTM.

@astorm astorm merged commit 2b191c4 into main Jun 6, 2022
@astorm astorm deleted the astorm/span-stats-dropped-span-stats branch June 6, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[META 497] Collecting statistics about dropped spans
3 participants