Skip to content
This repository was archived by the owner on Mar 27, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ public EndSpanFutureReporter(final Span span) {
}

@Override
public void failed(final Throwable cause) throws Exception {
public void failed(final Throwable cause) {
span.putAttribute("error", booleanAttributeValue(true));
Optional.ofNullable(cause.getMessage()).ifPresent(span::addAnnotation);
span.setStatus(Status.INTERNAL);
span.end();
}

@Override
public void resolved(final Object result) throws Exception {
public void resolved(final Object result) {
span.end();
}

@Override
public void cancelled() throws Exception {
public void cancelled() {
span.putAttribute("error", booleanAttributeValue(true));
span.setStatus(Status.CANCELLED);
span.end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.commons.lang3.NotImplementedException;
import org.slf4j.Logger;

@MetricScope
public class LocalMetricManager implements MetricManager {
Expand All @@ -91,7 +90,6 @@ public class LocalMetricManager implements MetricManager {
QueryTrace.identifier(LocalMetricManager.class, "query");
private static final QueryTrace.Identifier FETCH =
QueryTrace.identifier(LocalMetricManager.class, "fetch");
private static final Logger log = org.slf4j.LoggerFactory.getLogger(LocalMetricManager.class);

private final OptionalLimit groupLimit;
private final OptionalLimit seriesLimit;
Expand Down Expand Up @@ -236,7 +234,7 @@ private Transform(
}

@Override
public AsyncFuture<FullQuery> transform(final FindSeries result) throws Exception {
public AsyncFuture<FullQuery> transform(final FindSeries result) {
final Span fetchSpan = tracer.spanBuilderWithExplicitParent(
"localMetricsManager.fetch", parentSpan).startSpan();
final ResultLimits limits;
Expand All @@ -260,8 +258,13 @@ public AsyncFuture<FullQuery> transform(final FindSeries result) throws Exceptio
limits = ResultLimits.of();
}

/* if empty, there are not time series on this shard */
/* if empty, there are no time series on this shard */
if (result.isEmpty()) {

fetchSpan.addAnnotation("There are no time series on this shard");
fetchSpan.putAttribute("resultEmpty", booleanAttributeValue(true));
fetchSpan.end();

return async.resolved(FullQuery.empty(namedWatch.end(), limits));
}

Expand Down