create-zuplo-api 6.71.13 → 6.71.15
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.
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { OpenTelemetryPlugin } from "@zuplo/otel";
|
|
1
2
|
import { RuntimeExtensions } from "@zuplo/runtime";
|
|
2
3
|
import { McpGatewayPlugin } from "@zuplo/runtime/mcp-gateway";
|
|
3
4
|
|
|
4
|
-
// To enable the optional examples below, install the relevant package(s) and
|
|
5
|
-
// uncomment the matching import:
|
|
6
|
-
// import { OpenTelemetryPlugin } from "@zuplo/otel";
|
|
7
|
-
// import { DataDogLoggingPlugin, environment } from "@zuplo/runtime";
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* `runtimeInit` runs once when your gateway boots. Use it to register plugins
|
|
11
7
|
* and lifecycle hooks. Docs:
|
|
@@ -19,34 +15,23 @@ export function runtimeInit(runtime: RuntimeExtensions) {
|
|
|
19
15
|
// Docs: https://zuplo.com/docs/mcp-server/introduction
|
|
20
16
|
//
|
|
21
17
|
// Remove this plugin if you are not using the MCP Gateway features.
|
|
22
|
-
runtime.addPlugin(
|
|
23
|
-
new McpGatewayPlugin({
|
|
24
|
-
// basePath: "/", // defaults to /__zuplo
|
|
25
|
-
})
|
|
26
|
-
);
|
|
18
|
+
runtime.addPlugin(new McpGatewayPlugin());
|
|
27
19
|
|
|
28
20
|
// --- OpenTelemetry tracing (optional) ------------------------------------
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
// Docs: https://zuplo.com/docs/articles/opentelemetry
|
|
21
|
+
// Send traces to Zuplo's built-in tracing. This can also be configured to
|
|
22
|
+
// send traces to a third-party service such as Honeycomb, Grafana, and
|
|
23
|
+
// others. Docs: https://zuplo.com/docs/articles/opentelemetry
|
|
33
24
|
//
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
// exporter: {
|
|
37
|
-
// url: "https://otel-collector.example.com/v1/traces",
|
|
38
|
-
// headers: { "api-key": environment.OTEL_API_KEY },
|
|
39
|
-
// },
|
|
40
|
-
// service: { name: "my-api", version: "1.0.0" },
|
|
41
|
-
// }),
|
|
42
|
-
// );
|
|
25
|
+
// Remove this plugin if you are not using OpenTelemetry tracing.
|
|
26
|
+
runtime.addPlugin(new OpenTelemetryPlugin());
|
|
43
27
|
|
|
44
|
-
// ---
|
|
28
|
+
// --- Logging (optional) --------------------------------------------------
|
|
45
29
|
// Ship request logs to Datadog. Other log integrations (New Relic, Splunk,
|
|
46
30
|
// Loki, Dynatrace, and others) follow the same pattern — see the logging
|
|
47
31
|
// overview at https://zuplo.com/docs/articles/logging.
|
|
48
32
|
// Docs: https://zuplo.com/docs/articles/log-plugin-datadog
|
|
49
33
|
//
|
|
34
|
+
// To enable, import the plugin and `environment` from "@zuplo/runtime":
|
|
50
35
|
// runtime.addPlugin(
|
|
51
36
|
// new DataDogLoggingPlugin({
|
|
52
37
|
// apiKey: environment.DATADOG_API_KEY,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { OpenTelemetryPlugin } from "@zuplo/otel";
|
|
2
|
+
import { RuntimeExtensions } from "@zuplo/runtime";
|
|
3
|
+
import { McpGatewayPlugin } from "@zuplo/runtime/mcp-gateway";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `runtimeInit` runs once when your gateway boots. Use it to register plugins
|
|
7
|
+
* and lifecycle hooks. Docs:
|
|
8
|
+
* https://zuplo.com/docs/programmable-api/runtime-extensions
|
|
9
|
+
*/
|
|
10
|
+
export function runtimeInit(runtime: RuntimeExtensions) {
|
|
11
|
+
// --- MCP Gateway ---------------------------------------------------------
|
|
12
|
+
// Registers the MCP Gateway, which adds the OAuth and upstream-connection
|
|
13
|
+
// routes used to expose and secure MCP servers through your gateway. It is a
|
|
14
|
+
// no-op until you add an MCP route/policy, so it is safe to leave enabled.
|
|
15
|
+
// Docs: https://zuplo.com/docs/mcp-server/introduction
|
|
16
|
+
//
|
|
17
|
+
// Remove this plugin if you are not using the MCP Gateway features.
|
|
18
|
+
runtime.addPlugin(new McpGatewayPlugin());
|
|
19
|
+
|
|
20
|
+
// --- OpenTelemetry tracing (optional) ------------------------------------
|
|
21
|
+
// Send traces to Zuplo's built-in tracing. This can also be configured to
|
|
22
|
+
// send traces to a third-party service such as Honeycomb, Grafana, and
|
|
23
|
+
// others. Docs: https://zuplo.com/docs/articles/opentelemetry
|
|
24
|
+
//
|
|
25
|
+
// Remove this plugin if you are not using OpenTelemetry tracing.
|
|
26
|
+
runtime.addPlugin(new OpenTelemetryPlugin());
|
|
27
|
+
|
|
28
|
+
// --- Logging (optional) --------------------------------------------------
|
|
29
|
+
// Ship request logs to Datadog. Other log integrations (New Relic, Splunk,
|
|
30
|
+
// Loki, Dynatrace, and others) follow the same pattern — see the logging
|
|
31
|
+
// overview at https://zuplo.com/docs/articles/logging.
|
|
32
|
+
// Docs: https://zuplo.com/docs/articles/log-plugin-datadog
|
|
33
|
+
//
|
|
34
|
+
// To enable, import the plugin and `environment` from "@zuplo/runtime":
|
|
35
|
+
// runtime.addPlugin(
|
|
36
|
+
// new DataDogLoggingPlugin({
|
|
37
|
+
// apiKey: environment.DATADOG_API_KEY,
|
|
38
|
+
// source: "my-api",
|
|
39
|
+
// }),
|
|
40
|
+
// );
|
|
41
|
+
}
|