@google-cloud/functions-framework
Advanced tools
Comparing version
@@ -5,3 +5,2 @@ import { Request, Response } from './functions'; | ||
executionId?: string; | ||
traceId?: string; | ||
spanId?: string; | ||
@@ -8,0 +7,0 @@ } |
@@ -19,3 +19,2 @@ "use strict"; | ||
executionId: req.executionId, | ||
traceId: req.traceId, | ||
spanId: req.spanId, | ||
@@ -22,0 +21,0 @@ }, () => { |
@@ -6,3 +6,3 @@ "use strict"; | ||
const TRACE_CONTEXT_HEADER_KEY = 'X-Cloud-Trace-Context'; | ||
const TRACE_CONTEXT_PATTERN = /^(?<traceId>\w+)\/(?<spanId>\d+);o=(?<options>.+)$/; | ||
const TRACE_CONTEXT_PATTERN = /^(?<traceId>\w+)\/(?<spanId>\d+)(?:;o=(?<options>.+))?$/; | ||
function generateExecutionId() { | ||
@@ -23,5 +23,3 @@ const timestampPart = Date.now().toString(36).slice(-6); | ||
if (match === null || match === void 0 ? void 0 : match.groups) { | ||
const { traceId, spanId } = match.groups; | ||
req.traceId = traceId; | ||
req.spanId = spanId; | ||
req.spanId = match.groups.spanId; | ||
} | ||
@@ -28,0 +26,0 @@ } |
@@ -23,6 +23,2 @@ /// <reference types="node" /> | ||
/** | ||
* Cloud Trace trace ID. | ||
*/ | ||
traceId?: string; | ||
/** | ||
* Cloud Trace span ID. | ||
@@ -29,0 +25,0 @@ */ |
/// <reference types="node" /> | ||
import * as express from 'express'; | ||
export declare const EXECUTION_CONTEXT_LABELS_KEY = "logging.googleapis.com/labels"; | ||
export declare const EXECUTION_CONTEXT_TRACE_KEY = "logging.googleapis.com/trace"; | ||
export declare const EXECUTION_CONTEXT_SPAN_ID_KEY = "logging.googleapis.com/spanId"; | ||
@@ -6,0 +5,0 @@ /** |
@@ -16,3 +16,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getModifiedData = exports.splitArgs = exports.errorHandler = exports.loggingHandlerAddExecutionContext = exports.sendCrashResponse = exports.EXECUTION_CONTEXT_SPAN_ID_KEY = exports.EXECUTION_CONTEXT_TRACE_KEY = exports.EXECUTION_CONTEXT_LABELS_KEY = void 0; | ||
exports.getModifiedData = exports.splitArgs = exports.errorHandler = exports.loggingHandlerAddExecutionContext = exports.sendCrashResponse = exports.EXECUTION_CONTEXT_SPAN_ID_KEY = exports.EXECUTION_CONTEXT_LABELS_KEY = void 0; | ||
const types_1 = require("./types"); | ||
@@ -22,3 +22,2 @@ const async_local_storage_1 = require("./async_local_storage"); | ||
exports.EXECUTION_CONTEXT_LABELS_KEY = 'logging.googleapis.com/labels'; | ||
exports.EXECUTION_CONTEXT_TRACE_KEY = 'logging.googleapis.com/trace'; | ||
exports.EXECUTION_CONTEXT_SPAN_ID_KEY = 'logging.googleapis.com/spanId'; | ||
@@ -123,3 +122,2 @@ const SEVERITY = 'severity'; | ||
[exports.EXECUTION_CONTEXT_LABELS_KEY]: { execution_id: context.executionId }, | ||
[exports.EXECUTION_CONTEXT_TRACE_KEY]: context.traceId, | ||
[exports.EXECUTION_CONTEXT_SPAN_ID_KEY]: context.spanId, | ||
@@ -136,7 +134,6 @@ }; | ||
} | ||
return { | ||
...json, | ||
[exports.EXECUTION_CONTEXT_TRACE_KEY]: context.traceId, | ||
[exports.EXECUTION_CONTEXT_SPAN_ID_KEY]: context.spanId, | ||
}; | ||
if (!(exports.EXECUTION_CONTEXT_SPAN_ID_KEY in json)) { | ||
json[exports.EXECUTION_CONTEXT_SPAN_ID_KEY] = context.spanId; | ||
} | ||
return json; | ||
} | ||
@@ -143,0 +140,0 @@ function processData(data, encoding) { |
{ | ||
"name": "@google-cloud/functions-framework", | ||
"version": "3.4.4", | ||
"version": "3.4.5", | ||
"description": "FaaS (Function as a service) framework for writing portable Node.js functions", | ||
@@ -5,0 +5,0 @@ "engines": { |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
121381
-0.38%2475
-0.48%