Skip to content

Commit 323b0e4

Browse files
committed
Add debug log when cloud.account.id symlink is not available
1 parent 7810e9d commit 323b0e4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/LambdaResource.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@
2323
import java.nio.file.Path;
2424
import java.nio.file.Paths;
2525
import java.util.Map;
26+
import java.util.logging.Level;
27+
import java.util.logging.Logger;
2628
import java.util.stream.Stream;
2729

2830
/** A factory for a {@link Resource} which provides information about the AWS Lambda function. */
2931
public final class LambdaResource {
3032

33+
private static final Logger logger = Logger.getLogger(LambdaResource.class.getName());
34+
3135
private static final String ACCOUNT_ID_SYMLINK_PATH = "/tmp/.otel-aws-account-id";
3236

3337
private static final Resource INSTANCE = buildResource();
@@ -78,7 +82,7 @@ static Resource buildResource(Map<String, String> environmentVariables, Path acc
7882
builder.put(CLOUD_ACCOUNT_ID, accountId);
7983
}
8084
} catch (IOException | UnsupportedOperationException e) {
81-
// Symlink doesn't exist or readlink not supported — silently skip
85+
logger.log(Level.FINE, "cloud.account.id not available via symlink", e);
8286
}
8387

8488
return Resource.create(builder.build(), SchemaUrls.V1_25_0);

0 commit comments

Comments
 (0)