Skip to content

feat: Support for Boolean and Number type as value in TracingUtils putAnnotation #421

Closed
@dmahapatro

Description

@dmahapatro

Is your feature request related to a problem? Please describe.
I came across a minor feature missing in TracingUtils. XRay SDK supports recording annotations as:

  • Keys – Up to 500 alphanumeric characters. No spaces or symbols except underscores.
  • Values – Up to 1,000 Unicode characters.

With key being a string and value can be a Boolean, Number, or String value.

However, TracingUtils just supports value as String, there is no support for Number, Boolean.

Describe the solution you'd like
Adding support for Number & Boolean like:

public static void putAnnotation(String key, Number value) {
  AWSXRay.getCurrentSubsegmentOptional()
    .ifPresent(segment -> segment.putAnnotation(key, value));
}

Describe alternatives you've considered
This is not a blocker because I can use String.valueOf(myIntValue)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions