Component
Detector: AWS Lambda
Describe the issue you're facing
The detector does not fail gracefully if not run in Lambda, so can't be used generically.
This is inconsistent with, e.g. the EKS detector that no-ops once it determines it's not in-cluster, returns gracefully
Expected behavior
No error returned when detector is not used in Lambda env:
// Lambda resources come from ENV
lambdaName := os.Getenv(lambdaFunctionNameEnvVar)
if lambdaName == "" {
return empty, errNotOnLambda
}
⬇️
// Lambda resources come from ENV
lambdaName := os.Getenv(lambdaFunctionNameEnvVar)
if lambdaName == "" {
return empty, nil
}
Steps to Reproduce
res, err := resource.New(
ctx,
resource.WithDetectors(
lambdadetector.NewResourceDetector(),
),
)
And launch locally.
Operating System
Linux (distroless/container)
Device Architecture
ARM64
Go Version
1.25.7
Component Version
v0.66.0
Component
Detector: AWS Lambda
Describe the issue you're facing
The detector does not fail gracefully if not run in Lambda, so can't be used generically.
This is inconsistent with, e.g. the EKS detector that no-ops once it determines it's not in-cluster, returns gracefully
Expected behavior
No error returned when detector is not used in Lambda env:
⬇️
Steps to Reproduce
And launch locally.
Operating System
Linux (distroless/container)
Device Architecture
ARM64
Go Version
1.25.7
Component Version
v0.66.0