diff --git a/front/src/utils/handoff.js b/front/src/utils/handoff.js new file mode 100644 index 000000000..74c36b3ce --- /dev/null +++ b/front/src/utils/handoff.js @@ -0,0 +1,25 @@ +/** + * StackBlaze handoff context. Users minted by the embedding product's + * handoff (api/handoff.go) carry a synthetic @handoff.local email, and the + * consume step stores where the product is (coroot_return_url cookie). + */ +export function isHandoffUser(api) { + const email = (api && api.auth && api.auth.user && api.auth.user.email) || ''; + return email.endsWith('@handoff.local'); +} + +/** The embedding product's origin (https://dashboard…), or '' when unknown. */ +export function returnUrlOrigin() { + const m = document.cookie.match(/(?:^|; )coroot_return_url=([^;]*)(?:;|$)/); + if (!m) { + return ''; + } + try { + return new URL(decodeURIComponent(m[1])).origin; + } catch { + return ''; + } +} + +/** The platform's OpenTelemetry collector, reachable from every app namespace. */ +export const PLATFORM_OTLP_ENDPOINT = 'http://otel-collector.otel.svc:4318'; diff --git a/front/src/views/OpenTelemetryIntegration.vue b/front/src/views/OpenTelemetryIntegration.vue index ceb6f00ed..85e69880e 100644 --- a/front/src/views/OpenTelemetryIntegration.vue +++ b/front/src/views/OpenTelemetryIntegration.vue @@ -5,7 +5,41 @@ - + + +
+ Send traces from your apps + + mdi-close +
+

+ Traces show every request's path through an app. Your apps never talk to Coroot directly: the platform collects their traces and keeps + them private to your workspace. +

+ +
1. Automatic (recommended)
+

+ In StackBlaze, open the app's settings and turn Tracing on. Java, Node.js, Python and .NET apps are instrumented on their next + deploy, with no code changes. +

+ Open StackBlaze + +
2. Your own OpenTelemetry SDK
+

+ Already instrumented (Go, PHP, Ruby, Rust, …)? Turn Tracing on for the app with Other: my own OpenTelemetry SDK and point the + SDK at the platform collector: +

+ + OTEL_EXPORTER_OTLP_ENDPOINT={{ platformEndpoint }} + OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf OTEL_SERVICE_NAME=<your app name> + +

+ No API key is needed: the collector accepts traces only from apps with Tracing on and tags them with your workspace. +

+
+
OpenTelemetry Integration @@ -132,6 +166,7 @@ service: