Tracing: Add string unit to trace search results to prevent Infinity bug (#48206)

This commit is contained in:
Connor Lindsey 2022-04-26 07:09:40 -06:00 committed by GitHub
parent 8126331f66
commit 4e6c3be7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -71,6 +71,7 @@ export function createTableFrame(data: TraceResponse[], instanceSettings: DataSo
name: 'traceID', name: 'traceID',
type: FieldType.string, type: FieldType.string,
config: { config: {
unit: 'string',
displayNameFromDS: 'Trace ID', displayNameFromDS: 'Trace ID',
links: [ links: [
{ {

View File

@ -102,6 +102,9 @@ describe('createTableFrameFromSearch()', () => {
expect(frame.fields[0].name).toBe('traceID'); expect(frame.fields[0].name).toBe('traceID');
expect(frame.fields[0].values.get(0)).toBe('e641dcac1c3a0565'); expect(frame.fields[0].values.get(0)).toBe('e641dcac1c3a0565');
// TraceID must have unit = 'string' to prevent the ID from rendering as Infinity
expect(frame.fields[0].config.unit).toBe('string');
expect(frame.fields[1].name).toBe('traceName'); expect(frame.fields[1].name).toBe('traceName');
expect(frame.fields[1].values.get(0)).toBe('c10d7ca4e3a00354 '); expect(frame.fields[1].values.get(0)).toBe('c10d7ca4e3a00354 ');

View File

@ -600,6 +600,7 @@ export function createTableFrameFromSearch(data: SearchResponse[], instanceSetti
name: 'traceID', name: 'traceID',
type: FieldType.string, type: FieldType.string,
config: { config: {
unit: 'string',
displayNameFromDS: 'Trace ID', displayNameFromDS: 'Trace ID',
links: [ links: [
{ {