|
|
|
@@ -97,7 +97,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{cluster=\\"cluster1\\", hostname=\\"hostname1\\", service_namespace=\\"namespace1\\"}","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{cluster=\\"cluster1\\", hostname=\\"hostname1\\", service_namespace=\\"namespace1\\"}","refId":"","datasource":{"uid":"loki1_uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -123,7 +123,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{ip=\\"192.168.0.1\\"}","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{ip=\\"192.168.0.1\\"}","refId":"","datasource":{"uid":"loki1_uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -149,7 +149,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{ip=\\"192.168.0.1\\", host=\\"host\\"}","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{ip=\\"192.168.0.1\\", host=\\"host\\"}","refId":"","datasource":{"uid":"loki1_uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -177,7 +177,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"${span.startTime / 1000 - 60000}","to":"${
|
|
|
|
|
span.startTime / 1000 + span.duration / 1000 + 60000
|
|
|
|
|
}"},"datasource":"loki1_uid","queries":[{"expr":"{hostname=\\"hostname1\\"}","refId":""}]}`
|
|
|
|
|
}"},"datasource":"loki1_uid","queries":[{"expr":"{hostname=\\"hostname1\\"}","refId":"","datasource":{"uid":"loki1_uid"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -202,6 +202,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
{
|
|
|
|
|
expr: '{cluster="cluster1", hostname="hostname1", service_namespace="namespace1"} | label_format log_line_contains_trace_id=`{{ contains "7946b05c2e2e4e5a" __line__ }}` | log_line_contains_trace_id="true" or trace_id="7946b05c2e2e4e5a" | label_format log_line_contains_span_id=`{{ contains "6605c7b08e715d6c" __line__ }}` | log_line_contains_span_id="true" or span_id="6605c7b08e715d6c"',
|
|
|
|
|
refId: '',
|
|
|
|
|
datasource: { uid: 'loki1_uid' },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
})
|
|
|
|
@@ -258,7 +259,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{service=\\"serviceName\\", pod=\\"podName\\"}","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{service=\\"serviceName\\", pod=\\"podName\\"}","refId":"","datasource":{"uid":"loki1_uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -288,7 +289,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{service.name=\\"serviceName\\", pod=\\"podName\\"}","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"{service.name=\\"serviceName\\", pod=\\"podName\\"}","refId":"","datasource":{"uid":"loki1_uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -385,7 +386,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"splunkUID","queries":[{"query":"cluster=\\"cluster1\\" hostname=\\"hostname1\\" service_namespace=\\"namespace1\\" \\"7946b05c2e2e4e5a\\" \\"6605c7b08e715d6c\\"","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"splunkUID","queries":[{"query":"cluster=\\"cluster1\\" hostname=\\"hostname1\\" service_namespace=\\"namespace1\\" \\"7946b05c2e2e4e5a\\" \\"6605c7b08e715d6c\\"","refId":"","datasource":{"uid":"splunkUID"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -409,7 +410,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"splunkUID","queries":[{"query":"ip=\\"192.168.0.1\\"","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"splunkUID","queries":[{"query":"ip=\\"192.168.0.1\\"","refId":"","datasource":{"uid":"splunkUID"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -436,7 +437,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"splunkUID","queries":[{"query":"hostname=\\"hostname1\\" ip=\\"192.168.0.1\\"","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"splunkUID","queries":[{"query":"hostname=\\"hostname1\\" ip=\\"192.168.0.1\\"","refId":"","datasource":{"uid":"splunkUID"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -466,7 +467,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"splunkUID","queries":[{"query":"service=\\"serviceName\\" pod=\\"podName\\"","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"splunkUID","queries":[{"query":"service=\\"serviceName\\" pod=\\"podName\\"","refId":"","datasource":{"uid":"splunkUID"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -503,7 +504,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Metrics);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"customQuery","refId":"A"}]}'
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"customQuery","refId":"A","datasource":{"uid":"prom1Uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -552,7 +553,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(namedLink!.title).toBe('Named Query');
|
|
|
|
|
expect(namedLink!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"customQuery","refId":"A"}]}'
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"customQuery","refId":"A","datasource":{"uid":"prom1Uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@@ -562,7 +563,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(defaultLink!.title).toBe('defaultQuery');
|
|
|
|
|
expect(defaultLink!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"histogram_quantile(0.5, sum(rate(traces_spanmetrics_latency_bucket{service=\\"test service\\"}[5m])) by (le))","refId":"A"}]}'
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"histogram_quantile(0.5, sum(rate(traces_spanmetrics_latency_bucket{service=\\"test service\\"}[5m])) by (le))","refId":"A","datasource":{"uid":"prom1Uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@@ -572,7 +573,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(unnamedQuery!.title).toBeUndefined();
|
|
|
|
|
expect(unnamedQuery!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"no_name_here","refId":"A"}]}'
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"no_name_here","refId":"A","datasource":{"uid":"prom1Uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -598,7 +599,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Metrics);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602633600000","to":"1602640801000"},"datasource":"prom1Uid","queries":[{"expr":"customQuery","refId":"A"}]}'
|
|
|
|
|
'{"range":{"from":"1602633600000","to":"1602640801000"},"datasource":"prom1Uid","queries":[{"expr":"customQuery","refId":"A","datasource":{"uid":"prom1Uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -636,7 +637,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(links![0].type).toBe(SpanLinkType.Metrics);
|
|
|
|
|
expect(links![0].href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"metric{job=\\"tns/app\\", pod=\\"sample-pod\\", job=\\"tns/app\\", pod=\\"sample-pod\\"}[5m]","refId":"A"}]}'
|
|
|
|
|
'{"range":{"from":"1602637080000","to":"1602637321000"},"datasource":"prom1Uid","queries":[{"expr":"metric{job=\\"tns/app\\", pod=\\"sample-pod\\", job=\\"tns/app\\", pod=\\"sample-pod\\"}[5m]","refId":"A","datasource":{"uid":"prom1Uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -726,7 +727,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef).toBeDefined();
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(decodeURIComponent(linkDef!.href)).toContain(
|
|
|
|
|
`datasource":"${searchUID}","queries":[{"query":"cluster:\\"cluster1\\" AND hostname:\\"hostname1\\" AND service_namespace:\\"namespace1\\"","refId":"","metrics":[{"id":"1","type":"logs"}]}]`
|
|
|
|
|
`datasource":"${searchUID}","queries":[{"query":"cluster:\\"cluster1\\" AND hostname:\\"hostname1\\" AND service_namespace:\\"namespace1\\"","refId":"","metrics":[{"id":"1","type":"logs"}],"datasource":{"uid":"${searchUID}"}}]`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -765,7 +766,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"\\"6605c7b08e715d6c\\" AND \\"7946b05c2e2e4e5a\\" AND cluster:\\"cluster1\\" AND hostname:\\"hostname1\\" AND service_namespace:\\"namespace1\\"","refId":"","metrics":[{"id":"1","type":"logs"}]}]}`
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"\\"6605c7b08e715d6c\\" AND \\"7946b05c2e2e4e5a\\" AND cluster:\\"cluster1\\" AND hostname:\\"hostname1\\" AND service_namespace:\\"namespace1\\"","refId":"","metrics":[{"id":"1","type":"logs"}],"datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -793,7 +794,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef).toBeDefined();
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(decodeURIComponent(linkDef!.href)).toBe(
|
|
|
|
|
`/explore?left={"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"searchUID","queries":[{"query":"\\"7946b05c2e2e4e5a\\"","refId":"","metrics":[{"id":"1","type":"logs"}]}]}`
|
|
|
|
|
`/explore?left={"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"searchUID","queries":[{"query":"\\"7946b05c2e2e4e5a\\"","refId":"","metrics":[{"id":"1","type":"logs"}],"datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -819,7 +820,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"ip:\\"192.168.0.1\\"","refId":"","metrics":[{"id":"1","type":"logs"}]}]}`
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"ip:\\"192.168.0.1\\"","refId":"","metrics":[{"id":"1","type":"logs"}],"datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -849,7 +850,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"hostname:\\"hostname1\\" AND ip:\\"192.168.0.1\\"","refId":"","metrics":[{"id":"1","type":"logs"}]}]}`
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"hostname:\\"hostname1\\" AND ip:\\"192.168.0.1\\"","refId":"","metrics":[{"id":"1","type":"logs"}],"datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -882,7 +883,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"service:\\"serviceName\\" AND pod:\\"podName\\"","refId":"","metrics":[{"id":"1","type":"logs"}]}]}`
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"service:\\"serviceName\\" AND pod:\\"podName\\"","refId":"","metrics":[{"id":"1","type":"logs"}],"datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -916,7 +917,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef).toBeDefined();
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(decodeURIComponent(linkDef!.href)).toContain(
|
|
|
|
|
`datasource":"${searchUID}","queries":[{"query":"cluster=\\"cluster1\\" AND hostname=\\"hostname1\\" AND service_namespace=\\"namespace1\\"","refId":""}]`
|
|
|
|
|
`datasource":"${searchUID}","queries":[{"query":"cluster=\\"cluster1\\" AND hostname=\\"hostname1\\" AND service_namespace=\\"namespace1\\"","refId":"","datasource":{"uid":"${searchUID}"}}]`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -955,7 +956,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"\\"6605c7b08e715d6c\\" AND \\"7946b05c2e2e4e5a\\" AND cluster=\\"cluster1\\" AND hostname=\\"hostname1\\" AND service_namespace=\\"namespace1\\"","refId":""}]}`
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"\\"6605c7b08e715d6c\\" AND \\"7946b05c2e2e4e5a\\" AND cluster=\\"cluster1\\" AND hostname=\\"hostname1\\" AND service_namespace=\\"namespace1\\"","refId":"","datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -983,7 +984,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef).toBeDefined();
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(decodeURIComponent(linkDef!.href)).toBe(
|
|
|
|
|
`/explore?left={"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"searchUID","queries":[{"query":"\\"7946b05c2e2e4e5a\\"","refId":""}]}`
|
|
|
|
|
`/explore?left={"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"searchUID","queries":[{"query":"\\"7946b05c2e2e4e5a\\"","refId":"","datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -1009,7 +1010,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"ip=\\"192.168.0.1\\"","refId":""}]}`
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"ip=\\"192.168.0.1\\"","refId":"","datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1039,7 +1040,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"hostname=\\"hostname1\\" AND ip=\\"192.168.0.1\\"","refId":""}]}`
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"hostname=\\"hostname1\\" AND ip=\\"192.168.0.1\\"","refId":"","datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1072,7 +1073,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"service=\\"serviceName\\" AND pod=\\"podName\\"","refId":""}]}`
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"${searchUID}","queries":[{"query":"service=\\"serviceName\\" AND pod=\\"podName\\"","refId":"","datasource":{"uid":"${searchUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1117,7 +1118,13 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(decodeURIComponent(linkDef!.href)).toContain(
|
|
|
|
|
'"queries":' +
|
|
|
|
|
JSON.stringify([{ expr: '{service="serviceName", pod="podName"} |="serviceName" |="trace1"', refId: '' }])
|
|
|
|
|
JSON.stringify([
|
|
|
|
|
{
|
|
|
|
|
expr: '{service="serviceName", pod="podName"} |="serviceName" |="trace1"',
|
|
|
|
|
refId: '',
|
|
|
|
|
datasource: { uid: 'loki1_uid' },
|
|
|
|
|
},
|
|
|
|
|
])
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -1179,7 +1186,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"falconLogScaleUID","queries":[{"lsql":"cluster=\\"cluster1\\" OR hostname=\\"hostname1\\" OR service_namespace=\\"namespace1\\" or \\"7946b05c2e2e4e5a\\" or \\"6605c7b08e715d6c\\"","refId":""}]}'
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"falconLogScaleUID","queries":[{"lsql":"cluster=\\"cluster1\\" OR hostname=\\"hostname1\\" OR service_namespace=\\"namespace1\\" or \\"7946b05c2e2e4e5a\\" or \\"6605c7b08e715d6c\\"","refId":"","datasource":{"uid":"${falconLogScaleUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1203,7 +1210,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"falconLogScaleUID","queries":[{"lsql":"ip=\\"192.168.0.1\\"","refId":""}]}'
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"falconLogScaleUID","queries":[{"lsql":"ip=\\"192.168.0.1\\"","refId":"","datasource":{"uid":"${falconLogScaleUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1230,7 +1237,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"falconLogScaleUID","queries":[{"lsql":"hostname=\\"hostname1\\" OR ip=\\"192.168.0.1\\"","refId":""}]}'
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"falconLogScaleUID","queries":[{"lsql":"hostname=\\"hostname1\\" OR ip=\\"192.168.0.1\\"","refId":"","datasource":{"uid":"${falconLogScaleUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1260,7 +1267,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"falconLogScaleUID","queries":[{"lsql":"service=\\"serviceName\\" OR pod=\\"podName\\"","refId":""}]}'
|
|
|
|
|
`{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"falconLogScaleUID","queries":[{"lsql":"service=\\"serviceName\\" OR pod=\\"podName\\"","refId":"","datasource":{"uid":"${falconLogScaleUID}"}}]}`
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1342,7 +1349,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Profiles);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{service_namespace=\\"namespace1\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{service_namespace=\\"namespace1\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":"","datasource":{"uid":"pyroscopeUid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1372,7 +1379,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Profiles);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{ip=\\"192.168.0.1\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{ip=\\"192.168.0.1\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":"","datasource":{"uid":"pyroscopeUid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1402,7 +1409,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Profiles);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{ip=\\"192.168.0.1\\", host=\\"host\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{ip=\\"192.168.0.1\\", host=\\"host\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":"","datasource":{"uid":"pyroscopeUid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1461,7 +1468,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Profiles);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{service=\\"serviceName\\", pod=\\"podName\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{service=\\"serviceName\\", pod=\\"podName\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":"","datasource":{"uid":"pyroscopeUid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1495,7 +1502,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Profiles);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{service.name=\\"serviceName\\", pod=\\"podName\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637140000","to":"1602637261000"},"datasource":"pyroscopeUid","queries":[{"labelSelector":"{service.name=\\"serviceName\\", pod=\\"podName\\"}","groupBy":[],"profileTypeId":"","queryType":"profile","spanSelector":["6605c7b08e715d6c"],"refId":"","datasource":{"uid":"pyroscopeUid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1543,7 +1550,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"victoriaLogsUID","queries":[{"expr":"cluster:=\\"cluster1\\" AND hostname:=\\"hostname1\\" AND service_namespace:=\\"namespace1\\"","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"victoriaLogsUID","queries":[{"expr":"cluster:=\\"cluster1\\" AND hostname:=\\"hostname1\\" AND service_namespace:=\\"namespace1\\"","refId":"","datasource":{"uid":"victoriaLogsUID"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1565,7 +1572,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"victoriaLogsUID","queries":[{"expr":"span_id:=\\"6605c7b08e715d6c\\" AND trace_id:=\\"7946b05c2e2e4e5a\\" AND cluster:=\\"cluster1\\" AND hostname:=\\"hostname1\\" AND service_namespace:=\\"namespace1\\"","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"victoriaLogsUID","queries":[{"expr":"span_id:=\\"6605c7b08e715d6c\\" AND trace_id:=\\"7946b05c2e2e4e5a\\" AND cluster:=\\"cluster1\\" AND hostname:=\\"hostname1\\" AND service_namespace:=\\"namespace1\\"","refId":"","datasource":{"uid":"victoriaLogsUID"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1595,7 +1602,7 @@ describe('createSpanLinkFactory', () => {
|
|
|
|
|
expect(linkDef?.type).toBe(SpanLinkType.Logs);
|
|
|
|
|
expect(linkDef!.href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"victoriaLogsUID","queries":[{"expr":"hostname:=\\"hostname1\\" AND ip:=\\"192.168.0.1\\"","refId":""}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"victoriaLogsUID","queries":[{"expr":"hostname:=\\"hostname1\\" AND ip:=\\"192.168.0.1\\"","refId":"","datasource":{"uid":"victoriaLogsUID"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
@@ -1630,13 +1637,13 @@ describe('dataFrame links', () => {
|
|
|
|
|
expect(links![0].type).toBe(SpanLinkType.Unknown);
|
|
|
|
|
expect(links![1].href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"message":"SELECT * FROM superhero WHERE name=host"}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"message":"SELECT * FROM superhero WHERE name=host","datasource":{"uid":"loki1_uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
expect(links![1].type).toBe(SpanLinkType.Unknown);
|
|
|
|
|
expect(links![2].href).toBe(
|
|
|
|
|
`/explore?left=${encodeURIComponent(
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"go_memstats_heap_inuse_bytes{job=\'host\'}"}]}'
|
|
|
|
|
'{"range":{"from":"1602637200000","to":"1602637201000"},"datasource":"loki1_uid","queries":[{"expr":"go_memstats_heap_inuse_bytes{job=\'host\'}","datasource":{"uid":"loki1_uid"}}]}'
|
|
|
|
|
)}`
|
|
|
|
|
);
|
|
|
|
|
expect(links![2].type).toBe(SpanLinkType.Unknown);
|
|
|
|
|