Skip to content

Commit

Permalink
add default metric
Browse files Browse the repository at this point in the history
  • Loading branch information
macielti committed Nov 17, 2024
1 parent 85938cb commit 55aedfd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ of [keepachangelog.com](http://keepachangelog.com/).

## [Unreleased]

## [38.72.71] - 2024-11-16

### Added

- Added `:http-request-in-handle-timing` Prometheus component metric to measure the time spent while handling http
requests.

## [38.71.71] - 2024-11-10

### Removed
Expand Down Expand Up @@ -1074,7 +1081,9 @@ of [keepachangelog.com](http://keepachangelog.com/).

- Add `loose-schema` function.

[Unreleased]: https://github.com/macielti/common-clj/compare/v38.71.71...HEAD
[Unreleased]: https://github.com/macielti/common-clj/compare/v38.72.71...HEAD

[38.72.71]: https://github.com/macielti/common-clj/compare/v38.71.71...v38.72.71

[38.71.71]: https://github.com/macielti/common-clj/compare/v37.71.71...v38.71.71

Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject net.clojars.macielti/common-clj "38.71.71"
(defproject net.clojars.macielti/common-clj "38.72.71"

:description "Just common Clojure code that I use across projects"

Expand Down
3 changes: 2 additions & 1 deletion src/common_clj/integrant_components/prometheus.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
:body "Not Authorized"}))

(def default-metrics
[(prometheus/counter :http-request-response {:labels [:status :service :endpoint]})])
[(prometheus/counter :http-request-response {:labels [:status :service :endpoint]})
(prometheus/histogram :http-request-in-handle-timing {:labels [:service :endpoint]})])

(defmethod ig/init-key ::prometheus
[_ {:keys [metrics]}]
Expand Down

0 comments on commit 55aedfd

Please sign in to comment.