Skip to content

Commit

Permalink
Fix valuetype tests (#165)
Browse files Browse the repository at this point in the history
Add missing valuetype configuration to tests.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ authored Jul 3, 2022
1 parent 73f0106 commit a03b913
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions test/config/good.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ modules:
- name: example_global_value
path: "{ .counter }"
help: Example of a top-level global value scrape in the json
valuetype: gauge
labels:
environment: beta # static label
location: "planet-{.location}" # dynamic label
Expand All @@ -13,6 +14,7 @@ modules:
type: object
help: Example of sub-level value scrapes from a json
path: '{.values[?(@.state == "ACTIVE")]}'
valuetype: counter
labels:
environment: beta # static label
id: '{.id}' # dynamic label
Expand Down
8 changes: 4 additions & 4 deletions test/response/good.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# HELP example_global_value Example of a top-level global value scrape in the json
# TYPE example_global_value untyped
# TYPE example_global_value gauge
example_global_value{environment="beta",location="planet-mars"} 1234
# HELP example_value_active Example of sub-level value scrapes from a json
# TYPE example_value_active untyped
# TYPE example_value_active counter
example_value_active{environment="beta",id="id-A"} 1
example_value_active{environment="beta",id="id-C"} 1
# HELP example_value_boolean Example of sub-level value scrapes from a json
# TYPE example_value_boolean untyped
# TYPE example_value_boolean counter
example_value_boolean{environment="beta",id="id-A"} 1
example_value_boolean{environment="beta",id="id-C"} 0
# HELP example_value_count Example of sub-level value scrapes from a json
# TYPE example_value_count untyped
# TYPE example_value_count counter
example_value_count{environment="beta",id="id-A"} 1
example_value_count{environment="beta",id="id-C"} 3

0 comments on commit a03b913

Please sign in to comment.