UNPKG

@aws-lambda-powertools/tracer

Version:
65 lines (64 loc) 2.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.environmentVariablesService = exports.EnvironmentVariablesService = void 0; const commons_1 = require("@aws-lambda-powertools/commons"); class EnvironmentVariablesService extends commons_1.EnvironmentVariablesService { // Environment variables awsExecutionEnv = 'AWS_EXECUTION_ENV'; samLocalVariable = 'AWS_SAM_LOCAL'; tracerCaptureErrorVariable = 'POWERTOOLS_TRACER_CAPTURE_ERROR'; tracerCaptureHTTPsRequestsVariable = 'POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS'; tracerCaptureResponseVariable = 'POWERTOOLS_TRACER_CAPTURE_RESPONSE'; tracingEnabledVariable = 'POWERTOOLS_TRACE_ENABLED'; /** * It returns the value of the AWS_EXECUTION_ENV environment variable. * * @returns {string} */ getAwsExecutionEnv() { return this.get(this.awsExecutionEnv); } /** * It returns the value of the POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS environment variable. * * @returns {string} */ getCaptureHTTPsRequests() { return this.get(this.tracerCaptureHTTPsRequestsVariable); } /** * It returns the value of the AWS_SAM_LOCAL environment variable. * * @returns {string} */ getSamLocal() { return this.get(this.samLocalVariable); } /** * It returns the value of the POWERTOOLS_TRACER_CAPTURE_ERROR environment variable. * * @returns {string} */ getTracingCaptureError() { return this.get(this.tracerCaptureErrorVariable); } /** * It returns the value of the POWERTOOLS_TRACER_CAPTURE_RESPONSE environment variable. * * @returns {string} */ getTracingCaptureResponse() { return this.get(this.tracerCaptureResponseVariable); } /** * It returns the value of the POWERTOOLS_TRACE_ENABLED environment variable. * * @returns {string} */ getTracingEnabled() { return this.get(this.tracingEnabledVariable); } } exports.EnvironmentVariablesService = EnvironmentVariablesService; const environmentVariablesService = new EnvironmentVariablesService(); exports.environmentVariablesService = environmentVariablesService;