You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
3 months ago | |
|---|---|---|
| .github | 3 months ago | |
| docs | 1 year ago | |
| src | 1 year ago | |
| test | 1 year ago | |
| .git-blame-ignore-revs | 1 year ago | |
| .gitignore | 2 years ago | |
| .pre-commit-config.yaml | 9 months ago | |
| CHANGELOG.md | 1 year ago | |
| LICENSE | 9 months ago | |
| Project.toml | 1 year ago | |
| README.md | 12 months ago | |
README.md
Prometheus.jl - Prometheus client for Julia
Prometheus.jl is a Julia client for Prometheus.
Quickstart
-
Install Prometheus.jl and HTTP.jl using the package manager:
pkg> add Prometheus HTTP -
Paste the following code into a Julia REPL.
# Load the packages using Prometheus, HTTP # Create a Counter metric const request_counter = Prometheus.Counter("request_count", "Number of handled requests") # Start a HTTP server on localhost port 8000 to server the metrics server = HTTP.listen!(8000) do http Prometheus.inc(request_counter) # Increment the request counter return Prometheus.expose(http) # Expose the metrics end -
Visit http://localhost:8000 in your browser. You will see something like the following
# HELP gc_alloc_bytes_total Total number of allocated bytes # TYPE gc_alloc_bytes_total counter gc_alloc_bytes_total 365578814 [...] # HELP request_count Number of handled requests # TYPE request_count counter request_count 1The output contains some default metrics related to the running process, as well as the request counter that we added ourselves. Every time you refresh, the counter will increment its value.
close(server)will shutdown the server.
Visit the documentation for much more details!