Skip to content

HELP: additional attributes based on HttpServletRequest headers #4224

Answered by iNikem
bgong-mdsol asked this question in Q&A
Discussion options

You must be logged in to vote

Can you try the following code?

public class HttpAttributesHelper {
  ...
  public static void updateSpanAttributes(HttpServletRequest httpRequest) {
    Attributes attributes = getAdditionalSpanAttributes(httpRequest); // Additional Attributes for span 
    if (!attributes.isEmpty()) {
      Span span = Span.current();
      span.setAllAttributes(attributes);
    }
  }
  ...
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bgong-mdsol
Comment options

Answer selected by iNikem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants