From a03b913a00bb12a3ad4697f47de0cd25efc9564d Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sun, 3 Jul 2022 10:52:45 +0200 Subject: [PATCH] Fix valuetype tests (#165) Add missing valuetype configuration to tests. Signed-off-by: SuperQ --- test/config/good.yml | 2 ++ test/response/good.txt | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/config/good.yml b/test/config/good.yml index 89cccf9..9bde732 100644 --- a/test/config/good.yml +++ b/test/config/good.yml @@ -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 @@ -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 diff --git a/test/response/good.txt b/test/response/good.txt index dc7538f..d9b1ca1 100644 --- a/test/response/good.txt +++ b/test/response/good.txt @@ -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