|
1 | 1 | /* |
2 | | - * Copyright (c) 2019, 2021 Oracle and/or its affiliates. |
| 2 | + * Copyright (c) 2019, 2022 Oracle and/or its affiliates. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -640,13 +640,34 @@ private void flushIntervalMs(Long aLong) { |
640 | 640 | this.reporterFlushIntervalMillis = aLong; |
641 | 641 | } |
642 | 642 |
|
643 | | - enum SamplerType { |
| 643 | + /** |
| 644 | + * Sampler type definition. |
| 645 | + * Available options are "const", "probabilistic", "ratelimiting" and "remote". |
| 646 | + */ |
| 647 | + public enum SamplerType { |
| 648 | + /** |
| 649 | + * Constant sampler always makes the same decision for all traces. |
| 650 | + * It either samples all traces {@code 1} or none of them {@code 0}. |
| 651 | + */ |
644 | 652 | CONSTANT("const"), |
| 653 | + /** |
| 654 | + * Probabilistic sampler makes a random sampling decision with the |
| 655 | + * probability of sampling equal to the value of the property. |
| 656 | + */ |
645 | 657 | PROBABILISTIC("probabilistic"), |
| 658 | + /** |
| 659 | + * Rate Limiting sampler uses a leaky bucket rate limiter to ensure that |
| 660 | + * traces are sampled with a certain constant rate. |
| 661 | + */ |
646 | 662 | RATE_LIMITING("ratelimiting"), |
| 663 | + /** |
| 664 | + * Remote sampler consults Jaeger agent for the appropriate sampling |
| 665 | + * strategy to use in the current service. |
| 666 | + */ |
647 | 667 | REMOTE("remote"); |
648 | 668 | private final String config; |
649 | 669 |
|
| 670 | + |
650 | 671 | SamplerType(String config) { |
651 | 672 | this.config = config; |
652 | 673 | } |
|
0 commit comments