This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
example: using prometheus tags in custom metrics (#246)
- Loading branch information
Showing
5 changed files
with
79 additions
and
57 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
|
||
## metrics | ||
|
||
this example creates simple request counter | ||
this example creates simple request counter with prometheus tags. | ||
|
||
``` | ||
wasm log: previous value of proxy_wasm_go.request_counter: 0 | ||
wasm log: incremented | ||
wasm log: previous value of proxy_wasm_go.request_counter: 1 | ||
wasm log: incremented | ||
wasm log: previous value of proxy_wasm_go.request_counter: 2 | ||
wasm log: incremented | ||
wasm log: previous value of proxy_wasm_go.request_counter: 3 | ||
wasm log: incremented | ||
wasm log: previous value of proxy_wasm_go.request_counter: 4 | ||
wasm log: incremented | ||
wasm log: previous value of proxy_wasm_go.request_counter: 5 | ||
wasm log: incremented | ||
``` | ||
$ curl localhost:18000 -v -H "my-custom-header: foo" | ||
``` | ||
$ curl -s 'localhost:8001/stats/prometheus'| grep proxy | ||
# TYPE proxy_wasm_go_request_counter counter | ||
proxy_wasm_go_request_counter{} 5 | ||
# TYPE custom_header_value_counts counter | ||
custom_header_value_counts{value="foo",reporter="wasmgosdk"} 1 | ||
``` |
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