package com.yammer.telemetry.service.resources;

import com.yammer.telemetry.service.models.BeanAnnotationData;
import com.yammer.telemetry.tracing.SpanSink;

import javax.validation.Valid;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

@Path("/spans/{traceId}/{spanId}")
public class SpanResource {
    private final SpanSink sink;

    public SpanResource(SpanSink sink) {
        this.sink = sink;
    }

    @POST
    public void logAnnotation(@PathParam("traceId") long traceId,
                              @PathParam("spanId") long spanId,
                              @Valid BeanAnnotationData annotationData) {
        sink.recordAnnotation(traceId, spanId, annotationData);
    }
}

@@ -150,16 +150,73 @@
 panSink;
+%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0A%0Aimport
@@ -384,16 +384,99 @@
 ource %7B%0A
+    private static final Logger LOG = LoggerFactory.getLogger(SpanResource.class);%0A
     priv
@@ -711,24 +711,24 @@
 ong spanId,%0A
-
             
@@ -785,24 +785,139 @@
 tionData) %7B%0A
+        LOG.debug(%22Logging inbound annotation data (traceId=%7B%7D, spanId=%7B%7D): %7B%7D%22, traceId, spanId, annotationData);%0A
         sink

Debug log inbound annotations.