testData.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. import { ArrayVector } from '@grafana/data';
  2. import { ZipkinSpan } from '../types';
  3. export const zipkinResponse: ZipkinSpan[] = [
  4. {
  5. traceId: 'trace_id',
  6. name: 'span 1',
  7. id: 'span 1 id',
  8. timestamp: 1,
  9. duration: 10,
  10. localEndpoint: {
  11. serviceName: 'service 1',
  12. ipv4: '1.0.0.1',
  13. port: 42,
  14. },
  15. annotations: [
  16. {
  17. timestamp: 2,
  18. value: 'annotation text',
  19. },
  20. {
  21. timestamp: 6,
  22. value: 'annotation text 3',
  23. },
  24. ],
  25. tags: {
  26. tag1: 'val1',
  27. tag2: 'val2',
  28. },
  29. kind: 'CLIENT',
  30. },
  31. {
  32. traceId: 'trace_id',
  33. parentId: 'span 1 id',
  34. name: 'span 2',
  35. id: 'span 2 id',
  36. timestamp: 4,
  37. duration: 5,
  38. localEndpoint: {
  39. serviceName: 'service 2',
  40. ipv4: '1.0.0.1',
  41. },
  42. tags: {
  43. error: '404',
  44. },
  45. },
  46. {
  47. traceId: 'trace_id',
  48. parentId: 'span 1 id',
  49. name: 'span 3',
  50. id: 'span 3 id',
  51. timestamp: 6,
  52. duration: 7,
  53. remoteEndpoint: {
  54. serviceName: 'spanstore-jdbc',
  55. ipv6: '127.0.0.1',
  56. },
  57. },
  58. ];
  59. export const traceFrameFields = [
  60. { name: 'traceID', values: ['trace_id', 'trace_id', 'trace_id'] },
  61. { name: 'spanID', values: ['span 1 id', 'span 2 id', 'span 3 id'] },
  62. { name: 'parentSpanID', values: [undefined, 'span 1 id', 'span 1 id'] },
  63. { name: 'operationName', values: ['span 1', 'span 2', 'span 3'] },
  64. { name: 'serviceName', values: ['service 1', 'service 2', 'spanstore-jdbc'] },
  65. {
  66. name: 'serviceTags',
  67. values: [
  68. [
  69. { key: 'ipv4', value: '1.0.0.1' },
  70. { key: 'port', value: 42 },
  71. { key: 'endpointType', value: 'local' },
  72. ],
  73. [
  74. { key: 'ipv4', value: '1.0.0.1' },
  75. { key: 'endpointType', value: 'local' },
  76. ],
  77. [
  78. { key: 'ipv6', value: '127.0.0.1' },
  79. { key: 'endpointType', value: 'remote' },
  80. ],
  81. ],
  82. },
  83. { name: 'startTime', values: [0.001, 0.004, 0.006] },
  84. { name: 'duration', values: [0.01, 0.005, 0.007] },
  85. {
  86. name: 'logs',
  87. values: [
  88. [
  89. {
  90. timestamp: 2,
  91. fields: [
  92. {
  93. key: 'annotation',
  94. value: 'annotation text',
  95. },
  96. ],
  97. },
  98. {
  99. timestamp: 6,
  100. fields: [
  101. {
  102. key: 'annotation',
  103. value: 'annotation text 3',
  104. },
  105. ],
  106. },
  107. ],
  108. [],
  109. [],
  110. ],
  111. },
  112. {
  113. name: 'tags',
  114. values: [
  115. [
  116. { key: 'kind', value: 'CLIENT' },
  117. { key: 'tag1', value: 'val1' },
  118. { key: 'tag2', value: 'val2' },
  119. ],
  120. [
  121. { key: 'error', value: true },
  122. { key: 'errorValue', value: '404' },
  123. ],
  124. [],
  125. ],
  126. },
  127. ].map((f) => ({ ...f, values: new ArrayVector<any>(f.values) }));