@perses-dev/tempo-plugin 0.46.0 → 0.47.0-rc0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/model/api-types.js +23 -1
- package/dist/cjs/model/tempo-client.js +51 -28
- package/dist/cjs/plugins/tempo-datasource.js +3 -3
- package/dist/cjs/plugins/tempo-trace-query/TempoTraceQuery.js +1 -1
- package/dist/cjs/plugins/tempo-trace-query/get-trace-data.js +128 -32
- package/dist/cjs/test/mock-data.js +2461 -796
- package/dist/model/api-types.d.ts +88 -51
- package/dist/model/api-types.d.ts.map +1 -1
- package/dist/model/api-types.js +4 -4
- package/dist/model/api-types.js.map +1 -1
- package/dist/model/tempo-client.d.ts +18 -16
- package/dist/model/tempo-client.d.ts.map +1 -1
- package/dist/model/tempo-client.js +54 -33
- package/dist/model/tempo-client.js.map +1 -1
- package/dist/plugins/tempo-datasource.d.ts.map +1 -1
- package/dist/plugins/tempo-datasource.js +4 -4
- package/dist/plugins/tempo-datasource.js.map +1 -1
- package/dist/plugins/tempo-trace-query/TempoTraceQuery.js +1 -1
- package/dist/plugins/tempo-trace-query/TempoTraceQuery.js.map +1 -1
- package/dist/plugins/tempo-trace-query/get-trace-data.d.ts.map +1 -1
- package/dist/plugins/tempo-trace-query/get-trace-data.js +128 -32
- package/dist/plugins/tempo-trace-query/get-trace-data.js.map +1 -1
- package/dist/test/mock-data.d.ts +7 -3
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +2444 -791
- package/dist/test/mock-data.js.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/plugins/TempoTraceQuery.js +0 -30
- package/dist/cjs/plugins/get-trace-data.js +0 -69
- package/dist/plugins/TempoTraceQuery.d.ts +0 -11
- package/dist/plugins/TempoTraceQuery.d.ts.map +0 -1
- package/dist/plugins/TempoTraceQuery.js +0 -24
- package/dist/plugins/TempoTraceQuery.js.map +0 -1
- package/dist/plugins/get-trace-data.d.ts +0 -4
- package/dist/plugins/get-trace-data.d.ts.map +0 -1
- package/dist/plugins/get-trace-data.js +0 -61
- package/dist/plugins/get-trace-data.js.map +0 -1
|
@@ -1,72 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Common types
|
|
3
|
+
*/
|
|
4
|
+
export interface Attribute {
|
|
5
|
+
key: string;
|
|
6
|
+
value: AttributeValue;
|
|
7
|
+
}
|
|
8
|
+
export type AttributeValue = {
|
|
9
|
+
stringValue: string;
|
|
10
|
+
} | {
|
|
11
|
+
intValue: string;
|
|
12
|
+
} | {
|
|
13
|
+
boolValue: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
arrayValue: {
|
|
16
|
+
values: AttributeValue[];
|
|
13
17
|
};
|
|
14
|
-
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Parameters of Tempo HTTP API endpoint GET /api/search
|
|
21
|
+
*/
|
|
22
|
+
export interface SearchRequestParameters {
|
|
23
|
+
q: string;
|
|
24
|
+
start?: number;
|
|
25
|
+
end?: number;
|
|
15
26
|
}
|
|
16
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Response of Tempo HTTP API endpoint GET /api/search/<query>
|
|
29
|
+
*/
|
|
30
|
+
export interface SearchTraceQueryResponse {
|
|
31
|
+
traces: TraceSearchResult[];
|
|
32
|
+
}
|
|
33
|
+
export interface TraceSearchResult {
|
|
17
34
|
traceID: string;
|
|
18
35
|
rootServiceName: string;
|
|
19
36
|
rootTraceName: string;
|
|
20
37
|
startTimeUnixNano: string;
|
|
21
|
-
|
|
38
|
+
/** unset if duration is less than 1ms */
|
|
39
|
+
durationMs?: number;
|
|
40
|
+
/** @deprecated spanSet is deprecated in favor of spanSets */
|
|
41
|
+
spanSet?: {
|
|
42
|
+
spans: SpanSearchResult[];
|
|
43
|
+
matched: number;
|
|
44
|
+
};
|
|
22
45
|
spanSets?: Array<{
|
|
23
|
-
spans:
|
|
46
|
+
spans: SpanSearchResult[];
|
|
24
47
|
matched: number;
|
|
25
48
|
}>;
|
|
49
|
+
/** ServiceStats are only available in Tempo vParquet4+ blocks */
|
|
50
|
+
serviceStats?: Record<string, ServiceStats>;
|
|
51
|
+
}
|
|
52
|
+
export interface SpanSearchResult {
|
|
53
|
+
spanID: string;
|
|
54
|
+
name: string;
|
|
55
|
+
startTimeUnixNano: string;
|
|
56
|
+
durationNanos: string;
|
|
57
|
+
attributes: Attribute[];
|
|
58
|
+
}
|
|
59
|
+
export interface ServiceStats {
|
|
60
|
+
spanCount: number;
|
|
61
|
+
/** number of spans with errors, unset if zero */
|
|
62
|
+
errorCount?: number;
|
|
26
63
|
}
|
|
27
64
|
/**
|
|
28
|
-
* Response of Tempo HTTP API endpoint GET /api/
|
|
65
|
+
* Response of Tempo HTTP API endpoint GET /api/traces/<traceID>
|
|
66
|
+
* OTEL trace proto: https://github.com/open-telemetry/opentelemetry-proto-go/blob/main/otlp/trace/v1/trace.pb.go
|
|
29
67
|
*/
|
|
30
|
-
export interface
|
|
31
|
-
|
|
68
|
+
export interface SearchTraceIDResponse {
|
|
69
|
+
batches: Batch[];
|
|
32
70
|
}
|
|
33
|
-
export interface
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
71
|
+
export interface Batch {
|
|
72
|
+
resource: Resource;
|
|
73
|
+
scopeSpans: ScopeSpan[];
|
|
74
|
+
}
|
|
75
|
+
export interface Resource {
|
|
76
|
+
attributes: Attribute[];
|
|
39
77
|
}
|
|
40
78
|
export interface ScopeSpan {
|
|
41
|
-
scope:
|
|
42
|
-
name: string;
|
|
43
|
-
};
|
|
79
|
+
scope: Scope;
|
|
44
80
|
spans: Span[];
|
|
45
81
|
}
|
|
46
|
-
export interface
|
|
47
|
-
|
|
48
|
-
attributes: Attribute[];
|
|
49
|
-
};
|
|
50
|
-
scopeSpans: ScopeSpan[];
|
|
82
|
+
export interface Scope {
|
|
83
|
+
name: string;
|
|
51
84
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
85
|
+
export interface Span {
|
|
86
|
+
traceId: string;
|
|
87
|
+
spanId: string;
|
|
88
|
+
parentSpanId?: string;
|
|
89
|
+
name: string;
|
|
90
|
+
kind: string;
|
|
91
|
+
startTimeUnixNano: string;
|
|
92
|
+
endTimeUnixNano: string;
|
|
93
|
+
attributes?: Attribute[];
|
|
94
|
+
events?: SpanEvent[];
|
|
95
|
+
status?: SpanStatus;
|
|
57
96
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
export interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
spanCount: number;
|
|
67
|
-
errorCount: number;
|
|
68
|
-
summary: Trace;
|
|
69
|
-
traceDetails: SearchTraceIDResponse;
|
|
70
|
-
}>;
|
|
97
|
+
export interface SpanEvent {
|
|
98
|
+
timeUnixNano: string;
|
|
99
|
+
name: string;
|
|
100
|
+
attributes?: Attribute[];
|
|
101
|
+
}
|
|
102
|
+
export interface SpanStatus {
|
|
103
|
+
code?: typeof SpanStatusUnset | typeof SpanStatusOk | typeof SpanStatusError;
|
|
104
|
+
message?: string;
|
|
71
105
|
}
|
|
106
|
+
export declare const SpanStatusUnset = "STATUS_CODE_UNSET";
|
|
107
|
+
export declare const SpanStatusOk = "STATUS_CODE_OK";
|
|
108
|
+
export declare const SpanStatusError = "STATUS_CODE_ERROR";
|
|
72
109
|
//# sourceMappingURL=api-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-types.d.ts","sourceRoot":"","sources":["../../src/model/api-types.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"api-types.d.ts","source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C;CAClB;AAED,eAAO,MAAM,eAAe,sBAAsB,CAAC;AACnD,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAC7C,eAAO,MAAM,eAAe,sBAAsB,CAAC"}
|
package/dist/model/api-types.js
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
* Common types
|
|
15
|
+
*/ export const SpanStatusUnset = 'STATUS_CODE_UNSET';
|
|
16
|
+
export const SpanStatusOk = 'STATUS_CODE_OK';
|
|
17
|
+
export const SpanStatusError = 'STATUS_CODE_ERROR';
|
|
18
18
|
|
|
19
19
|
//# sourceMappingURL=api-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/api-types.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport interface
|
|
1
|
+
{"version":3,"sources":["../../src/model/api-types.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * Common types\n */\nexport interface Attribute {\n key: string;\n value: AttributeValue;\n}\n\nexport type AttributeValue =\n | { stringValue: string }\n | { intValue: string }\n | { boolValue: boolean }\n | { arrayValue: { values: AttributeValue[] } };\n\n/**\n * Parameters of Tempo HTTP API endpoint GET /api/search\n */\nexport interface SearchRequestParameters {\n q: string;\n start?: number;\n end?: number;\n}\n\n/**\n * Response of Tempo HTTP API endpoint GET /api/search/<query>\n */\nexport interface SearchTraceQueryResponse {\n traces: TraceSearchResult[];\n}\n\nexport interface TraceSearchResult {\n traceID: string;\n rootServiceName: string;\n rootTraceName: string;\n startTimeUnixNano: string;\n /** unset if duration is less than 1ms */\n durationMs?: number;\n /** @deprecated spanSet is deprecated in favor of spanSets */\n spanSet?: {\n spans: SpanSearchResult[];\n matched: number;\n };\n spanSets?: Array<{\n spans: SpanSearchResult[];\n matched: number;\n }>;\n /** ServiceStats are only available in Tempo vParquet4+ blocks */\n serviceStats?: Record<string, ServiceStats>;\n}\n\nexport interface SpanSearchResult {\n spanID: string;\n name: string;\n startTimeUnixNano: string;\n durationNanos: string;\n attributes: Attribute[];\n}\n\nexport interface ServiceStats {\n spanCount: number;\n /** number of spans with errors, unset if zero */\n errorCount?: number;\n}\n\n/**\n * Response of Tempo HTTP API endpoint GET /api/traces/<traceID>\n * OTEL trace proto: https://github.com/open-telemetry/opentelemetry-proto-go/blob/main/otlp/trace/v1/trace.pb.go\n */\nexport interface SearchTraceIDResponse {\n batches: Batch[];\n}\n\nexport interface Batch {\n resource: Resource;\n scopeSpans: ScopeSpan[];\n}\n\nexport interface Resource {\n attributes: Attribute[];\n}\n\nexport interface ScopeSpan {\n scope: Scope;\n spans: Span[];\n}\n\nexport interface Scope {\n name: string;\n}\n\nexport interface Span {\n traceId: string;\n spanId: string;\n parentSpanId?: string;\n name: string;\n kind: string;\n startTimeUnixNano: string;\n endTimeUnixNano: string;\n attributes?: Attribute[];\n events?: SpanEvent[];\n status?: SpanStatus;\n}\n\nexport interface SpanEvent {\n timeUnixNano: string;\n name: string;\n attributes?: Attribute[];\n}\n\nexport interface SpanStatus {\n code?: typeof SpanStatusUnset | typeof SpanStatusOk | typeof SpanStatusError;\n message?: string;\n}\n\nexport const SpanStatusUnset = 'STATUS_CODE_UNSET';\nexport const SpanStatusOk = 'STATUS_CODE_OK';\nexport const SpanStatusError = 'STATUS_CODE_ERROR';\n"],"names":["SpanStatusUnset","SpanStatusOk","SpanStatusError"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;;CAEC,GAgHD,OAAO,MAAMA,kBAAkB,oBAAoB;AACnD,OAAO,MAAMC,eAAe,iBAAiB;AAC7C,OAAO,MAAMC,kBAAkB,oBAAoB"}
|
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
import { RequestHeaders } from '@perses-dev/core';
|
|
2
2
|
import { DatasourceClient } from '@perses-dev/plugin-system';
|
|
3
|
-
import {
|
|
3
|
+
import { SearchRequestParameters, SearchTraceIDResponse, SearchTraceQueryResponse } from './api-types';
|
|
4
4
|
interface TempoClientOptions {
|
|
5
5
|
datasourceUrl: string;
|
|
6
6
|
headers?: RequestHeaders;
|
|
7
7
|
}
|
|
8
8
|
export interface TempoClient extends DatasourceClient {
|
|
9
9
|
options: TempoClientOptions;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
searchTraceID(traceID: string,
|
|
10
|
+
searchTraceQuery(params: SearchRequestParameters, queryOptions: QueryOptions): Promise<SearchTraceQueryResponse>;
|
|
11
|
+
searchTraceQueryFallback(params: SearchRequestParameters, queryOptions: QueryOptions): Promise<SearchTraceQueryResponse>;
|
|
12
|
+
searchTraceID(traceID: string, queryOptions: QueryOptions): Promise<SearchTraceIDResponse>;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export interface QueryOptions {
|
|
15
|
+
datasourceUrl: string;
|
|
16
|
+
headers?: RequestHeaders;
|
|
17
|
+
}
|
|
18
|
+
export declare const executeRequest: <T>(input: string | URL | Request, init?: RequestInit | undefined) => Promise<T>;
|
|
15
19
|
/**
|
|
16
20
|
* Returns a summary report of traces that satisfy the query.
|
|
17
21
|
*/
|
|
18
|
-
export declare function searchTraceQuery(
|
|
22
|
+
export declare function searchTraceQuery(params: SearchRequestParameters, queryOptions: QueryOptions): Promise<SearchTraceQueryResponse>;
|
|
19
23
|
/**
|
|
20
24
|
* Returns a detailed report, including all the spans, for a given trace.
|
|
21
25
|
*/
|
|
22
|
-
export declare function searchTraceID(traceID: string,
|
|
26
|
+
export declare function searchTraceID(traceID: string, queryOptions: QueryOptions): Promise<SearchTraceIDResponse>;
|
|
23
27
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* of errors for a trace.
|
|
28
|
+
* Returns a summary report of traces that satisfy the query.
|
|
29
|
+
*
|
|
30
|
+
* If the serviceStats field is missing in the response, fetches all traces
|
|
31
|
+
* and calculates the serviceStats.
|
|
29
32
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* Tempo.
|
|
33
|
+
* Tempo computes the serviceStats field during ingestion since vParquet4,
|
|
34
|
+
* this fallback is required for older block formats.
|
|
33
35
|
*/
|
|
34
|
-
export declare function
|
|
36
|
+
export declare function searchTraceQueryFallback(params: SearchRequestParameters, queryOptions: QueryOptions): Promise<SearchTraceQueryResponse>;
|
|
35
37
|
export {};
|
|
36
38
|
//# sourceMappingURL=tempo-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tempo-client.d.ts","sourceRoot":"","sources":["../../src/model/tempo-client.ts"],"names":[],"mappings":"AAaA,OAAO,EAAS,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"tempo-client.d.ts","sourceRoot":"","sources":["../../src/model/tempo-client.ts"],"names":[],"mappings":"AAaA,OAAO,EAAS,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EAGzB,MAAM,aAAa,CAAC;AAErB,UAAU,kBAAkB;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD,OAAO,EAAE,kBAAkB,CAAC;IAC5B,gBAAgB,CAAC,MAAM,EAAE,uBAAuB,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACjH,wBAAwB,CACtB,MAAM,EAAE,uBAAuB,EAC/B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACrC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC5F;AAED,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,kFAI1B,CAAC;AAiBF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,uBAAuB,EAAE,YAAY,EAAE,YAAY,qCAE3F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,kCAExE;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,uBAAuB,EAC/B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,wBAAwB,CAAC,CAgDnC"}
|
|
@@ -11,67 +11,88 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { fetch } from '@perses-dev/core';
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
import { SpanStatusError } from './api-types';
|
|
15
|
+
export const executeRequest = async (...args)=>{
|
|
16
|
+
const response = await fetch(...args);
|
|
16
17
|
const jsonData = await response.json();
|
|
17
18
|
return jsonData;
|
|
18
19
|
};
|
|
19
|
-
function fetchWithGet(apiURI,
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
function fetchWithGet(apiURI, params, queryOptions) {
|
|
21
|
+
const { datasourceUrl, headers = {} } = queryOptions;
|
|
22
|
+
let url = `${datasourceUrl}${apiURI}`;
|
|
23
|
+
if (params) {
|
|
24
|
+
url += '?' + new URLSearchParams(params);
|
|
25
|
+
}
|
|
26
|
+
const init = {
|
|
27
|
+
method: 'GET',
|
|
28
|
+
headers
|
|
29
|
+
};
|
|
30
|
+
return executeRequest(url, init);
|
|
22
31
|
}
|
|
23
32
|
/**
|
|
24
33
|
* Returns a summary report of traces that satisfy the query.
|
|
25
|
-
*/ export function searchTraceQuery(
|
|
26
|
-
return fetchWithGet(`/api/search
|
|
34
|
+
*/ export function searchTraceQuery(params, queryOptions) {
|
|
35
|
+
return fetchWithGet(`/api/search`, params, queryOptions);
|
|
27
36
|
}
|
|
28
37
|
/**
|
|
29
38
|
* Returns a detailed report, including all the spans, for a given trace.
|
|
30
|
-
*/ export function searchTraceID(traceID,
|
|
31
|
-
return fetchWithGet(`/api/traces/${traceID}`,
|
|
39
|
+
*/ export function searchTraceID(traceID, queryOptions) {
|
|
40
|
+
return fetchWithGet(`/api/traces/${traceID}`, null, queryOptions);
|
|
32
41
|
}
|
|
33
42
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* of errors for a trace.
|
|
43
|
+
* Returns a summary report of traces that satisfy the query.
|
|
44
|
+
*
|
|
45
|
+
* If the serviceStats field is missing in the response, fetches all traces
|
|
46
|
+
* and calculates the serviceStats.
|
|
39
47
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
* Tempo computes the serviceStats field during ingestion since vParquet4,
|
|
49
|
+
* this fallback is required for older block formats.
|
|
50
|
+
*/ export async function searchTraceQueryFallback(params, queryOptions) {
|
|
51
|
+
var _searchResponse_traces_;
|
|
44
52
|
// Get a list of traces that satisfy the query.
|
|
45
|
-
const searchResponse = await searchTraceQuery(
|
|
46
|
-
if (!searchResponse.traces) {
|
|
53
|
+
const searchResponse = await searchTraceQuery(params, queryOptions);
|
|
54
|
+
if (!searchResponse.traces || searchResponse.traces.length === 0) {
|
|
47
55
|
return {
|
|
48
|
-
query,
|
|
49
56
|
traces: []
|
|
50
57
|
};
|
|
51
58
|
}
|
|
59
|
+
// exit early if fallback is not required (serviceStats are contained in the response)
|
|
60
|
+
if ((_searchResponse_traces_ = searchResponse.traces[0]) === null || _searchResponse_traces_ === void 0 ? void 0 : _searchResponse_traces_.serviceStats) {
|
|
61
|
+
return searchResponse;
|
|
62
|
+
}
|
|
63
|
+
// calculate serviceStats (number of spans and errors) per service
|
|
52
64
|
return {
|
|
53
|
-
query,
|
|
54
65
|
traces: await Promise.all(searchResponse.traces.map(async (trace)=>{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// For every trace, get the full trace, and find the total number of spans and errors.
|
|
66
|
+
const serviceStats = {};
|
|
67
|
+
const searchTraceIDResponse = await searchTraceID(trace.traceID, queryOptions);
|
|
68
|
+
// For every trace, get the full trace, and find the number of spans and errors.
|
|
59
69
|
for (const batch of searchTraceIDResponse.batches){
|
|
70
|
+
let serviceName = '?';
|
|
71
|
+
for (const attr of batch.resource.attributes){
|
|
72
|
+
if (attr.key === 'service.name' && 'stringValue' in attr.value) {
|
|
73
|
+
serviceName = attr.value.stringValue;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
var _serviceStats_serviceName;
|
|
78
|
+
const stats = (_serviceStats_serviceName = serviceStats[serviceName]) !== null && _serviceStats_serviceName !== void 0 ? _serviceStats_serviceName : {
|
|
79
|
+
spanCount: 0
|
|
80
|
+
};
|
|
60
81
|
for (const scopeSpan of batch.scopeSpans){
|
|
61
|
-
spanCount += scopeSpan.spans.length;
|
|
82
|
+
stats.spanCount += scopeSpan.spans.length;
|
|
62
83
|
for (const span of scopeSpan.spans){
|
|
63
84
|
var _span_status;
|
|
64
|
-
if ((_span_status = span.status) === null || _span_status === void 0 ? void 0 : _span_status.code) {
|
|
65
|
-
|
|
85
|
+
if (((_span_status = span.status) === null || _span_status === void 0 ? void 0 : _span_status.code) === SpanStatusError) {
|
|
86
|
+
var _stats_errorCount;
|
|
87
|
+
stats.errorCount = ((_stats_errorCount = stats.errorCount) !== null && _stats_errorCount !== void 0 ? _stats_errorCount : 0) + 1;
|
|
66
88
|
}
|
|
67
89
|
}
|
|
68
90
|
}
|
|
91
|
+
serviceStats[serviceName] = stats;
|
|
69
92
|
}
|
|
70
93
|
return {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
spanCount,
|
|
74
|
-
errorCount
|
|
94
|
+
...trace,
|
|
95
|
+
serviceStats
|
|
75
96
|
};
|
|
76
97
|
}))
|
|
77
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/tempo-client.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { fetch, RequestHeaders } from '@perses-dev/core';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/model/tempo-client.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { fetch, RequestHeaders } from '@perses-dev/core';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\nimport {\n SearchRequestParameters,\n SearchTraceIDResponse,\n SearchTraceQueryResponse,\n ServiceStats,\n SpanStatusError,\n} from './api-types';\n\ninterface TempoClientOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface TempoClient extends DatasourceClient {\n options: TempoClientOptions;\n searchTraceQuery(params: SearchRequestParameters, queryOptions: QueryOptions): Promise<SearchTraceQueryResponse>;\n searchTraceQueryFallback(\n params: SearchRequestParameters,\n queryOptions: QueryOptions\n ): Promise<SearchTraceQueryResponse>;\n searchTraceID(traceID: string, queryOptions: QueryOptions): Promise<SearchTraceIDResponse>;\n}\n\nexport interface QueryOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport const executeRequest = async <T>(...args: Parameters<typeof global.fetch>): Promise<T> => {\n const response = await fetch(...args);\n const jsonData = await response.json();\n return jsonData;\n};\n\nfunction fetchWithGet<T, TResponse>(apiURI: string, params: T | null, queryOptions: QueryOptions) {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n let url = `${datasourceUrl}${apiURI}`;\n if (params) {\n url += '?' + new URLSearchParams(params);\n }\n const init = {\n method: 'GET',\n headers,\n };\n\n return executeRequest<TResponse>(url, init);\n}\n\n/**\n * Returns a summary report of traces that satisfy the query.\n */\nexport function searchTraceQuery(params: SearchRequestParameters, queryOptions: QueryOptions) {\n return fetchWithGet<SearchRequestParameters, SearchTraceQueryResponse>(`/api/search`, params, queryOptions);\n}\n\n/**\n * Returns a detailed report, including all the spans, for a given trace.\n */\nexport function searchTraceID(traceID: string, queryOptions: QueryOptions) {\n return fetchWithGet<null, SearchTraceIDResponse>(`/api/traces/${traceID}`, null, queryOptions);\n}\n\n/**\n * Returns a summary report of traces that satisfy the query.\n *\n * If the serviceStats field is missing in the response, fetches all traces\n * and calculates the serviceStats.\n *\n * Tempo computes the serviceStats field during ingestion since vParquet4,\n * this fallback is required for older block formats.\n */\nexport async function searchTraceQueryFallback(\n params: SearchRequestParameters,\n queryOptions: QueryOptions\n): Promise<SearchTraceQueryResponse> {\n // Get a list of traces that satisfy the query.\n const searchResponse = await searchTraceQuery(params, queryOptions);\n if (!searchResponse.traces || searchResponse.traces.length === 0) {\n return { traces: [] };\n }\n\n // exit early if fallback is not required (serviceStats are contained in the response)\n if (searchResponse.traces[0]?.serviceStats) {\n return searchResponse;\n }\n\n // calculate serviceStats (number of spans and errors) per service\n return {\n traces: await Promise.all(\n searchResponse.traces.map(async (trace) => {\n const serviceStats: Record<string, ServiceStats> = {};\n const searchTraceIDResponse = await searchTraceID(trace.traceID, queryOptions);\n\n // For every trace, get the full trace, and find the number of spans and errors.\n for (const batch of searchTraceIDResponse.batches) {\n let serviceName = '?';\n for (const attr of batch.resource.attributes) {\n if (attr.key === 'service.name' && 'stringValue' in attr.value) {\n serviceName = attr.value.stringValue;\n break;\n }\n }\n\n const stats = serviceStats[serviceName] ?? { spanCount: 0 };\n for (const scopeSpan of batch.scopeSpans) {\n stats.spanCount += scopeSpan.spans.length;\n for (const span of scopeSpan.spans) {\n if (span.status?.code === SpanStatusError) {\n stats.errorCount = (stats.errorCount ?? 0) + 1;\n }\n }\n }\n serviceStats[serviceName] = stats;\n }\n\n return {\n ...trace,\n serviceStats,\n };\n })\n ),\n };\n}\n"],"names":["fetch","SpanStatusError","executeRequest","args","response","jsonData","json","fetchWithGet","apiURI","params","queryOptions","datasourceUrl","headers","url","URLSearchParams","init","method","searchTraceQuery","searchTraceID","traceID","searchTraceQueryFallback","searchResponse","traces","length","serviceStats","Promise","all","map","trace","searchTraceIDResponse","batch","batches","serviceName","attr","resource","attributes","key","value","stringValue","stats","spanCount","scopeSpan","scopeSpans","spans","span","status","code","errorCount"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,KAAK,QAAwB,mBAAmB;AAEzD,SAKEC,eAAe,QACV,cAAc;AAsBrB,OAAO,MAAMC,iBAAiB,OAAU,GAAGC;IACzC,MAAMC,WAAW,MAAMJ,SAASG;IAChC,MAAME,WAAW,MAAMD,SAASE,IAAI;IACpC,OAAOD;AACT,EAAE;AAEF,SAASE,aAA2BC,MAAc,EAAEC,MAAgB,EAAEC,YAA0B;IAC9F,MAAM,EAAEC,aAAa,EAAEC,UAAU,CAAC,CAAC,EAAE,GAAGF;IAExC,IAAIG,MAAM,CAAC,EAAEF,cAAc,EAAEH,OAAO,CAAC;IACrC,IAAIC,QAAQ;QACVI,OAAO,MAAM,IAAIC,gBAAgBL;IACnC;IACA,MAAMM,OAAO;QACXC,QAAQ;QACRJ;IACF;IAEA,OAAOV,eAA0BW,KAAKE;AACxC;AAEA;;CAEC,GACD,OAAO,SAASE,iBAAiBR,MAA+B,EAAEC,YAA0B;IAC1F,OAAOH,aAAgE,CAAC,WAAW,CAAC,EAAEE,QAAQC;AAChG;AAEA;;CAEC,GACD,OAAO,SAASQ,cAAcC,OAAe,EAAET,YAA0B;IACvE,OAAOH,aAA0C,CAAC,YAAY,EAAEY,QAAQ,CAAC,EAAE,MAAMT;AACnF;AAEA;;;;;;;;CAQC,GACD,OAAO,eAAeU,yBACpBX,MAA+B,EAC/BC,YAA0B;QAStBW;IAPJ,+CAA+C;IAC/C,MA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;oBACF;gBACF;gBACAf,YAAY,CAACQ,YAAY,GAAGO;YAC9B;YAEA,OAAO;gBACL,GAAGX,KAAK;gBACRJ;YACF;QACF;IAEJ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tempo-datasource.d.ts","sourceRoot":"","sources":["../../src/plugins/tempo-datasource.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"tempo-datasource.d.ts","sourceRoot":"","sources":["../../src/plugins/tempo-datasource.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAA6D,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAyB/D,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,mBAAmB,EAAE,WAAW,CAK9E,CAAC"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { searchTraceQuery, searchTraceID,
|
|
13
|
+
import { searchTraceQuery, searchTraceID, searchTraceQueryFallback } from '../model/tempo-client';
|
|
14
14
|
/**
|
|
15
15
|
* Creates a TempoClient for a specific datasource spec.
|
|
16
16
|
*/ const createClient = (spec, options)=>{
|
|
@@ -25,9 +25,9 @@ import { searchTraceQuery, searchTraceID, getEnrichedTraceQuery } from '../model
|
|
|
25
25
|
options: {
|
|
26
26
|
datasourceUrl
|
|
27
27
|
},
|
|
28
|
-
searchTraceQuery: (
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
searchTraceQuery: (params, queryOptions)=>searchTraceQuery(params, queryOptions),
|
|
29
|
+
searchTraceQueryFallback: (params, queryOptions)=>searchTraceQueryFallback(params, queryOptions),
|
|
30
|
+
searchTraceID: (traceID, queryOptions)=>searchTraceID(traceID, queryOptions)
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
export const TempoDatasource = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/tempo-datasource.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport { searchTraceQuery, searchTraceID,
|
|
1
|
+
{"version":3,"sources":["../../src/plugins/tempo-datasource.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport { searchTraceQuery, searchTraceID, searchTraceQueryFallback, TempoClient } from '../model/tempo-client';\nimport { TempoDatasourceSpec } from './tempo-datasource-types';\n\n/**\n * Creates a TempoClient for a specific datasource spec.\n */\nconst createClient: DatasourcePlugin<TempoDatasourceSpec, TempoClient>['createClient'] = (spec, options) => {\n const { directUrl } = spec;\n const { proxyUrl } = options;\n\n // Use the direct URL if specified, but fallback to the proxyUrl by default if not specified\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Tempo client. You can use directUrl in the spec to configure it.');\n }\n\n return {\n options: {\n datasourceUrl,\n },\n searchTraceQuery: (params, queryOptions) => searchTraceQuery(params, queryOptions),\n searchTraceQueryFallback: (params, queryOptions) => searchTraceQueryFallback(params, queryOptions),\n searchTraceID: (traceID, queryOptions) => searchTraceID(traceID, queryOptions),\n };\n};\n\nexport const TempoDatasource: DatasourcePlugin<TempoDatasourceSpec, TempoClient> = {\n createClient,\n // TODO add a options editor component for tempo datasource\n // OptionsEditorComponent: TempoDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["searchTraceQuery","searchTraceID","searchTraceQueryFallback","createClient","spec","options","directUrl","proxyUrl","datasourceUrl","undefined","Error","params","queryOptions","traceID","TempoDatasource","createInitialOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,gBAAgB,EAAEC,aAAa,EAAEC,wBAAwB,QAAqB,wBAAwB;AAG/G;;CAEC,GACD,MAAMC,eAAmF,CAACC,MAAMC;IAC9F,MAAM,EAAEC,SAAS,EAAE,GAAGF;IACtB,MAAM,EAAEG,QAAQ,EAAE,GAAGF;IAErB,4FAA4F;IAC5F,MAAMG,gBAAgBF,sBAAAA,uBAAAA,YAAaC;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,OAAO;QACLL,SAAS;YACPG;QACF;QACAR,kBAAkB,CAACW,QAAQC,eAAiBZ,iBAAiBW,QAAQC;QACrEV,0BAA0B,CAACS,QAAQC,eAAiBV,yBAAyBS,QAAQC;QACrFX,eAAe,CAACY,SAASD,eAAiBX,cAAcY,SAASD;IACnE;AACF;AAEA,OAAO,MAAME,kBAAsE;IACjFX;IACA,2DAA2D;IAC3D,iDAAiD;IACjDY,sBAAsB,IAAO,CAAA;YAAET,WAAW;QAAG,CAAA;AAC/C,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/plugins/tempo-trace-query/TempoTraceQuery.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { getTraceData } from './get-trace-data';\nimport { TempoTraceQueryEditor } from './TempoTraceQueryEditor';\n\n/**\n * The core Tempo TraceQuery plugin for Perses.\n */\nexport const TempoTraceQuery = {\n getTraceData,\n OptionsEditorComponent: TempoTraceQueryEditor,\n createInitialOptions: () => ({\n query: '
|
|
1
|
+
{"version":3,"sources":["../../../src/plugins/tempo-trace-query/TempoTraceQuery.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { getTraceData } from './get-trace-data';\nimport { TempoTraceQueryEditor } from './TempoTraceQueryEditor';\n\n/**\n * The core Tempo TraceQuery plugin for Perses.\n */\nexport const TempoTraceQuery = {\n getTraceData,\n OptionsEditorComponent: TempoTraceQueryEditor,\n createInitialOptions: () => ({\n query: '',\n datasource: undefined,\n }),\n};\n"],"names":["getTraceData","TempoTraceQueryEditor","TempoTraceQuery","OptionsEditorComponent","createInitialOptions","query","datasource","undefined"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,YAAY,QAAQ,mBAAmB;AAChD,SAASC,qBAAqB,QAAQ,0BAA0B;AAEhE;;CAEC,GACD,OAAO,MAAMC,kBAAkB;IAC7BF;IACAG,wBAAwBF;IACxBG,sBAAsB,IAAO,CAAA;YAC3BC,OAAO;YACPC,YAAYC;QACd,CAAA;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-trace-data.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/get-trace-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"get-trace-data.d.ts","sourceRoot":"","sources":["../../../src/plugins/tempo-trace-query/get-trace-data.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAEL,iBAAiB,EAMlB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAYpE,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,iBAAiB;;;EAM5D;AAED,eAAO,MAAM,YAAY,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,cAAc,CAyD9E,CAAC"}
|