Skip to content

Commit

Permalink
feat(otel): set faas.trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed Dec 23, 2024
1 parent 449b6dd commit 312bff9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/OpenTelemetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 312bff9

Please sign in to comment.