blob: a9451aa8fcf49a7d9e465a2d91c407e35b69f4a9 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5125],{15680:(e,t,n)=>{n.d(t,{xA:()=>g,yg:()=>y});var r=n(96540);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var o=r.createContext({}),s=function(e){var t=r.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):d(d({},t),e)),n},g=function(e){var t=s(e.components);return r.createElement(o.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,g=l(e,["components","mdxType","originalType","parentName"]),p=s(n),u=a,y=p["".concat(o,".").concat(u)]||p[u]||m[u]||i;return n?r.createElement(y,d(d({ref:t},g),{},{components:n})):r.createElement(y,d({ref:t},g))}));function y(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,d=new Array(i);d[0]=u;var l={};for(var o in t)hasOwnProperty.call(t,o)&&(l[o]=t[o]);l.originalType=e,l[p]="string"==typeof e?e:a,d[1]=l;for(var s=2;s<i;s++)d[s]=n[s];return r.createElement.apply(null,d)}return r.createElement.apply(null,n)}u.displayName="MDXCreateElement"},43938:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>g,contentTitle:()=>o,default:()=>y,frontMatter:()=>l,metadata:()=>s,toc:()=>p});var r=n(58168),a=n(98587),i=(n(96540),n(15680)),d=["components"],l={id:"statsd",title:"StatsD Emitter"},o=void 0,s={unversionedId:"development/extensions-contrib/statsd",id:"development/extensions-contrib/statsd",title:"StatsD Emitter",description:"\x3c!--",source:"@site/docs/29.0.0/development/extensions-contrib/statsd.md",sourceDirName:"development/extensions-contrib",slug:"/development/extensions-contrib/statsd",permalink:"/docs/29.0.0/development/extensions-contrib/statsd",draft:!1,tags:[],version:"current",frontMatter:{id:"statsd",title:"StatsD Emitter"}},g={},p=[{value:"Introduction",id:"introduction",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Druid to StatsD Event Converter",id:"druid-to-statsd-event-converter",level:3}],m={toc:p},u="wrapper";function y(e){var t=e.components,n=(0,a.A)(e,d);return(0,i.yg)(u,(0,r.A)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,i.yg)("p",null,"To use this Apache Druid extension, ",(0,i.yg)("a",{parentName:"p",href:"/docs/29.0.0/configuration/extensions#loading-extensions"},"include")," ",(0,i.yg)("inlineCode",{parentName:"p"},"statsd-emitter")," in the extensions load list."),(0,i.yg)("h2",{id:"introduction"},"Introduction"),(0,i.yg)("p",null,"This extension emits druid metrics to a StatsD server.\n(",(0,i.yg)("a",{parentName:"p",href:"https://github.com/etsy/statsd"},"https://github.com/etsy/statsd"),")\n(",(0,i.yg)("a",{parentName:"p",href:"https://github.com/armon/statsite"},"https://github.com/armon/statsite"),")"),(0,i.yg)("h2",{id:"configuration"},"Configuration"),(0,i.yg)("p",null,"All the configuration parameters for the StatsD emitter are under ",(0,i.yg)("inlineCode",{parentName:"p"},"druid.emitter.statsd"),"."),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"property"),(0,i.yg)("th",{parentName:"tr",align:null},"description"),(0,i.yg)("th",{parentName:"tr",align:null},"required?"),(0,i.yg)("th",{parentName:"tr",align:null},"default"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.hostname")),(0,i.yg)("td",{parentName:"tr",align:null},"The hostname of the StatsD server."),(0,i.yg)("td",{parentName:"tr",align:null},"yes"),(0,i.yg)("td",{parentName:"tr",align:null},"none")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.port")),(0,i.yg)("td",{parentName:"tr",align:null},"The port of the StatsD server."),(0,i.yg)("td",{parentName:"tr",align:null},"yes"),(0,i.yg)("td",{parentName:"tr",align:null},"none")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.prefix")),(0,i.yg)("td",{parentName:"tr",align:null},"Optional metric name prefix."),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},'""')),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.separator")),(0,i.yg)("td",{parentName:"tr",align:null},"Metric name separator"),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},".")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.includeHost")),(0,i.yg)("td",{parentName:"tr",align:null},"Flag to include the hostname as part of the metric name."),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},"false")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dimensionMapPath")),(0,i.yg)("td",{parentName:"tr",align:null},"JSON file defining the StatsD type, and desired dimensions for every Druid metric"),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},"Default mapping provided. See below.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.blankHolder")),(0,i.yg)("td",{parentName:"tr",align:null},"The blank character replacement as StatsD does not support path with blank character"),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},'"-"')),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsd")),(0,i.yg)("td",{parentName:"tr",align:null},"Flag to enable ",(0,i.yg)("a",{parentName:"td",href:"https://docs.datadoghq.com/developers/dogstatsd/"},"DogStatsD")," support. Causes dimensions to be included as tags, not as a part of the metric name. ",(0,i.yg)("inlineCode",{parentName:"td"},"convertRange")," fields will be ignored."),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},"false")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsdConstantTags")),(0,i.yg)("td",{parentName:"tr",align:null},"If ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsd")," is true, the tags in the JSON list of strings will be sent with every event."),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},"[]")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsdServiceAsTag")),(0,i.yg)("td",{parentName:"tr",align:null},"If ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsd")," and ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsdServiceAsTag")," are true, druid service (e.g. ",(0,i.yg)("inlineCode",{parentName:"td"},"druid/broker"),", ",(0,i.yg)("inlineCode",{parentName:"td"},"druid/coordinator"),", etc) is reported as a tag (e.g. ",(0,i.yg)("inlineCode",{parentName:"td"},"druid_service:druid/broker"),") instead of being included in metric name (e.g. ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.broker.query.time"),") and ",(0,i.yg)("inlineCode",{parentName:"td"},"druid")," is used as metric prefix (e.g. ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.query.time"),")."),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},"false")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsdEvents")),(0,i.yg)("td",{parentName:"tr",align:null},"If ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsd")," and ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.emitter.statsd.dogstatsdEvents")," are true, ",(0,i.yg)("a",{parentName:"td",href:"/docs/29.0.0/operations/alerts"},"Alert events")," are reported to DogStatsD."),(0,i.yg)("td",{parentName:"tr",align:null},"no"),(0,i.yg)("td",{parentName:"tr",align:null},"false")))),(0,i.yg)("h3",{id:"druid-to-statsd-event-converter"},"Druid to StatsD Event Converter"),(0,i.yg)("p",null,"Each metric sent to StatsD must specify a type, one of ",(0,i.yg)("inlineCode",{parentName:"p"},"[timer, counter, guage]"),'. StatsD Emitter expects this mapping to\nbe provided as a JSON file. Additionally, this mapping specifies which dimensions should be included for each metric.\nStatsD expects that metric values be integers. Druid emits some metrics with values between the range 0 and 1. To accommodate these metrics they are converted\ninto the range 0 to 100. This conversion can be enabled by setting the optional "convertRange" field true in the JSON mapping file.\nIf the user does not specify their own JSON file, a default mapping is used. All\nmetrics are expected to be mapped. Metrics which are not mapped will log an error.\nStatsD metric path is organized using the following schema:\n',(0,i.yg)("inlineCode",{parentName:"p"},'<druid metric name> : { "dimensions" : <dimension list>, "type" : <StatsD type>, "convertRange" : true/false}'),"\ne.g.\n",(0,i.yg)("inlineCode",{parentName:"p"},'query/time" : { "dimensions" : ["dataSource", "type"], "type" : "timer"}')),(0,i.yg)("p",null,"For metrics which are emitted from multiple services with different dimensions, the metric name is prefixed with\nthe service name.\ne.g.\n",(0,i.yg)("inlineCode",{parentName:"p"},'"druid/coordinator-segment/count" : { "dimensions" : ["dataSource"], "type" : "gauge" },\n "druid/historical-segment/count" : { "dimensions" : ["dataSource", "tier", "priority"], "type" : "gauge" }')),(0,i.yg)("p",null,"For most use-cases, the default mapping is sufficient."))}y.isMDXComponent=!0}}]);