This repository has been archived by the owner on Oct 22, 2020. It is now read-only.
forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.toml
221 lines (195 loc) · 5.9 KB
/
testing.toml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
[testing.tests]
type = "[table]"
common = true
null = false
description = "A table that defines a unit test."
[testing.tests.options.name]
type = "string"
examples = ["foo test"]
common = true
null = false
description = "A unique identifier for this test."
[testing.tests.options.input]
type = "table"
common = true
null = false
description = "A table that defines a unit test input event."
[testing.tests.options.input.options.insert_at]
type = "string"
examples = ["foo"]
common = true
null = false
description = """\
The name of a transform, the input event will be delivered to this transform in \
order to begin the test.\
"""
[testing.tests.options.input.options.type]
type = "string"
examples = ["raw", "log", "metric"]
null = false
common = true
description = "The event type."
[testing.tests.options.input.options.type.enum]
raw = "Creates a log event where the message contents are specified in the field 'value'."
log = "Creates a log event where log fields are specified in the table 'log_fields'."
metric = "Creates a metric event, where its type and fields are specified in the table 'metric'."
[testing.tests.options.input.options.value]
type = "string"
examples = ["some message contents"]
relevant_when = {type = "raw"}
null = true
common = true
description = "Specifies the log message field contents when the input type is 'raw'."
[testing.tests.options.input.options.log_fields]
type = "table"
null = true
common = false
relevant_when = {type = "log"}
description = "Specifies the log fields when the input type is 'log'."
[testing.tests.options.input.options.log_fields.options."`[field-name]`"]
type = "*"
null = false
examples = [
{name = "message", value = "some message contents"},
{name = "host", value = "myhost"},
]
description = """\
A key/value pair representing a field to be added to the input event.\
"""
[testing.tests.options.input.options.metric]
type = "table"
null = true
common = false
relevant_when = {type = "metric"}
description = "Specifies the metric type when the input type is 'metric'."
[testing.tests.options.input.options.metric.options.type]
type = "string"
null = false
examples = ["counter"]
common = true
description = "The metric type."
[testing.tests.options.input.options.metric.options.type.enum]
counter = "A [counter metric type][docs.data-model#counters]."
gauge = "A [gauge metric type][docs.data-model#gauges]."
histogram = "A [histogram metric type][docs.data-model#histograms]."
set = "A [set metric type][docs.data-model#sets]."
[testing.tests.options.input.options.metric.options.name]
type = "string"
examples = ["duration_total"]
null = false
common = true
description = """\
The name of the metric. Defaults to `<field>_total` for `counter` and \
`<field>` for `gauge`.\
"""
[testing.tests.options.input.options.metric.options.tags]
type = "table"
null = true
common = true
description = "Key/value pairs representing [metric tags][docs.data-model#tags]."
[testing.tests.options.input.options.metric.options.tags.options."`[tag-name]`"]
type = "string"
examples = [
{name = "host", value = "foohost"},
{name = "region", value = "us-east-1"},
]
null = false
common = true
description = """\
Key/value pairs representing [metric tags][docs.data-model#tags].\
"""
[testing.tests.options.input.options.metric.options.val]
type = "float"
examples = [10.2]
optional = false
null = false
description = """\
Amount to increment/decrement or gauge.\
"""
[testing.tests.options.input.options.metric.options.timestamp]
type = "string"
examples = ["2019-11-01T21:15:47.443232Z"]
optional = false
null = false
description = """\
Time metric was created/ingested.\
"""
[testing.tests.options.input.options.metric.options.sample_rate]
type = "float"
examples = [1]
null = true
description = """\
The bucket/distribution the metric is a part of.\
"""
[testing.tests.options.input.options.metric.options.direction]
type = "string"
null = true
description = """\
The direction to increase or decrease the gauge value.\
"""
[testing.tests.options.input.options.metric.options.direction.enum]
plus = "Increase the gauge"
minus = "Decrease the gauge"
[testing.tests.options.outputs]
type = "[table]"
common = true
null = false
description = "A table that defines a unit test expected output."
[testing.tests.options.outputs.options.extract_from]
type = "string"
examples = ["bar"]
common = true
null = false
description = """\
The name of a transform, at the end of the test events extracted from this \
transform will be checked against a table of conditions.\
"""
[testing.tests.options.outputs.options.conditions]
type = "[table]"
common = true
null = false
description = """\
A table that defines a collection of conditions to check against the output of a \
transform. A test is considered to have passed when each condition has resolved \
true for one or more events extracted from the target transform.\
"""
[testing.tests.options.outputs.options.conditions.options.type]
type = "string"
null = false
examples = ["check_fields"]
common = true
description = """\
The type of the condition to execute. Currently only the `check_fields` type is \
available.\
"""
[testing.tests.options.outputs.options.conditions.options."`<field_name>`.eq"]
type = "string"
null = true
examples = [
{ name = "message.eq", value = "this is the content to match against" }
]
common = true
description = """\
Check whether a fields contents exactly matches the value specified.\
"""
[testing.tests.options.outputs.options.conditions.options."`<field_name>`.neq"]
type = "string"
null = true
examples = [
{ name = "method.neq", value = "POST" }
]
common = true
description = """\
Check whether a fields contents does not match the value specified.\
"""
[testing.tests.options.outputs.options.conditions.options."`<field_name>`.exists"]
type = "bool"
null = true
examples = [
{ name = "host.exists", value = true }
]
common = true
description = """\
Check whether a field exists or does not exist, depending on the provided value\
being `true` or `false` respectively.\
"""