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.
dependabot[bot] be4b42ff86
Merge dde023060f into a6376591b4
5 days ago
.github Bump actions/checkout from 5 to 6 5 days ago
docs Set version to 1.4.1 1 year ago
src Upgrade Runic to version 1.2. 1 year ago
test Add "_bucket" suffix to histogram samples, closes #21 1 year ago
.git-blame-ignore-revs Add formatting commit to blame ignore 1 year ago
.gitignore Initial Documenter docs (#3) 2 years ago
.pre-commit-config.yaml Add pre-commit hooks 9 months ago
CHANGELOG.md Set version to 1.4.1 1 year ago
LICENSE Add pre-commit hooks 9 months ago
Project.toml Set version to 1.4.1 1 year ago
README.md Update README links 12 months ago

README.md

Prometheus.jl - Prometheus client for Julia

Documentation CI Codecov code style: runic

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!