Skip to content

Commit a03b913

Browse files
authored
Fix valuetype tests (#165)
Add missing valuetype configuration to tests. Signed-off-by: SuperQ <[email protected]>
1 parent 73f0106 commit a03b913

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/config/good.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ modules:
55
- name: example_global_value
66
path: "{ .counter }"
77
help: Example of a top-level global value scrape in the json
8+
valuetype: gauge
89
labels:
910
environment: beta # static label
1011
location: "planet-{.location}" # dynamic label
@@ -13,6 +14,7 @@ modules:
1314
type: object
1415
help: Example of sub-level value scrapes from a json
1516
path: '{.values[?(@.state == "ACTIVE")]}'
17+
valuetype: counter
1618
labels:
1719
environment: beta # static label
1820
id: '{.id}' # dynamic label

test/response/good.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# HELP example_global_value Example of a top-level global value scrape in the json
2-
# TYPE example_global_value untyped
2+
# TYPE example_global_value gauge
33
example_global_value{environment="beta",location="planet-mars"} 1234
44
# HELP example_value_active Example of sub-level value scrapes from a json
5-
# TYPE example_value_active untyped
5+
# TYPE example_value_active counter
66
example_value_active{environment="beta",id="id-A"} 1
77
example_value_active{environment="beta",id="id-C"} 1
88
# HELP example_value_boolean Example of sub-level value scrapes from a json
9-
# TYPE example_value_boolean untyped
9+
# TYPE example_value_boolean counter
1010
example_value_boolean{environment="beta",id="id-A"} 1
1111
example_value_boolean{environment="beta",id="id-C"} 0
1212
# HELP example_value_count Example of sub-level value scrapes from a json
13-
# TYPE example_value_count untyped
13+
# TYPE example_value_count counter
1414
example_value_count{environment="beta",id="id-A"} 1
1515
example_value_count{environment="beta",id="id-C"} 3

0 commit comments

Comments
 (0)