Skip to content

Instantly share code, notes, and snippets.

@ivantopo
Last active March 17, 2019 11:17
Show Gist options
  • Save ivantopo/63272fd18c36d29a0ac8624a98a1a6f7 to your computer and use it in GitHub Desktop.
Save ivantopo/63272fd18c36d29a0ac8624a98a1a6f7 to your computer and use it in GitHub Desktop.
Adaptive Sampler Reference Configuration
# An adaptive sampler tries to balance a global throughput goal across all partitions in the current application,
# making a best effort to fulfil the individual goals of each partition.
#
adaptive-sampler {
# The target maximum number of affirmative trace decisions to be taken by the sampler. The sampler will do a best
# effort to balance sampling decisions across all partitions to produce no more than this number of affirmative
# decisions.
throughput = 600
# Partitions allow to configure goals for a particular subset of the application traffic. Partitions are defined
# by two fundamental charactheristics: a selector, which decides what operations make it into a partition; and a
# goals, which describes the expected behavior for the partition.
#
# Besides the default partition, all partitions must have a selector. Selectors provide patterns to be matched
# agasint a span's operation name and tags to decide whether the span's operation belongs to a partition. For
# example, to match all operations named "status" with a particular "http.url" tag we could define a partition
# like this:
#
# status-partition {
# selector {
# operation = "status"
# tags {
# "http.url" = "http://localhost:8080/status"
# }
# }
#
# goals { ... }
# }
#
#
# Goals define the desired throughput to be achieved by the sampler for each partition. There are three
# types of goals that can be configured:
#
# maximum-throughput: Tries to cap the number of sampled traces for this partition to the provided value.
# Using a value of 0 for this goal ensures that a partition is never sampled.
#
# minimum-throughput: Tries to ensure that the partition gets a minimum number of sampled traces.
#
# throughput-percentage: Tries to achieve a percentage of the global throughput goal.
#
#
# Goals can also have an optional group-by policy which allows to configure whether the goals should be applied to
# the entire partition as a whole or to replicate the goal for each unique combination of operation name and/or
# tags. For example, the following apply-by policy makes sure that each unique combination of operation name and
# "http.method" tags have a minimum throughput of 20 samples per minute:
#
# partition-name {
# selector { ... }
# goals {
# minimum-throughput = 20
#
# group-by {
# goal-mode = copy
# operation = yes
# tags = [ "http.method" ]
# }
# }
# }
#
# Group-by policies are optional. When provided, they should at least have two settings:
#
# goal-mode: [copy|split] Decides whether the partition goal should be copied as-is to each group or
# it should be evenly split across all groups in the partition. For example, if we set up
# a minimum throughput goal of 100 in a partition with 20 groups, the split mode will
# cause each group to produce at least 5 sampled traces per minute whereas the copy mode
# will try to produce at least 100 sampled traces per group.
#
# operation: [yes|no] Decides whether to use the operation name to generate groups or not.
#
# tags: Decides which tags should be used to generate groups.
#
partitions {
# Global group on which all operations will fall if they do not match selectors from any other group. The
# default behavior is to provide roughly a minimum of 10 sampled traces per minute per operation.
default {
goals {
minimum-throughput = 10
group-by {
goal-mode = copy
operation = yes
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment