1

Using @continueSpan does not add log values in spring sleuth. I am using @continueSpan annotation but could not find a way to add log value for span in it. any references will help.

@ContinueSpan(log = "submitStream")
  public IngestionResponse submitStream(final InputStream inputStream,
      @SpanTag("ProducerName") @PathVariable String producerName,
      @SpanTag("HttpHeaders") @RequestHeader HttpHeaders httpHeaders) {
    LOGGER.info("[Upload to Stream]: Begin");
    final IngestionResponse ingestionResponse = ingestionService
        .ingestInputStream(inputStream, producerName, httpHeaders);
    String str = null;
    System.out.println(str.length());
    LOGGER.info("[Upload to Stream]: Completed");
    return ingestionResponse;
  }

enter image description here

Catarina Ferreira
  • 1,824
  • 5
  • 17
  • 26
viren
  • 1,073
  • 1
  • 17
  • 41

1 Answers1

0

Try one of the two things: - Create a new class with an annotated method, register its instance as bean and delegate calls to it at the beginning and end of the method call - inject as a bean and manually call the SpanCustomizer interface and call annotate on it to annotate a span with a log

Marcin Grzejszczak
  • 10,624
  • 1
  • 16
  • 32
  • First approach looks like aspectJ if i am not mistaken. Second approach i used span.annotate("log"); but it again adds log as key and how to assign it a log value – viren Jul 04 '19 at 07:29
  • Logs don't have values. They have a key and a timestamp. If you want a key value pair you have to use tags – Marcin Grzejszczak Jul 04 '19 at 07:59