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

sampling: add trace group sampling reservoirs #4182

Merged
merged 7 commits into from
Sep 18, 2020
Merged

Conversation

axw
Copy link
Member

@axw axw commented Sep 9, 2020

Motivation/summary

Introduce a type for maintaining a collection of trace groups.

For each trace group we measure the observed ingest rate for
the trace group (number of root traces per sampling interval),
and maintain a weighted random sampling reservoir for recording
trace IDs. Trace IDs are weighted by root transaction duration,
which means slower traces will have a greater chance of being
captured.

Metrics/monitoring for this will come later.

Checklist

I have considered changes for:
- [ ] documentation
- [ ] logging (add log lines, choose appropriate log selector, etc.)
- [ ] metrics and monitoring (create issue for Kibana team to add metrics to visualizations, e.g. Kibana#44001)

How to test these changes

make test

Related issues

None.

axw added 2 commits September 9, 2020 12:00
Introduce a type for maintaining a collection of trace groups.

For each trace group we measure the observed ingest rate for
the trace group (number of root traces per sampling interval),
and maintain a weighted random sampling reservoir for recording
trace IDs. Trace IDs are weighted by root transaction duration,
which means slower traces will have a greater chance of being
captured.
@apmmachine
Copy link
Contributor

apmmachine commented Sep 9, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #4182 updated]

  • Start Time: 2020-09-18T03:25:55.976+0000

  • Duration: 42 min 12 sec

Test stats 🧪

Test Results
Failed 0
Passed 3567
Skipped 145
Total 3712

Steps errors

Expand to view the steps failures

  • Name: Compress

    • Description: tar --exclude=coverage-files.tgz -czf coverage-files.tgz coverage

    • Duration: 0 min 0 sec

    • Start Time: 2020-09-18T03:39:37.007+0000

    • log

  • Name: Compress

    • Description: tar --exclude=system-tests-linux-files.tgz -czf system-tests-linux-files.tgz system-tests

    • Duration: 0 min 0 sec

    • Start Time: 2020-09-18T03:49:45.935+0000

    • log

  • Name: Test Sync

    • Description: ./script/jenkins/sync.sh

    • Duration: 3 min 48 sec

    • Start Time: 2020-09-18T03:34:00.603+0000

    • log

@axw axw requested a review from a team September 9, 2020 06:13
x-pack/apm-server/sampling/groups.go Outdated Show resolved Hide resolved
x-pack/apm-server/sampling/groups.go Outdated Show resolved Hide resolved
- better name for decay factor
- fix doc comments to reflect reality
- fix criteria for removing trace groups
@axw axw mentioned this pull request Sep 10, 2020
8 tasks
Copy link
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

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

Sorry for the late review; and thanks for all the comments - very helpful!

x-pack/apm-server/sampling/groups.go Outdated Show resolved Hide resolved
@axw axw merged commit e6b3545 into elastic:master Sep 18, 2020
@axw axw deleted the tbs-reservoir branch September 18, 2020 05:51
axw added a commit to axw/apm-server that referenced this pull request Sep 18, 2020
* sampling: add trace group sampling reservoirs

Introduce a type for maintaining a collection of trace groups.

For each trace group we measure the observed ingest rate for
the trace group (number of root traces per sampling interval),
and maintain a weighted random sampling reservoir for recording
trace IDs. Trace IDs are weighted by root transaction duration,
which means slower traces will have a greater chance of being
captured.

* Address self-review comments

- better name for decay factor
- fix doc comments to reflect reality
- fix criteria for removing trace groups

* Update x-pack/apm-server/sampling/groups.go

* Remove unnecessary variable assignment
axw added a commit that referenced this pull request Sep 18, 2020
* sampling: add trace group sampling reservoirs

Introduce a type for maintaining a collection of trace groups.

For each trace group we measure the observed ingest rate for
the trace group (number of root traces per sampling interval),
and maintain a weighted random sampling reservoir for recording
trace IDs. Trace IDs are weighted by root transaction duration,
which means slower traces will have a greater chance of being
captured.

* Address self-review comments

- better name for decay factor
- fix doc comments to reflect reality
- fix criteria for removing trace groups

* Update x-pack/apm-server/sampling/groups.go

* Remove unnecessary variable assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants