We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36007c8 commit 39cad37Copy full SHA for 39cad37
detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsLambdaDetectorSync.ts
@@ -28,8 +28,12 @@ import {
28
*/
29
export class AwsLambdaDetectorSync implements DetectorSync {
30
detect(): IResource {
31
- const awsRegion = process.env.AWS_REGION;
32
const functionName = process.env.AWS_LAMBDA_FUNCTION_NAME;
+ if (!functionName) {
33
+ return Resource.empty();
34
+ }
35
+
36
+ const awsRegion = process.env.AWS_REGION;
37
const functionVersion = process.env.AWS_LAMBDA_FUNCTION_VERSION;
38
const logGroupName = process.env.AWS_LAMBDA_LOG_GROUP_NAME;
39
const logStreamName = process.env.AWS_LAMBDA_LOG_STREAM_NAME;
0 commit comments