-
Notifications
You must be signed in to change notification settings - Fork 610
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
docs: Add sampling documentation #2854
Conversation
|
||
# Sampling scrape targets | ||
|
||
It's not uncommon for an application to have many instances deployed. While Pyroscope is designed specifically to handle large amounts of profiling data, you may have other considerations which demand that only a subset of the application's instances should be scraped. For example, the sheer volume of profiling data your application generates may make it unreasonable to profile every instance or you might be targeting cost-reduction. Whatever the case may be, it's possible to sample scrape targets through configuration of the Grafana Agent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about this? I'm not crazy about the last sentence in this suggestion. It still sounds awkward.
It's not uncommon for an application to have many instances deployed. While Pyroscope is designed specifically to handle large amounts of profiling data, you may have other considerations which demand that only a subset of the application's instances should be scraped. For example, the sheer volume of profiling data your application generates may make it unreasonable to profile every instance or you might be targeting cost-reduction. Whatever the case may be, it's possible to sample scrape targets through configuration of the Grafana Agent. | |
Applications often have many instances deployed. | |
While Pyroscope is designed to handle large amounts of profiling data, you may want only a subset of the application's instances to be scraped. | |
For example, the volume of profiling data your application generates may make it unreasonable to profile every instance or you might be targeting cost-reduction. | |
By configuring Grafana Agent, Pyroscope can sample scrape targets through the Grafana Agent's configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like this updated version -- better for skimming. I do plan to do a video on this at some point and would use the initial version for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this change in In 18daf62. I tweaked the last sentence a little because saying "Grafana Agent" twice felt awkward.
|
||
The `hashmod` action and the `modulus` argument are used in conjunction to enable sampling behavior. To read further on these concepts, see [rule block documentation]({{< relref "/docs/agent/latest/flow/reference/components/discovery.relabel#rule-block" >}}). In short, `hashmod` will perform an MD5 hash on the source labels and `modulus` will perform a modulus operation on the output. | ||
|
||
Together, these can be leveraged to shard targets into shards. One or more shards can be selected to be the sampled targets to be scraped. Here is an example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the phrase "share targets into shards." If you have better wording, please feel free to edit this suggestion to update.
Together, these can be leveraged to shard targets into shards. One or more shards can be selected to be the sampled targets to be scraped. Here is an example: | |
Together, they can be leveraged to shard targets into shards. One or more shards can be selected to be the sampled targets to be scraped. Here is an example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Together, these can be leveraged to shard targets into shards. One or more shards can be selected to be the sampled targets to be scraped. Here is an example: | |
Together, these can be leveraged to divide targets into shards. Once divided, you can configure what percentage of the shards should be scraped. Here is an example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In In 18daf62, I also reworked this part. I went into a little more detail about how hashmod
will shard the labels and keep
will select shards.
It might still need some work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent updates. Thank you for updating the docs!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lpgtm!
* Add sampling doc * Tweak wording and layout * Fix links * Fix absolute links * Variety of small tweaks in structure and wording
* Changes from 2855 intro doc * docs: update go-pull.md (#2844) * docs: update go-pull.md * fix links * rm comments * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * typo * Update docs/sources/configure-client/grafana-agent/go_pull.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> --------- Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> Co-authored-by: Ryan Perry <Rperry2174@gmail.com> * Create release notes for v1.2.1 (#2860) * docs: Add sampling documentation (#2854) * Add sampling doc * Tweak wording and layout * Fix links * Fix absolute links * Variety of small tweaks in structure and wording * docs: Refactor ebpf installation (#2849) * docs: Refactor ebpf installation * docs: Refactor ebpf installation * Remove not useful sections. * review feedbac * remove absolute link to grafana.com * lint * review feedback * Add diagram for ebpf * linted * Update docs/sources/configure-client/grafana-agent/ebpf/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/configuration/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/configuration/_index.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-docker.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-docker.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-kubernetes.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-kubernetes.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-linux.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-linux.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-linux.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/troubleshooting.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/troubleshooting.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/troubleshooting.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/troubleshooting.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-linux.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-linux.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> * Update docs/sources/configure-client/grafana-agent/ebpf/setup-kubernetes.md Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> --------- Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> Co-authored-by: Ryan Perry <Rperry2174@gmail.com> * docs: language SDK page updates (#2851) * docs changes * improvements * wip * fixes * fixes * fixes * Update docs/sources/configure-client/language-sdks/go_push.md * Update docs/sources/configure-client/language-sdks/go_push.md * Apply suggestions from code review * Update Before you begin sections --------- Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com> Co-authored-by: Kim Nylander <kim.nylander@grafana.com> * doc: Add sampling diagram (#2861) --------- Co-authored-by: Tolya Korniltsev <korniltsev.anatoly@gmail.com> Co-authored-by: Ryan Perry <Rperry2174@gmail.com> Co-authored-by: Bryan Huhta <32787160+bryanhuhta@users.noreply.github.com> Co-authored-by: Cyril Tovena <cyril.tovena@gmail.com> Co-authored-by: Dmitry Filimonov <dmitry.filimonov@grafana.com>
closes #2767
Adds documentation on how to sample scrape targets using the Grafana Agent. This is applicable for eBPF profiling as well as the typical Pyroscope pull mode profiling.