Giter Site home page Giter Site logo

Comments (6)

realark avatar realark commented on June 18, 2024 1

@aesy Thank you so much for the fix! This will ship in our 0.17.0 release (estimated to go out next week).

Will close this issue once the release ships.

from dd-trace-java.

tylerbenson avatar tylerbenson commented on June 18, 2024

@aesy Thanks for the report. From your investigation, do you see something that can be changed inside the java tracer to improve the situation besides waiting for better handling in msgpack-java?

from dd-trace-java.

aesy avatar aesy commented on June 18, 2024

The issue is only present when serializing string numbers, like such:

@JsonGetter("trace_id")
@JsonSerialize(using = UInt64IDStringSerializer.class)
public String getTraceId() {
return context.getTraceId();
}
@JsonGetter("span_id")
@JsonSerialize(using = UInt64IDStringSerializer.class)
public String getSpanId() {
return context.getSpanId();
}
@JsonGetter("parent_id")
@JsonSerialize(using = UInt64IDStringSerializer.class)
public String getParentId() {
return context.getParentId();
}

protected static class UInt64IDStringSerializer extends StdSerializer<String> {
public UInt64IDStringSerializer() {
this(null);
}
public UInt64IDStringSerializer(final Class<String> stringClass) {
super(stringClass);
}
@Override
public void serialize(
final String value, final JsonGenerator gen, final SerializerProvider provider)
throws IOException {
gen.writeNumber(value);
}
}

I think this could be circumvented by storing the id's as BigInteger rather than String. Maybe this would result in worse performance, as discussed here, I don't know.

I can make a pull request if you think think this would be a good solution.

from dd-trace-java.

realark avatar realark commented on June 18, 2024

@aesy trace/span identifiers are sometimes logged in performance sensitive areas. We wanted to avoid paying the penalty of conversion for such cases.

Serialization to the agent is less of a concern (only happens once). Do you think we could accomplish the same thing with changes to UInt64IDStringSerializer?

from dd-trace-java.

aesy avatar aesy commented on June 18, 2024

Ah I see.

Yeah, that would work. And there wouldn't need to be any validation since that's already been done at an earlier stage.

from dd-trace-java.

tylerbenson avatar tylerbenson commented on June 18, 2024

Fix is included in 0.17.0.

from dd-trace-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.