-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vasileios Tsaknis <[email protected]>
- Loading branch information
Showing
7 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"counter": 1234, | ||
"timestamp": 1657568506, | ||
"values": [ | ||
{ | ||
"id": " id-A", | ||
"count": 1, | ||
"some_boolean": true, | ||
"state": " ACTIVE" | ||
}, | ||
{ | ||
"id": "id-B", | ||
"count": 2, | ||
"some_boolean": true, | ||
"state": " INACTIVE" | ||
}, | ||
{ | ||
"id": "id-C", | ||
"count": 3, | ||
"some_boolean": false, | ||
"state": " ACTIVE" | ||
} | ||
], | ||
"location": "mars " | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
modules: | ||
default: | ||
metrics: | ||
- 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 | ||
|
||
- name: example_value_trim | ||
type: object | ||
help: Example of sub-level value scrapes from a json | ||
path: '{.values[?(@.state == "ACTIVE")]}' | ||
valuetype: counter | ||
trimvalues: true | ||
labels: | ||
environment: beta # static label | ||
id: '{.id}' # dynamic label | ||
values: | ||
active: 1 # static value | ||
count: '{.count}' # dynamic value | ||
boolean: '{.some_boolean}' | ||
float: '{.float}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# HELP example_global_value Example of a top-level global value scrape in the json | ||
# TYPE example_global_value gauge | ||
example_global_value{environment="beta",location="planet-mars"} 1234 | ||
# HELP example_value_trim_active Example of sub-level value scrapes from a json | ||
# TYPE example_value_trim_active counter | ||
example_value_trim_active{environment="beta",id="id-A"} 1 | ||
example_value_trim_active{environment="beta",id="id-C"} 1 | ||
# HELP example_value_trim_boolean Example of sub-level value scrapes from a json | ||
# TYPE example_value_trim_boolean counter | ||
example_value_trim_boolean{environment="beta",id="id-A"} 1 | ||
example_value_trim_boolean{environment="beta",id="id-C"} 0 | ||
# HELP example_value_trim_count Example of sub-level value scrapes from a json | ||
# TYPE example_value_trim_count counter | ||
example_value_trim_count{environment="beta",id="id-A"} 1 | ||
example_value_trim_count{environment="beta",id="id-C"} 3 | ||
# HELP example_value_count Example of sub-level value scrapes from a json | ||
# TYPE example_value_count counter | ||
example_value_float{environment="beta",id="id-A"} 3.1415 | ||
example_value_float{environment="beta",id="id-C"} 3.14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"counter": 1234, | ||
"values": [ | ||
{ | ||
"id": "id-A", | ||
"count": 1, | ||
"some_boolean": true, | ||
"state": " ACTIVE ", | ||
"float": " 3.1415 " | ||
}, | ||
{ | ||
"id": "id-B", | ||
"count": 2, | ||
"some_boolean": true, | ||
"state": " INACTIVE", | ||
"float": " 3.141 " | ||
}, | ||
{ | ||
"id": "id-C", | ||
"count": 3, | ||
"some_boolean": false, | ||
"state": " ACTIVE", | ||
"float": " 3.14" | ||
} | ||
], | ||
"location": " mars " | ||
} |