dwelte / prometheus-clj

Clojure wrappers for the Prometheus java client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prometheus-clj

A Clojure library designed to provide a wrapper to the Prometheus java client.

Installation

Leiningen

prometheus-clj is available from Clojars.

[com.soundcloud/prometheus-clj "1.0.6"]

Usage

Require prometheus core.

(:require [prometheus.core :as prometheus])

Initialise prometheus client for your application's namespace.

(prometheus/init! "application_name")

Wrap your ring handler so the prometheus client can start collecting metrics about your requests.

(prometheus/instrument-handler handler)

Create a compojure route so that the prometheus server can poll your application for metrics.

(GET "/metrics" request (prometheus/metrics request))

License

Copyright 2014 SoundCloud, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Clojure wrappers for the Prometheus java client

License:Apache License 2.0


Languages

Language:Clojure 89.0%Language:Shell 7.1%Language:Makefile 3.8%