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
Tempo: Encode IDs as hexadecimal when downloading traces #66001
Tempo: Encode IDs as hexadecimal when downloading traces #66001
Conversation
You have successfully added a new CodeQL configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the contribution @kousikmitra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's actually a couple of issues, sorry!
Apart from my comment you also need to fix this test:
FAIL public/app/plugins/datasource/tempo/datasource.test.ts (22.543 s)
● Tempo data source › should handle json file upload
expect(received).toBe(expected) // Object.is equality
Expected: "60ba2abb44f13eae"
Received: "RPE+rg=="
197 | expect(field.name).toBe('traceID');
198 | expect(field.type).toBe(FieldType.string);
> 199 | expect(field.values.get(0)).toBe('60ba2abb44f13eae');
| ^
200 | expect(field.values.length).toBe(6);
201 | });
202 |
at public/app/plugins/datasource/tempo/datasource.test.ts:199:33
traceID: transformBase64IDToHexString(span.traceId), | ||
spanID: transformBase64IDToHexString(span.spanId), | ||
parentSpanID: transformBase64IDToHexString(span.parentSpanId || ''), | ||
traceID: span.traceId.length > 16 ? span.traceId.slice(16) : span.traceID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo here, it should be span.traceId
.
traceID: span.traceId.length > 16 ? span.traceId.slice(16) : span.traceID, | |
traceID: span.traceId.length > 16 ? span.traceId.slice(16) : span.traceId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad, fixed.
Updated the mock json data. After this change the expectation for importing tempo trace from json is, the json data should have traceID, spanID and parentSpanId all in hex format instead of base64. |
65d1dc9
to
04fa02c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes, approved!
* Remove converting tempo trace id to base64 * fix typo * Update id format to hex for tempo json mock
What is this feature?
While downloading traces as json the ids are getting converted to base64. This change will remove the conversion and export ids in hex format instead. So that encoding remain consistent across.
Why do we need this feature?
[Add a description of the problem the feature is trying to solve.]
Who is this feature for?
[Add information on what kind of user the feature is for.]
Which issue(s) does this PR fix?:
Fixes #63003
Special notes for your reviewer:
Please check that: