forked from honeycombio/refinery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules_complete.yaml
122 lines (120 loc) · 4.86 KB
/
rules_complete.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# This is a demonstration of Refinery's sampler configuration file with
# all possible fields. It is not intended to be a valid configuration file.
# For more detail on the individual fields, see the documentation in
# rules.md.
# Specify this version of the configuration file format, which is 2.
# This is required.
RulesVersion: 2
# Samplers are configured in the Samplers section. The Samplers section
# contains a mapping of environment names (e.g. "production", "staging", etc.)
# to sampler configurations. The environment name is used to select the
# sampler configuration to use for a given trace. The environment name is
# determined by the API key used to send the trace to Refinery. If the
# apppropriate environment is not found in the Samplers section, the default sampler
# configuration is used.
# Note that for "classic" environments, the environment names are the dataset
# names instead. See Honeycomb's documentation for more information.
Samplers:
# The default sampler is used when no other sampler matches.
# It is required to have a default sampler.
# The name consists of two underscores on either side of the word "default".
__default__:
DeterministicSampler:
SampleRate: 1
# The following are examples of sampler configurations for different
# samplers.
env1:
# Each sampler type has a configuration named after the sampler type.
# For details on the possible sampler configuration values and their meaning,
# please see the documentation.
DynamicSampler:
SampleRate: 2
ClearFrequency: 1m0s
FieldList:
- request.method
- http.target
- response.status_code
UseTraceLength: true
env2:
EMADynamicSampler:
GoalSampleRate: 2
AdjustmentInterval: 15s
Weight: 0.5
AgeOutValue: 0.5
BurstMultiple: 2
BurstDetectionDelay: 3
FieldList:
- request.method
- http.target
- response.status_code
UseTraceLength: true
env3:
DeterministicSampler:
SampleRate: 10
env4:
RulesBasedSampler:
# for fields like status_code where different systems may use
# different datatypes, you can use Datatype to specify the datatype
# to use for comparison. If not specified, Refinery requires exact
# equality of field and value, including the datatypes.
Rules:
- Name: drop healthchecks
Drop: true
Conditions:
- Field: http.route
Operator: =
Value: /health-check
- Name: keep slow 500 errors
SampleRate: 1
Conditions:
- Field: status_code
Operator: =
Value: 500
Datatype: int
- Field: duration_ms
Operator: '>='
Value: 1000
Datatype: float
- Name: dynamically sample 200 responses
Conditions:
- Field: status_code
Operator: =
Value: 200
Datatype: int
Sampler:
# This specifies configuration for a sampler to use when
# this rule matches.
EMADynamicSampler:
GoalSampleRate: 15
FieldList:
- request.method
- request.route
- Name: sample traces originating from the users service
SampleRate: 5
Scope: span
Conditions:
- Field: service.name
Operator: =
Value: users
- Field: trace.parent_id
Operator: =
Value: root
- Name: drop incomplete traces from the buggy service
Drop: true
Conditions:
- Operator: has-root-span
Value: false
- Field: service.name
Operator: =
Value: buggy-service
# This is the default rule (with no conditions) and therefore
# sets the sample rate used if no other rule matches.
- Name: default rule
SampleRate: 10
env5:
# This shows using the EMAThroughput sampler to set a goal throughput,
# using mostly default values.
EMAThroughputSampler:
GoalThroughputPerSec: 100
FieldList:
- request.method