Skip to content

Commit

Permalink
add finish to detectormanager span (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinilatgit authored Jul 6, 2020
1 parent 21a7742 commit b19b2e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,14 @@ private void detectorManagerExtractAndInjectSpan(ConsumerRecord<String, MappedMe
}
// TODO
// If there is a way to add custom tags without creating span that should be used
// Span is being created only to add tags to the complete trace managed by library.
else {
detectorManagerSpan = GlobalTracer.get().buildSpan("detector-manager").
withTag("metric", metricRecord.key()).start();
}
detectorManagerSpan.setTag("detectorUUID", anomalyRecord.key());
TracingKafkaUtils.inject(detectorManagerSpan.context(), anomalyRecord.headers(), GlobalTracer.get());
detectorManagerSpan.finish();
}

}
2 changes: 2 additions & 0 deletions kafka/src/main/resources/config/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ ad-manager {
throttle-gate-likelihood = 0.05
graphite-data-retrieval-key = "data-retrieval-key"
tracing {
# tracingStatus is a required parameter. It can be set to disabled/other value
# than enabled to not include tracing for the module.
tracingStatus = "enabled"
apiKey = "acdefghijklmnopqrstuvwxyz"
clientId = "ad-manager"
Expand Down
2 changes: 2 additions & 0 deletions kafka/src/test/resources/detector-manager.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ graphite-data-retrieval-key = "data-retrieval-key"
throttle-gate-likelihood = 0.05

tracing {
# tracingStatus is a required parameter. It can be set to disabled/other value
# than enabled to not include tracing.
tracingStatus = "enabled"
apiKey = "acdefghijklmnopqrstuvwxyz"
clientId = "ad-manager"
Expand Down

0 comments on commit b19b2e4

Please sign in to comment.