Skip to content

Commit d525d2f

Browse files
committed
♻️ refactor(plugin/tracing): reconstruct skywalking
Signed-off-by: Haili Zhang <[email protected]>
1 parent 32672fa commit d525d2f

File tree

19 files changed

+1157
-2393
lines changed

19 files changed

+1157
-2393
lines changed

docs/generated/api.json

Lines changed: 218 additions & 121 deletions
Large diffs are not rendered by default.

docs/generated/api.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ export interface OpenFunction {
116116
// @public
117117
export const openfunction: (functionName: string, handler: OpenFunction) => void;
118118

119-
// @public
120-
export interface OpenFunctionBinding {
121-
[key: string]: OpenFunctionComponent;
122-
}
123-
124119
// @public
125120
export interface OpenFunctionComponent {
126121
componentName: string;
@@ -132,21 +127,22 @@ export interface OpenFunctionComponent {
132127

133128
// @public
134129
export interface OpenFunctionContext {
135-
inputs?: OpenFunctionBinding;
130+
inputs?: Record<string, OpenFunctionComponent>;
136131
name: string;
137-
outputs?: OpenFunctionBinding;
132+
outputs?: Record<string, OpenFunctionComponent>;
133+
pluginsTracing?: TraceConfig;
138134
port?: string;
139135
postPlugins?: string[];
140136
prePlugins?: string[];
141137
runtime: `${RuntimeType}` | `${Capitalize<RuntimeType>}` | `${Uppercase<RuntimeType>}`;
142-
tracing?: TraceConfig;
143138
version: string;
144139
}
145140

146141
// @public
147142
export abstract class OpenFunctionRuntime {
148143
constructor(context: OpenFunctionContext);
149144
protected readonly context: OpenFunctionContext;
145+
error?: Error;
150146
getPlugin(name: string): Plugin_2;
151147
readonly locals: Record<string, any>;
152148
static Parse(context: OpenFunctionContext): OpenFunctionRuntime;
@@ -193,16 +189,24 @@ export enum RuntimeType {
193189
export interface TraceConfig {
194190
baggage?: Record<string, string>;
195191
enabled: boolean;
196-
provider?: TraceProvider;
197-
tags?: Record<string, string>;
192+
provider: TraceProvider;
193+
tags?: Record<string, string> & {
194+
func?: string;
195+
};
198196
}
199197

200198
// @public
201199
export interface TraceProvider {
202-
name: string;
200+
name: `${TraceProviderType}` | `${Capitalize<TraceProviderType>}` | `${Uppercase<TraceProviderType>}`;
203201
oapServer: string;
204202
}
205203

204+
// @public
205+
export enum TraceProviderType {
206+
OpenTelemetry = "opentelemetry",
207+
SkyWalking = "skywalking"
208+
}
209+
206210
// (No @packageDocumentation comment for this package)
207211

208212
```

output-file.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)