Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected rounding of string span tags containing big integers #1750

Closed
sergiimk opened this issue Aug 20, 2019 · 2 comments
Closed

Unexpected rounding of string span tags containing big integers #1750

sergiimk opened this issue Aug 20, 2019 · 2 comments

Comments

@sergiimk
Copy link

Requirement - what kind of business use case are you trying to solve?

We are implementing a custom gRPC-based storage plugin as per this doc.

Problem - what in Jaeger blocks you from solving the requirement?

The data that our plugin puts into Span tags can include big integer IDs (uint64). Since many languages don't deal with large integers in JSON nicely all such IDs are stringified. However even in string form Jaeger tries to interpret these tags as integers which results in rounding issues.

Proposal - what do you suggest to solve the problem or improve the existing situation?

A simplest way to reproduce this issue is to modify in-memory gRPC plugin to return following fake span:

func (r *Reader) GetTrace(ctx context.Context, traceID model.TraceID) (trace *model.Trace, err error) {
	sp, _ := model.SpanIDFromString("123123123")
	return &model.Trace{
		Spans:      []*model.Span{
			&model.Span{
				TraceID: traceID,
				SpanID: sp,
				OperationName: "operation",
				References: []model.SpanRef{},
				Flags: model.Flags(0),
				StartTime: time.Now(),
				Duration: 1 * time.Minute,
				Tags: []model.KeyValue{
					model.KeyValue{Key: "x", VStr: "3205345037701495167", VType: model.ValueType_STRING},
				},
				Logs: []model.Log{},
				ProcessID: "123",
				Process: &model.Process{
					ServiceName: "xxx",
				},
				Warnings: []string{},
			},
		},
		Warnings:   nil,
	}, nil

The key line is:

model.KeyValue{
  Key: "x",
  VStr: "3205345037701495167", 
  VType: model.ValueType_STRING
}

Searching for a span in Jaeger UI shows that this tag has been converted to integer with loss of precision:
wrong

Modifying the value to contain non-numeric characters results in correct string type:
right

Any open questions to address

@yurishkuro
Copy link
Member

I think it has been fixed in jaegertracing/jaeger-ui#436.

Will be available in the next release.

@sergiimk
Copy link
Author

Oh, I didn't think about submodules when testing against master. Can confirm the issue is fixed in latest jaeger-ui.

Thanks a lot for a quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants