@twin.org/tracing-rest-client 0.9.2-next.1
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/LICENSE +201 -0
- package/README.md +21 -0
- package/dist/es/index.js +4 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/tracingRestClient.js +108 -0
- package/dist/es/tracingRestClient.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/tracingRestClient.d.ts +65 -0
- package/docs/changelog.md +25 -0
- package/docs/examples.md +25 -0
- package/docs/reference/classes/TracingRestClient.md +220 -0
- package/docs/reference/index.md +5 -0
- package/locales/en.json +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2024 IOTA Stiftung.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# TWIN Tracing Rest Client
|
|
2
|
+
|
|
3
|
+
Provides a client for interacting with tracing service endpoints from applications and services.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install @twin.org/tracing-rest-client
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
Usage of the APIs is shown in the examples [docs/examples.md](docs/examples.md)
|
|
14
|
+
|
|
15
|
+
## Reference
|
|
16
|
+
|
|
17
|
+
Detailed reference documentation for the API can be found in [docs/reference/index.md](docs/reference/index.md)
|
|
18
|
+
|
|
19
|
+
## Changelog
|
|
20
|
+
|
|
21
|
+
The changes between each version can be found in [docs/changelog.md](docs/changelog.md)
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,wBAAwB,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./tracingRestClient.js\";\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { BaseRestClient } from "@twin.org/api-core";
|
|
4
|
+
import { Coerce, Guards } from "@twin.org/core";
|
|
5
|
+
import { SpanHelper } from "@twin.org/tracing-models";
|
|
6
|
+
import { HttpMethod } from "@twin.org/web";
|
|
7
|
+
/**
|
|
8
|
+
* Client for performing tracing through to REST endpoints.
|
|
9
|
+
*/
|
|
10
|
+
export class TracingRestClient extends BaseRestClient {
|
|
11
|
+
/**
|
|
12
|
+
* Runtime name for the class.
|
|
13
|
+
*/
|
|
14
|
+
static CLASS_NAME = "TracingRestClient";
|
|
15
|
+
/**
|
|
16
|
+
* Create a new instance of TracingRestClient.
|
|
17
|
+
* @param config The configuration for the client.
|
|
18
|
+
*/
|
|
19
|
+
constructor(config) {
|
|
20
|
+
super(TracingRestClient.CLASS_NAME, config, "tracing");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns the class name of the component.
|
|
24
|
+
* @returns The class name of the component.
|
|
25
|
+
*/
|
|
26
|
+
className() {
|
|
27
|
+
return TracingRestClient.CLASS_NAME;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Start a new span.
|
|
31
|
+
* @param name The name of the span.
|
|
32
|
+
* @param options The options for the span.
|
|
33
|
+
* @returns The started span, including its minted context.
|
|
34
|
+
*/
|
|
35
|
+
async startSpan(name, options) {
|
|
36
|
+
Guards.stringValue(TracingRestClient.CLASS_NAME, "name", name);
|
|
37
|
+
const response = await this.fetch("/", HttpMethod.POST, {
|
|
38
|
+
body: {
|
|
39
|
+
name,
|
|
40
|
+
options
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return response.body;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* End a span, finalizing its status and duration.
|
|
47
|
+
* @param span The span to end.
|
|
48
|
+
* @param status The status to set on the span, defaults to ok.
|
|
49
|
+
* @returns A promise that resolves when the span has been ended.
|
|
50
|
+
*/
|
|
51
|
+
async endSpan(span, status) {
|
|
52
|
+
Guards.object(TracingRestClient.CLASS_NAME, "span", span);
|
|
53
|
+
Guards.object(TracingRestClient.CLASS_NAME, "span.context", span.context);
|
|
54
|
+
Guards.stringValue(TracingRestClient.CLASS_NAME, "span.context.spanId", span.context.spanId);
|
|
55
|
+
// Finalize the caller's span locally (status/endTs/durationMs) so a REST caller's span
|
|
56
|
+
// matches the in-process path; the server honours the resulting endTs carried in the body.
|
|
57
|
+
SpanHelper.endSpan(span, status);
|
|
58
|
+
await this.fetch("/:spanId", HttpMethod.PUT, {
|
|
59
|
+
pathParams: {
|
|
60
|
+
spanId: span.context.spanId
|
|
61
|
+
},
|
|
62
|
+
body: span
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Query the spans.
|
|
67
|
+
* @param traceId The id of the trace to filter by.
|
|
68
|
+
* @param spanId The id of the span to filter by.
|
|
69
|
+
* @param status The status to filter by.
|
|
70
|
+
* @param kind The kind to filter by.
|
|
71
|
+
* @param timeStart The inclusive start time to filter the span start by, as a timestamp in ms.
|
|
72
|
+
* @param timeEnd The inclusive end time to filter the span start by, as a timestamp in ms.
|
|
73
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
74
|
+
* @param limit Limit the number of entities to return.
|
|
75
|
+
* @returns All the entities for the storage matching the conditions,
|
|
76
|
+
* and a cursor which can be used to request more entities.
|
|
77
|
+
*/
|
|
78
|
+
async query(traceId, spanId, status, kind, timeStart, timeEnd, cursor, limit) {
|
|
79
|
+
const response = await this.fetch("/", HttpMethod.GET, {
|
|
80
|
+
query: {
|
|
81
|
+
traceId,
|
|
82
|
+
spanId,
|
|
83
|
+
status,
|
|
84
|
+
kind,
|
|
85
|
+
timeStart: Coerce.string(timeStart),
|
|
86
|
+
timeEnd: Coerce.string(timeEnd),
|
|
87
|
+
cursor,
|
|
88
|
+
limit: Coerce.string(limit)
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return response.body;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get all the spans belonging to a trace, ordered by their start time.
|
|
95
|
+
* @param traceId The id of the trace to retrieve.
|
|
96
|
+
* @returns The spans belonging to the trace, ordered by their start time ascending.
|
|
97
|
+
*/
|
|
98
|
+
async getTrace(traceId) {
|
|
99
|
+
Guards.stringValue(TracingRestClient.CLASS_NAME, "traceId", traceId);
|
|
100
|
+
const response = await this.fetch("/trace/:traceId", HttpMethod.GET, {
|
|
101
|
+
pathParams: {
|
|
102
|
+
traceId
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return response.body.spans;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=tracingRestClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracingRestClient.js","sourceRoot":"","sources":["../../src/tracingRestClient.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type { IBaseRestClientConfig, INoContentResponse } from \"@twin.org/api-models\";\nimport { Coerce, Guards } from \"@twin.org/core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport {\n\tSpanHelper,\n\ttype ISpan,\n\ttype ISpanOptions,\n\ttype ITracingComponent,\n\ttype ITracingGetTraceRequest,\n\ttype ITracingGetTraceResponse,\n\ttype ITracingListRequest,\n\ttype ITracingListResponse,\n\ttype ITracingSpanEndRequest,\n\ttype ITracingSpanStartRequest,\n\ttype ITracingSpanStartResponse,\n\ttype SpanKind,\n\ttype SpanStatus\n} from \"@twin.org/tracing-models\";\nimport { HttpMethod } from \"@twin.org/web\";\n\n/**\n * Client for performing tracing through to REST endpoints.\n */\nexport class TracingRestClient extends BaseRestClient implements ITracingComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<TracingRestClient>();\n\n\t/**\n\t * Create a new instance of TracingRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(TracingRestClient.CLASS_NAME, config, \"tracing\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn TracingRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Start a new span.\n\t * @param name The name of the span.\n\t * @param options The options for the span.\n\t * @returns The started span, including its minted context.\n\t */\n\tpublic async startSpan(name: string, options?: ISpanOptions): Promise<ISpan> {\n\t\tGuards.stringValue(TracingRestClient.CLASS_NAME, nameof(name), name);\n\n\t\tconst response = await this.fetch<ITracingSpanStartRequest, ITracingSpanStartResponse>(\n\t\t\t\"/\",\n\t\t\tHttpMethod.POST,\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\tname,\n\t\t\t\t\toptions\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * End a span, finalizing its status and duration.\n\t * @param span The span to end.\n\t * @param status The status to set on the span, defaults to ok.\n\t * @returns A promise that resolves when the span has been ended.\n\t */\n\tpublic async endSpan(span: ISpan, status?: SpanStatus): Promise<void> {\n\t\tGuards.object<ISpan>(TracingRestClient.CLASS_NAME, nameof(span), span);\n\t\tGuards.object(TracingRestClient.CLASS_NAME, nameof(span.context), span.context);\n\t\tGuards.stringValue(\n\t\t\tTracingRestClient.CLASS_NAME,\n\t\t\tnameof(span.context.spanId),\n\t\t\tspan.context.spanId\n\t\t);\n\n\t\t// Finalize the caller's span locally (status/endTs/durationMs) so a REST caller's span\n\t\t// matches the in-process path; the server honours the resulting endTs carried in the body.\n\t\tSpanHelper.endSpan(span, status);\n\n\t\tawait this.fetch<ITracingSpanEndRequest, INoContentResponse>(\"/:spanId\", HttpMethod.PUT, {\n\t\t\tpathParams: {\n\t\t\t\tspanId: span.context.spanId\n\t\t\t},\n\t\t\tbody: span\n\t\t});\n\t}\n\n\t/**\n\t * Query the spans.\n\t * @param traceId The id of the trace to filter by.\n\t * @param spanId The id of the span to filter by.\n\t * @param status The status to filter by.\n\t * @param kind The kind to filter by.\n\t * @param timeStart The inclusive start time to filter the span start by, as a timestamp in ms.\n\t * @param timeEnd The inclusive end time to filter the span start by, as a timestamp in ms.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t */\n\tpublic async query(\n\t\ttraceId?: string,\n\t\tspanId?: string,\n\t\tstatus?: SpanStatus,\n\t\tkind?: SpanKind,\n\t\ttimeStart?: number,\n\t\ttimeEnd?: number,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The spans.\n\t\t */\n\t\tentities: ISpan[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call query to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<ITracingListRequest, ITracingListResponse>(\n\t\t\t\"/\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tquery: {\n\t\t\t\t\ttraceId,\n\t\t\t\t\tspanId,\n\t\t\t\t\tstatus,\n\t\t\t\t\tkind,\n\t\t\t\t\ttimeStart: Coerce.string(timeStart),\n\t\t\t\t\ttimeEnd: Coerce.string(timeEnd),\n\t\t\t\t\tcursor,\n\t\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Get all the spans belonging to a trace, ordered by their start time.\n\t * @param traceId The id of the trace to retrieve.\n\t * @returns The spans belonging to the trace, ordered by their start time ascending.\n\t */\n\tpublic async getTrace(traceId: string): Promise<ISpan[]> {\n\t\tGuards.stringValue(TracingRestClient.CLASS_NAME, nameof(traceId), traceId);\n\n\t\tconst response = await this.fetch<ITracingGetTraceRequest, ITracingGetTraceResponse>(\n\t\t\t\"/trace/:traceId\",\n\t\t\tHttpMethod.GET,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\ttraceId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.body.spans;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tracingRestClient.js";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BaseRestClient } from "@twin.org/api-core";
|
|
2
|
+
import type { IBaseRestClientConfig } from "@twin.org/api-models";
|
|
3
|
+
import { type ISpan, type ISpanOptions, type ITracingComponent, type SpanKind, type SpanStatus } from "@twin.org/tracing-models";
|
|
4
|
+
/**
|
|
5
|
+
* Client for performing tracing through to REST endpoints.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TracingRestClient extends BaseRestClient implements ITracingComponent {
|
|
8
|
+
/**
|
|
9
|
+
* Runtime name for the class.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new instance of TracingRestClient.
|
|
14
|
+
* @param config The configuration for the client.
|
|
15
|
+
*/
|
|
16
|
+
constructor(config: IBaseRestClientConfig);
|
|
17
|
+
/**
|
|
18
|
+
* Returns the class name of the component.
|
|
19
|
+
* @returns The class name of the component.
|
|
20
|
+
*/
|
|
21
|
+
className(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Start a new span.
|
|
24
|
+
* @param name The name of the span.
|
|
25
|
+
* @param options The options for the span.
|
|
26
|
+
* @returns The started span, including its minted context.
|
|
27
|
+
*/
|
|
28
|
+
startSpan(name: string, options?: ISpanOptions): Promise<ISpan>;
|
|
29
|
+
/**
|
|
30
|
+
* End a span, finalizing its status and duration.
|
|
31
|
+
* @param span The span to end.
|
|
32
|
+
* @param status The status to set on the span, defaults to ok.
|
|
33
|
+
* @returns A promise that resolves when the span has been ended.
|
|
34
|
+
*/
|
|
35
|
+
endSpan(span: ISpan, status?: SpanStatus): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Query the spans.
|
|
38
|
+
* @param traceId The id of the trace to filter by.
|
|
39
|
+
* @param spanId The id of the span to filter by.
|
|
40
|
+
* @param status The status to filter by.
|
|
41
|
+
* @param kind The kind to filter by.
|
|
42
|
+
* @param timeStart The inclusive start time to filter the span start by, as a timestamp in ms.
|
|
43
|
+
* @param timeEnd The inclusive end time to filter the span start by, as a timestamp in ms.
|
|
44
|
+
* @param cursor The cursor to request the next chunk of entities.
|
|
45
|
+
* @param limit Limit the number of entities to return.
|
|
46
|
+
* @returns All the entities for the storage matching the conditions,
|
|
47
|
+
* and a cursor which can be used to request more entities.
|
|
48
|
+
*/
|
|
49
|
+
query(traceId?: string, spanId?: string, status?: SpanStatus, kind?: SpanKind, timeStart?: number, timeEnd?: number, cursor?: string, limit?: number): Promise<{
|
|
50
|
+
/**
|
|
51
|
+
* The spans.
|
|
52
|
+
*/
|
|
53
|
+
entities: ISpan[];
|
|
54
|
+
/**
|
|
55
|
+
* An optional cursor, when defined can be used to call query to get more entities.
|
|
56
|
+
*/
|
|
57
|
+
cursor?: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Get all the spans belonging to a trace, ordered by their start time.
|
|
61
|
+
* @param traceId The id of the trace to retrieve.
|
|
62
|
+
* @returns The spans belonging to the trace, ordered by their start time ascending.
|
|
63
|
+
*/
|
|
64
|
+
getTrace(traceId: string): Promise<ISpan[]>;
|
|
65
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.9.2-next.1](https://github.com/iotaledger/twin-tracing/compare/tracing-rest-client-v0.9.2-next.0...tracing-rest-client-v0.9.2-next.1) (2026-08-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add twin-tracing repository with OTel-aligned tracing API ([59b914c](https://github.com/iotaledger/twin-tracing/commit/59b914ca631c0b765973dfa5099a8f4e6115e325))
|
|
9
|
+
* add twin-tracing repository with OTel-aligned tracing API ([affcd6c](https://github.com/iotaledger/twin-tracing/commit/affcd6c1cf2fbfd34d9a8849e860e5fe66a011e3))
|
|
10
|
+
* linting and dependency update ([c1a2b98](https://github.com/iotaledger/twin-tracing/commit/c1a2b988441deb59592d69c7d3b6527bcb9018b2))
|
|
11
|
+
* linting and dependency update ([b65c083](https://github.com/iotaledger/twin-tracing/commit/b65c083d4f8f83c2046d29d53444b45c7a4188c7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* address PR review on tracing packages ([0832b5f](https://github.com/iotaledger/twin-tracing/commit/0832b5fc0e7414b4e0fd2393532df00e07ff1f43))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Dependencies
|
|
20
|
+
|
|
21
|
+
* The following workspace dependencies were updated
|
|
22
|
+
* dependencies
|
|
23
|
+
* @twin.org/tracing-models bumped from 0.9.2-next.0 to 0.9.2-next.1
|
|
24
|
+
|
|
25
|
+
## Changelog
|
package/docs/examples.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Tracing Rest Client Examples
|
|
2
|
+
|
|
3
|
+
The client implements the tracing component contract against a remote tracing service.
|
|
4
|
+
|
|
5
|
+
## Construct the client
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { TracingRestClient } from '@twin.org/tracing-rest-client';
|
|
9
|
+
|
|
10
|
+
const client = new TracingRestClient({ endpoint: 'https://localhost' });
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Record and query spans
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { SpanKind, SpanStatus } from '@twin.org/tracing-models';
|
|
17
|
+
|
|
18
|
+
const span = await client.startSpan('handle-request', { kind: SpanKind.Server });
|
|
19
|
+
|
|
20
|
+
await client.endSpan(span, SpanStatus.Ok);
|
|
21
|
+
|
|
22
|
+
const spans = await client.query(span.context.traceId);
|
|
23
|
+
|
|
24
|
+
const trace = await client.getTrace(span.context.traceId);
|
|
25
|
+
```
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Class: TracingRestClient
|
|
2
|
+
|
|
3
|
+
Client for performing tracing through to REST endpoints.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `BaseRestClient`
|
|
8
|
+
|
|
9
|
+
## Implements
|
|
10
|
+
|
|
11
|
+
- `ITracingComponent`
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new TracingRestClient**(`config`): `TracingRestClient`
|
|
18
|
+
|
|
19
|
+
Create a new instance of TracingRestClient.
|
|
20
|
+
|
|
21
|
+
#### Parameters
|
|
22
|
+
|
|
23
|
+
##### config
|
|
24
|
+
|
|
25
|
+
`IBaseRestClientConfig`
|
|
26
|
+
|
|
27
|
+
The configuration for the client.
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`TracingRestClient`
|
|
32
|
+
|
|
33
|
+
#### Overrides
|
|
34
|
+
|
|
35
|
+
`BaseRestClient.constructor`
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
|
+
|
|
41
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
|
+
|
|
43
|
+
Runtime name for the class.
|
|
44
|
+
|
|
45
|
+
## Methods
|
|
46
|
+
|
|
47
|
+
### className() {#classname}
|
|
48
|
+
|
|
49
|
+
> **className**(): `string`
|
|
50
|
+
|
|
51
|
+
Returns the class name of the component.
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
The class name of the component.
|
|
58
|
+
|
|
59
|
+
#### Implementation of
|
|
60
|
+
|
|
61
|
+
`ITracingComponent.className`
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### startSpan() {#startspan}
|
|
66
|
+
|
|
67
|
+
> **startSpan**(`name`, `options?`): `Promise`\<`ISpan`\>
|
|
68
|
+
|
|
69
|
+
Start a new span.
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
##### name
|
|
74
|
+
|
|
75
|
+
`string`
|
|
76
|
+
|
|
77
|
+
The name of the span.
|
|
78
|
+
|
|
79
|
+
##### options?
|
|
80
|
+
|
|
81
|
+
`ISpanOptions`
|
|
82
|
+
|
|
83
|
+
The options for the span.
|
|
84
|
+
|
|
85
|
+
#### Returns
|
|
86
|
+
|
|
87
|
+
`Promise`\<`ISpan`\>
|
|
88
|
+
|
|
89
|
+
The started span, including its minted context.
|
|
90
|
+
|
|
91
|
+
#### Implementation of
|
|
92
|
+
|
|
93
|
+
`ITracingComponent.startSpan`
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### endSpan() {#endspan}
|
|
98
|
+
|
|
99
|
+
> **endSpan**(`span`, `status?`): `Promise`\<`void`\>
|
|
100
|
+
|
|
101
|
+
End a span, finalizing its status and duration.
|
|
102
|
+
|
|
103
|
+
#### Parameters
|
|
104
|
+
|
|
105
|
+
##### span
|
|
106
|
+
|
|
107
|
+
`ISpan`
|
|
108
|
+
|
|
109
|
+
The span to end.
|
|
110
|
+
|
|
111
|
+
##### status?
|
|
112
|
+
|
|
113
|
+
`SpanStatus`
|
|
114
|
+
|
|
115
|
+
The status to set on the span, defaults to ok.
|
|
116
|
+
|
|
117
|
+
#### Returns
|
|
118
|
+
|
|
119
|
+
`Promise`\<`void`\>
|
|
120
|
+
|
|
121
|
+
A promise that resolves when the span has been ended.
|
|
122
|
+
|
|
123
|
+
#### Implementation of
|
|
124
|
+
|
|
125
|
+
`ITracingComponent.endSpan`
|
|
126
|
+
|
|
127
|
+
***
|
|
128
|
+
|
|
129
|
+
### query() {#query}
|
|
130
|
+
|
|
131
|
+
> **query**(`traceId?`, `spanId?`, `status?`, `kind?`, `timeStart?`, `timeEnd?`, `cursor?`, `limit?`): `Promise`\<\{ `entities`: `ISpan`[]; `cursor?`: `string`; \}\>
|
|
132
|
+
|
|
133
|
+
Query the spans.
|
|
134
|
+
|
|
135
|
+
#### Parameters
|
|
136
|
+
|
|
137
|
+
##### traceId?
|
|
138
|
+
|
|
139
|
+
`string`
|
|
140
|
+
|
|
141
|
+
The id of the trace to filter by.
|
|
142
|
+
|
|
143
|
+
##### spanId?
|
|
144
|
+
|
|
145
|
+
`string`
|
|
146
|
+
|
|
147
|
+
The id of the span to filter by.
|
|
148
|
+
|
|
149
|
+
##### status?
|
|
150
|
+
|
|
151
|
+
`SpanStatus`
|
|
152
|
+
|
|
153
|
+
The status to filter by.
|
|
154
|
+
|
|
155
|
+
##### kind?
|
|
156
|
+
|
|
157
|
+
`SpanKind`
|
|
158
|
+
|
|
159
|
+
The kind to filter by.
|
|
160
|
+
|
|
161
|
+
##### timeStart?
|
|
162
|
+
|
|
163
|
+
`number`
|
|
164
|
+
|
|
165
|
+
The inclusive start time to filter the span start by, as a timestamp in ms.
|
|
166
|
+
|
|
167
|
+
##### timeEnd?
|
|
168
|
+
|
|
169
|
+
`number`
|
|
170
|
+
|
|
171
|
+
The inclusive end time to filter the span start by, as a timestamp in ms.
|
|
172
|
+
|
|
173
|
+
##### cursor?
|
|
174
|
+
|
|
175
|
+
`string`
|
|
176
|
+
|
|
177
|
+
The cursor to request the next chunk of entities.
|
|
178
|
+
|
|
179
|
+
##### limit?
|
|
180
|
+
|
|
181
|
+
`number`
|
|
182
|
+
|
|
183
|
+
Limit the number of entities to return.
|
|
184
|
+
|
|
185
|
+
#### Returns
|
|
186
|
+
|
|
187
|
+
`Promise`\<\{ `entities`: `ISpan`[]; `cursor?`: `string`; \}\>
|
|
188
|
+
|
|
189
|
+
All the entities for the storage matching the conditions,
|
|
190
|
+
and a cursor which can be used to request more entities.
|
|
191
|
+
|
|
192
|
+
#### Implementation of
|
|
193
|
+
|
|
194
|
+
`ITracingComponent.query`
|
|
195
|
+
|
|
196
|
+
***
|
|
197
|
+
|
|
198
|
+
### getTrace() {#gettrace}
|
|
199
|
+
|
|
200
|
+
> **getTrace**(`traceId`): `Promise`\<`ISpan`[]\>
|
|
201
|
+
|
|
202
|
+
Get all the spans belonging to a trace, ordered by their start time.
|
|
203
|
+
|
|
204
|
+
#### Parameters
|
|
205
|
+
|
|
206
|
+
##### traceId
|
|
207
|
+
|
|
208
|
+
`string`
|
|
209
|
+
|
|
210
|
+
The id of the trace to retrieve.
|
|
211
|
+
|
|
212
|
+
#### Returns
|
|
213
|
+
|
|
214
|
+
`Promise`\<`ISpan`[]\>
|
|
215
|
+
|
|
216
|
+
The spans belonging to the trace, ordered by their start time ascending.
|
|
217
|
+
|
|
218
|
+
#### Implementation of
|
|
219
|
+
|
|
220
|
+
`ITracingComponent.getTrace`
|
package/locales/en.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@twin.org/tracing-rest-client",
|
|
3
|
+
"version": "0.9.2-next.1",
|
|
4
|
+
"description": "Provides a client for interacting with tracing service endpoints from applications and services.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/iotaledger/twin-tracing.git",
|
|
8
|
+
"directory": "packages/tracing-rest-client"
|
|
9
|
+
},
|
|
10
|
+
"author": "martyn.janes@iota.org",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20.0.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@twin.org/api-core": "next",
|
|
18
|
+
"@twin.org/api-models": "next",
|
|
19
|
+
"@twin.org/core": "next",
|
|
20
|
+
"@twin.org/entity": "next",
|
|
21
|
+
"@twin.org/nameof": "next",
|
|
22
|
+
"@twin.org/tracing-models": "0.9.2-next.1",
|
|
23
|
+
"@twin.org/web": "next"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/es/index.js",
|
|
26
|
+
"types": "./dist/types/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
30
|
+
"import": "./dist/es/index.js",
|
|
31
|
+
"default": "./dist/es/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./locales/*.json": "./locales/*.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/es",
|
|
37
|
+
"dist/types",
|
|
38
|
+
"locales",
|
|
39
|
+
"docs"
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"twin",
|
|
43
|
+
"trade",
|
|
44
|
+
"iota",
|
|
45
|
+
"framework",
|
|
46
|
+
"blockchain",
|
|
47
|
+
"tracing"
|
|
48
|
+
],
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "git+https://github.com/iotaledger/twin-tracing/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://twindev.org"
|
|
53
|
+
}
|