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.
Fredrik Ekre 4f420eaad9 Family{C}: add documentation for constructor and related methods. 2 years ago
.github/workflows Initial Documenter docs (#3) 2 years ago
docs Family{C}: add documentation for constructor and related methods. 2 years ago
src Family{C}: add documentation for constructor and related methods. 2 years ago
test Family{C}: use keyword arguments for construction. 2 years ago
.gitignore Initial Documenter docs (#3) 2 years ago
CHANGELOG.md Add ProcessCollector (#2) 2 years ago
LICENSE Add all files 2 years ago
Project.toml Add support for compression 2 years 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!