Skip to content

Commit

Permalink
Merge pull request #1961 from metamx/druidMetricsVersion
Browse files Browse the repository at this point in the history
Add the druid artifact version to metrics when emitted
  • Loading branch information
gianm committed Dec 4, 2015
2 parents 1ca3166 + af34e9c commit 045df54
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 @@ -38,6 +39,7 @@ public class DruidMetrics
public final static String ID = "id";
public final static String TASK_ID = "taskId";
public final static String STATUS = "status";
public final static String VERSION = "version";

// task metrics
public final static String TASK_TYPE = "taskType";
Expand All @@ -60,6 +62,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 045df54

Please sign in to comment.