Datadog stats

This commit is contained in:
Bryce Covert
2022-01-04 11:53:47 -08:00
parent e6229ef5d0
commit 6ca4f0fb60
9 changed files with 160 additions and 146 deletions

View File

@@ -1329,7 +1329,7 @@
(defn query-name [q]
(try
(str/join "," (map name (:operations (p/operations (p/parse-query schema q)))))
(str/join "__" (map name (:operations (p/operations (p/parse-query schema q)))))
(catch Exception e
"unknown query")))
@@ -1337,9 +1337,9 @@
([id q]
(query id q nil))
([id q v]
(statsd/increment "queries")
(statsd/increment (query-name q))
(statsd/time! [(query-name q) {}]
(statsd/increment "query.count")
(statsd/increment (str "query." (query-name q) ".count"))
(statsd/time! [(str "query." (query-name q) ".time") {}]
(lc/with-context {:query q}
(log/info "executing query name" (query-name q))
(try