From 312bff95c4492bb94d1fb166fd9f5d77d4c47f87 Mon Sep 17 00:00:00 2001 From: Thomas Schoffelen Date: Mon, 23 Dec 2024 20:16:08 +0000 Subject: [PATCH] feat(otel): set faas.trigger --- src/lib/OpenTelemetry.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/OpenTelemetry.js b/src/lib/OpenTelemetry.js index d74c946..21ec10c 100644 --- a/src/lib/OpenTelemetry.js +++ b/src/lib/OpenTelemetry.js @@ -10,6 +10,8 @@ const { const { ATTR_HTTP_USER_AGENT, ATTR_HTTP_FLAVOR, + ATTR_FAAS_TRIGGER, + FAAS_TRIGGER_VALUE_HTTP, } = require("@opentelemetry/semantic-conventions/incubating"); const isApiGwEvent = (event) => { @@ -85,6 +87,7 @@ class OpenTelemetry { if (isApiGwEvent(event)) { const fullUrl = getFullUrl(event); + span.setAttribute(ATTR_FAAS_TRIGGER, FAAS_TRIGGER_VALUE_HTTP); span.setAttribute(ATTR_HTTP_ROUTE, event.routeKey?.split(" ")[1]); fullUrl && span.setAttribute(ATTR_URL_FULL, fullUrl); span.setAttribute(