{"id":4781,"date":"2020-11-10T13:08:12","date_gmt":"2020-11-10T07:38:12","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/?p=4781"},"modified":"2025-11-24T15:56:39","modified_gmt":"2025-11-24T10:26:39","slug":"monitoring-druid-with-prometheus","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2020\/11\/10\/monitoring-druid-with-prometheus\/","title":{"rendered":"Monitoring Druid with Prometheus"},"content":{"rendered":"\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/github.com\/opstree\/druid-exporter\/raw\/master\/static\/druid-exporter-logo.svg\" alt=\"\" width=\"182\" height=\"182\" \/>\r\n<figcaption>Druid Exporter &#8211; A Prometheus agent for Druid Database<\/figcaption>\r\n<\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>A while back we got the requirement for working on Apache Druid. By working on Apache Druid, We mean setup, management, and monitoring. Since it was a new topic for us we started evaluating it and we actually find it has a lot of amazing features.<\/p>\r\n\r\n\r\n\r\n<p>So for the people who don&#8217;t have an idea about Druid and just starting with Druid. Let me give a quick walk-through of it.<\/p>\r\n<p><!--more--><\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>Druid is a columnar database that has high throughput for queries and insertions. It has a really good performance for aggregated operations just like a TSDB database. In addition, it is highly scalable as well which can easily be scaled by adding nodes in the cluster.<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>So when we started the activity for setting up Druid, we didn&#8217;t face any difficulties because the official documentation for setup is pretty clear. When we get to the monitoring part, we started searching for the solution which can fit in our requirement but we didn&#8217;t find any solution. The reason was that we wanted to monitor Druid either with Prometheus or Elasticsearch because these were the existing tools getting used for monitoring and we don&#8217;t want to add any special monitoring tool for Druid only.<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<h2 class=\"wp-block-heading\">The Druid Exporter<\/h2>\r\n<p>\r\n\r\n<\/p>\r\n<p>Since we were using the Prometheus for a long time and have an in-depth understanding of it, so we decided to write our own custom exporter i.e. &#8220;Druid Exporter&#8221;.<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>https:\/\/github.com\/opstree\/druid-exporter<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>Druid exporter is a Golang based exporter which captures Druid&#8217;s API metrics as well as JSON emitted metrics and then converts them into the Prometheus time-series format. Some of the key highlighting metrics are:-<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<ul>\r\n<li>Druid&#8217;s health metrics<\/li>\r\n<li>Druid&#8217;s datasource metrics<\/li>\r\n<li>Druid&#8217;s segment metrics<\/li>\r\n<li>Druid&#8217;s supervisor metrics<\/li>\r\n<li>Druid&#8217;s tasks metrics<\/li>\r\n<li>Druid&#8217;s components metrics like- broker, historical, ingestion(kafka), coordinator, sys<\/li>\r\n<li>Druid&#8217;s JVM metrics<\/li>\r\n<\/ul>\r\n<p>\r\n\r\n<\/p>\r\n<p>Once we have seen this project is matured enough to get contributed to the open-source society. We made it opensource and contributed it to the Prometheus community as well. It can be seen listed under the Prometheus site here:-<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>https:\/\/prometheus.io\/docs\/instrumenting\/exporters\/<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"534\" height=\"243\" class=\"wp-image-4794\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2020\/11\/image.png?w=534\" alt=\"\" \/><\/figure>\r\n<\/div>\r\n<p>\r\n\r\n<\/p>\r\n<h2 class=\"wp-block-heading\">Installation\/Configuration<\/h2>\r\n<p>\r\n\r\n<\/p>\r\n<p>There are some changes needed in the druid cluster to exploit the full capabilities of druid exporter. Druid emits the metrics to different emitters. So, in the druid database, we must allow the HTTP emitter.<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>If you are using the druid properties file you must add this entry to the file\u00a0<code>common.properties<\/code>:-<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<pre class=\"wp-block-syntaxhighlighter-code\">druid.emitter.http.recipientBaseUrl=http:\/\/&lt;druid_exporter_url&gt;:&lt;druid_exporter_port&gt;\/druid\r\ndruid.emitter=http<\/pre>\r\n<p>\r\n\r\n<\/p>\r\n<p>In case configuration of a druid are managed by environment variables:-<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<pre class=\"wp-block-syntaxhighlighter-code\">export druid_emitter_http_recipientBaseUrl=http:\/\/&lt;druid_exporter_url&gt;:&lt;druid_exporter_port&gt;\/druid\r\nexport druid_emitter=http<\/pre>\r\n<p>\r\n\r\n<\/p>\r\n<p>Druid exporter can be download from\u00a0<a href=\"https:\/\/github.com\/opstree\/druid-exporter\/releases\" target=\"_blank\" rel=\"noopener\">release<\/a><\/p>\r\n<p>\r\n\r\n<\/p>\r\n<pre class=\"wp-block-syntaxhighlighter-code\"># Export the Druid Coordinator or Router URL\r\nexport DRUID_URL=\"http:\/\/druid.opstreelabs.in\"\r\nexport PORT=\"8080\"\r\n\r\n.\/druid-exporter [&lt;flags&gt;]<\/pre>\r\n<p>\r\n\r\n<\/p>\r\n<p>Druid exporter can also be installed inside the Kubernetes cluster using the helm chart.<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<pre class=\"wp-block-syntaxhighlighter-code\">helm show values prometheus-community\/prometheus-druid-exporter\r\nhelm install [RELEASE_NAME] prometheus-community\/prometheus-druid-exporter<\/pre>\r\n<p>\r\n\r\n<\/p>\r\n<p>And finally, a <strong>Grafana <\/strong>Dashboard can be found here<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>https:\/\/grafana.com\/grafana\/dashboards\/12155<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/github.com\/opstree\/druid-exporter\/raw\/master\/static\/dashboard1.png\" alt=\"\" width=\"533\" height=\"283\" \/><\/figure>\r\n<p>\r\n\r\n<\/p>\r\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\r\n<p>\r\n\r\n<\/p>\r\n<p>Druid Exporter development and release can be tracked here<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>https:\/\/github.com\/opstree\/druid-exporter\/releases<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>If you guys like you can contribute to Druid Exporter by opening Pull Requests and issues. And if you some input you can tell us in the comment section as well.<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>Thanks for reading, I\u2019d really appreciate any and all feedback, please leave your comment below if you guys have any feedback.<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>Cheers Till the Next time!!!<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p>Opstree is an End to End DevOps solution provider<\/p>\r\n<p>\r\n\r\n<\/p>\r\n<p><a href=\"https:\/\/www.opstree.com\/contact-us\" target=\"_blank\" rel=\"noreferrer noopener\">CONTACT US<\/a><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>A while back we got the requirement for working on Apache Druid. By working on Apache Druid, We mean setup, management, and monitoring. Since it was a new topic for us we started evaluating it and we actually find it has a lot of amazing features. So for the people who don&#8217;t have an idea &hellip; <a href=\"https:\/\/opstree.com\/blog\/2020\/11\/10\/monitoring-druid-with-prometheus\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Monitoring Druid with Prometheus&#8221;<\/span><\/a><\/p>\n","protected":false},"author":89038429,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474],"tags":[475,768739308,553057,723407,768739293,768739287],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-1f7","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/4781"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/89038429"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=4781"}],"version-history":[{"count":23,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/4781\/revisions"}],"predecessor-version":[{"id":4905,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/4781\/revisions\/4905"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=4781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=4781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=4781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}