New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output plugin for timescaleDB #966
Comments
You could send your events to RabbitMQ (or Kafka), pull them out via programming language of choice, process and then put into TimescaleDB. |
I haven't used TimescaleDB and I'm not sure if TimescaleDB has fixed schema, but from this [1] it looks like the schema is designed ad-hoc. I think this might work, assuming you have time, host, service and metric colums (can be adjusted down below). (add-dependencies
:coordinates [[org.clojure/java.jdbc "0.7.12"]]
:repositories {"clojars" "https://clojars.org/repo"})
(require '[clojure.java.jdbc :as j])
(defn timescaledb [db-spec table]
(fn [events]
(doseq [event events]
(j/insert! db-spec table
;; adjust columns if necessary
{:host (:host event)
:service (:service event)
:metric (:metric event)
:time (:time event)}))))
(def timescale
(timescaledb {:dbtype "postgresql"
:dbname "mydatabase"}
"mytable"))
(streams
timescale) [1] https://docs.timescale.com/timescaledb/latest/quick-start/java/#insert_rows |
Hi,
We are looking at sending alerts generated by riemann to timescaleDB(an extension to postgresDB). We don't see any plugin available already. Is there any plan of implementing one in near future? If not, what would be the best way to send the data to any database for which a plugin is not available? We don't have any expertise on clojure. so writing a clojure plugin would be the last option for us. Appreciate any other pointers/suggestions.
Thanks in advance.
The text was updated successfully, but these errors were encountered: