Skip to content

Commit

Permalink
Add the druid artifact version to metrics when emitted
Browse files Browse the repository at this point in the history
  • Loading branch information
drcrallen committed Nov 12, 2015
1 parent 4f46d45 commit af34e9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions processing/src/main/java/io/druid/query/DruidMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Function;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.metamx.emitter.service.ServiceMetricEvent;
Expand All @@ -37,6 +38,7 @@ public class DruidMetrics
public final static String INTERVAL = "interval";
public final static String ID = "id";
public final static String STATUS = "status";
public final static String VERSION = "version";

// task metrics
public final static String TASK_TYPE = "taskType";
Expand All @@ -59,6 +61,7 @@ public static int findNumComplexAggs(List<AggregatorFactory> aggs)
public static <T> ServiceMetricEvent.Builder makePartialQueryTimeMetric(Query<T> query)
{
return new ServiceMetricEvent.Builder()
.setDimension(VERSION, Strings.nullToEmpty(DruidMetrics.class.getPackage().getImplementationVersion()))
.setDimension(DATASOURCE, DataSourceUtil.getMetricName(query.getDataSource()))
.setDimension(TYPE, query.getType())
.setDimension(
Expand Down

0 comments on commit af34e9c

Please sign in to comment.