Prometheus client for Julia
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.
joewilson c4fb688f8c Add "_bucket" suffix to histogram samples, closes #21 1 year ago
.github Runic formatter (#20) 1 year ago
docs Runic formatter (#20) 1 year ago
src Add "_bucket" suffix to histogram samples, closes #21 1 year ago
test Add "_bucket" suffix to histogram samples, closes #21 1 year ago
.git-blame-ignore-revs Add Runic formatting commit to .git-blame-ignore-revs. 1 year ago
.gitignore Initial Documenter docs (#3) 2 years ago
CHANGELOG.md Mark public API with the public keyword (#19) 1 year ago
LICENSE Add SPDX license identifiers. 2 years ago
Project.toml Mark public API with the public keyword (#19) 1 year ago
README.md Initial Documenter docs (#3) 2 years ago

README.md

Prometheus.jl - Prometheus client for Julia

Documentation Build Status

Prometheus.jl is a Julia client for Prometheus.

Quickstart

  1. Install Prometheus.jl and HTTP.jl using the package manager:

    pkg> add Prometheus HTTP
    
  2. 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
    
  3. 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 1
    

    The 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!