[druid-user] Load Extension druid-stats - Quick Question - Help!

The metric in the server.json is the right spot, although Tranquility needs to be aware of the extension too. Check out “Loading Druid extensions” on https://github.com/druid-io/tranquility/blob/master/docs/configuration.md.

The “estimator” is described a little bit down in the docs you linked, it switches between different variance algorithms.

Thank you. Now that I have added this in the command line:

-Ddruid.extensions.loadList=’[“druid-stats”]’ -Ddruid.extensions.directory=/opt/druid/extensions

The following was returned:

2017-05-12 16:40:40,776 [main] INFO  i.d.initialization.Initialization - Adding local file system extension module [io.druid.query.aggregation.stats.DruidStatsModule] for class [io.druid.initialization.DruidModule]
java.lang.NoClassDefFoundError: io/druid/java/util/common/IAE
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
        at java.lang.Class.getDeclaredFields(Class.java:1916)
        at com.fasterxml.jackson.databind.introspect.AnnotatedClass._findFields(AnnotatedClass.java:689)
        at com.fasterxml.jackson.databind.introspect.AnnotatedClass.resolveFields(AnnotatedClass.java:470)
        at com.fasterxml.jackson.databind.introspect.AnnotatedClass.fields(AnnotatedClass.java:282)
        at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addFields(POJOPropertiesCollector.java:384)
        at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collect(POJOPropertiesCollector.java:237)
        at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.collectProperties(BasicClassIntrospector.java:142)
        at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:81)
        at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:11)
        at com.fasterxml.jackson.databind.DeserializationConfig.introspect(DeserializationConfig.java:550)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:327)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
        at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
        at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:380)
        at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:181)
        at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:99)
        at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:84)
        at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:132)
        at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:151)
        at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:17)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:538)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:344)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1064)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:264)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:124)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:538)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:344)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1064)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:264)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:124)
        at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:2769)
        at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:2700)
        at com.metamx.tranquility.druid.DruidBeams$.makeFireDepartment(DruidBeams.scala:406)
        at com.metamx.tranquility.druid.DruidBeams$.fromConfigInternal(DruidBeams.scala:291)
        at com.metamx.tranquility.druid.DruidBeams$.fromConfig(DruidBeams.scala:199)
        at com.metamx.tranquility.server.http.ServerMain$$anonfun$2.apply(ServerMain.scala:118)
        at com.metamx.tranquility.server.http.ServerMain$$anonfun$2.apply(ServerMain.scala:98)
        at com.metamx.common.scala.collection.package$MapLikeOps$$anonfun$strictMapValues$1.apply(package.scala:143)
        at com.metamx.common.scala.collection.package$MapLikeOps$$anonfun$strictMapValues$1.apply(package.scala:143)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.immutable.Map$Map1.foreach(Map.scala:116)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
        at scala.collection.AbstractTraversable.map(Traversable.scala:104)
        at com.metamx.common.scala.collection.package$MapLikeOps.strictMapValues(package.scala:143)
        at com.metamx.tranquility.server.http.ServerMain$.createServlet(ServerMain.scala:98)
        at com.metamx.tranquility.server.http.ServerMain$.main(ServerMain.scala:77)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.twitter.app.App$$anonfun$nonExitingMain$3.apply(App.scala:168)
        at com.twitter.app.App$$anonfun$nonExitingMain$3.apply(App.scala:167)
        at scala.Option.foreach(Option.scala:257)
        at com.twitter.app.App$class.nonExitingMain(App.scala:167)
        at com.metamx.tranquility.server.http.ServerMain$.nonExitingMain(ServerMain.scala:49)
        at com.twitter.app.App$class.main(App.scala:133)
        at com.metamx.tranquility.server.http.ServerMain$.main(ServerMain.scala:49)
        at com.metamx.tranquility.distribution.DistributionMain$.main(DistributionMain.scala:34)
        at com.metamx.tranquility.distribution.DistributionMain.main(DistributionMain.scala)
Caused by: java.lang.ClassNotFoundException: io.druid.java.util.common.IAE
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 63 more
Exception thrown in main on startup

Tranquility releases usually lag a bit behind Druid – it’s still built with Druid 0.9.2. I think this should work if you use the Druid 0.9.2 version of the extension rather than 0.10.0. You’ll still be able to talk to a Druid 0.10.0 server just fine.

What is the best way to place the correct extension directory in my druid-distribution-0.10.0?

I downloaded the source code at the bottom of this page:

https://github.com/druid-io/druid/releases/tag/druid-0.9.2

but the stats extension directory has a very different construction to what I have in my installation.

Ah, this link is better: http://static.druid.io/artifacts/releases/druid-0.9.2-bin.tar.gz

You’d want to point Tranquility at that version.

Thank you. Tranquility seems to be running as usual now and I pointed to the 0.9.2 extension in my command to run server.json, but why is it unable to send data now?

curl -XPOST -H'Content-Type: application/json' --data-binary @new.json [http://localhost:8200/v1/post/new](http://localhost:8200/v1/post/new)

Returns:

{"result":{"received":3,"sent":0}}

(I have tried the most recent timestamps).

Why is Tranquility unable to send data now?

curl -XPOST -H'Content-Type: application/json' --data-binary @new.json [http://localhost:8200/v1/post/new](http://localhost:8200/v1/post/new)

Returns:

{"result":{"received":3,"sent":0}}

(I have tried the most recent timestamps). And when I add metrics to the server file, it doesn’t aggregate over data that already was loaded either.