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

Support for Node.js profiles #4728

Merged
merged 5 commits into from
Feb 18, 2021
Merged

Conversation

dgieselaar
Copy link
Member

@dgieselaar dgieselaar commented Feb 14, 2021

Implements support for Node.js profiles, by normalizing sample.count to samples.count and adding wall.microseconds as a supported value type (Node.js pprof profiles don't support CPU time, only wall time).

Maybe a little premature but seems like a low-risk change?

Would appreciate any guidance on what tests should be added (and where).

Checklist

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

Related issues

@cla-checker-service
Copy link

cla-checker-service bot commented Feb 14, 2021

💚 CLA has been signed

Comment on lines +61 to +62
// Go profiles report samples.count, Node.js profiles report sample.count.
// We use samples.count for both so we can aggregate on one field.
Copy link
Member Author

@dgieselaar dgieselaar Feb 14, 2021

Choose a reason for hiding this comment

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

Convention says that the first value type is always the number of samples collected. However, for heap profiles this field is alloc_objects.count, which is explicitly aggregated on in fetcher.go (and passed to the pprof UI).

@dgieselaar dgieselaar force-pushed the support-nodejs-profiles branch from 7438546 to 664c54e Compare February 14, 2021 12:05
@apmmachine
Copy link
Contributor

apmmachine commented Feb 14, 2021

💚 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

Expand to view the summary

Build stats

  • Build Cause: Pull request #4728 updated

  • Start Time: 2021-02-18T07:45:42.311+0000

  • Duration: 47 min 13 sec

  • Commit: c123d91

Test stats 🧪

Test Results
Failed 0
Passed 4751
Skipped 124
Total 4875

Trends 🧪

Image of Build Times

Image of Tests

Implements support for Node.js profiles, by normalizing sample.count to samples.count and adding wall.microseconds as a supported value type.
@dgieselaar dgieselaar force-pushed the support-nodejs-profiles branch from 664c54e to dfb7022 Compare February 14, 2021 12:07
@codecov-io
Copy link

codecov-io commented Feb 14, 2021

Codecov Report

Merging #4728 (c123d91) into master (5042806) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4728      +/-   ##
==========================================
+ Coverage   76.80%   76.81%   +0.01%     
==========================================
  Files         166      166              
  Lines       10239    10244       +5     
==========================================
+ Hits         7864     7869       +5     
  Misses       2375     2375              
Impacted Files Coverage Δ
model/profile.go 100.00% <100.00%> (ø)

- name: wall
type: group
fields:
- name: us
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to have a single base unit -- on-CPU time is recorded as profile.cpu.ns. In theory if we stored in nanoseconds then we could run into overflows when aggregating over a large cluster (hundreds) of service instances, over a significant time period (months to years).

Probably something to consider later, when we firm all of this up.

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

Maybe a little premature but seems like a low-risk change?

Perfectly fine and low-risk indeed.

Would appreciate any guidance on what tests should be added (and where).

For now I think it would be good enough to modify model/profile_test.go, adding sample.count and wall.microseconds samples and checking they're normalised appropriately.

We can add more extensive functional tests later.

@dgieselaar
Copy link
Member Author

jenkins run the tests please

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

LGTM! Can you please add an entry to changelogs/head.asciidoc? Then it's good to merge.

@axw axw merged commit 5a1318b into elastic:master Feb 18, 2021
axw pushed a commit to axw/apm-server that referenced this pull request Feb 20, 2021
* Support for Node.js profiles

Implements support for Node.js profiles, by normalizing sample.count to samples.count and adding wall.microseconds as a supported value type.
# Conflicts:
#	changelogs/head.asciidoc
#	include/fields.go
axw added a commit that referenced this pull request Feb 20, 2021
* Support for Node.js profiles

Implements support for Node.js profiles, by normalizing sample.count to samples.count and adding wall.microseconds as a supported value type.
# Conflicts:
#	changelogs/head.asciidoc
#	include/fields.go

Co-authored-by: Dario Gieselaar <[email protected]>
v1v added a commit to v1v/apm-server that referenced this pull request Feb 22, 2021
…chemas-to-agents

* upstream/master: (111 commits)
  Introduce metricset.name (elastic#4857)
  processor/otel: test service.version handling (elastic#4853)
  docs: Add PHP agent information to shared docs (elastic#4740)
  Script for faster development workflow (elastic#4731)
  Update to elastic/beats@1b31c26 (elastic#4763)
  backport: add 7.12 to .backportrc.json (elastic#4807)
  backport: enable auto-merge on backport PRs (elastic#4777)
  Support for Node.js profiles (elastic#4728)
  docs: readds .NET link (elastic#4764)
  [DOCS] Fixes URLs on Secure communication with APM Agents page (elastic#4746)
  ci: set proper parameters for the tar step (elastic#4696)
  docs: add 7.11.1 release notes (elastic#4727)
  Disable sourcemap upload endpoint when data streams enabled (elastic#4735)
  Add service name to dataset field (elastic#4674)
  Update to elastic/beats@ba423212a660 (elastic#4733)
  sampling: require a default policy (elastic#4729)
  processor/otel: add unit test for span status (elastic#4734)
  Add support for consuming OTLP/gRPC metrics (elastic#4722)
  [apmpackage] Add config options supported in ESS (elastic#4690)
  Use the apm-server version everywhere* (elastic#4725)
  ...
v1v added a commit to v1v/apm-server that referenced this pull request Feb 22, 2021
…te-schema-json-1

* upstream/master: (111 commits)
  Introduce metricset.name (elastic#4857)
  processor/otel: test service.version handling (elastic#4853)
  docs: Add PHP agent information to shared docs (elastic#4740)
  Script for faster development workflow (elastic#4731)
  Update to elastic/beats@1b31c26 (elastic#4763)
  backport: add 7.12 to .backportrc.json (elastic#4807)
  backport: enable auto-merge on backport PRs (elastic#4777)
  Support for Node.js profiles (elastic#4728)
  docs: readds .NET link (elastic#4764)
  [DOCS] Fixes URLs on Secure communication with APM Agents page (elastic#4746)
  ci: set proper parameters for the tar step (elastic#4696)
  docs: add 7.11.1 release notes (elastic#4727)
  Disable sourcemap upload endpoint when data streams enabled (elastic#4735)
  Add service name to dataset field (elastic#4674)
  Update to elastic/beats@ba423212a660 (elastic#4733)
  sampling: require a default policy (elastic#4729)
  processor/otel: add unit test for span status (elastic#4734)
  Add support for consuming OTLP/gRPC metrics (elastic#4722)
  [apmpackage] Add config options supported in ESS (elastic#4690)
  Use the apm-server version everywhere* (elastic#4725)
  ...
mergify bot pushed a commit that referenced this pull request Apr 27, 2021
* Support for Node.js profiles

Implements support for Node.js profiles, by normalizing sample.count to samples.count and adding wall.microseconds as a supported value type.

(cherry picked from commit 5a1318b)

# Conflicts:
#	include/fields.go
@axw
Copy link
Member

axw commented Apr 28, 2021

I'm going to remove this from the test plan since it's currently only intended for internal consumption.

@axw axw removed the test-plan label Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants