-
Notifications
You must be signed in to change notification settings - Fork 790
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AWS lambda - configurable flush timeout (#1960)
- Loading branch information
Showing
7 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...y/src/main/java/io/opentelemetry/instrumentation/awslambda/v1_0/WrapperConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.awslambda.v1_0; | ||
|
||
public final class WrapperConfiguration { | ||
|
||
private WrapperConfiguration() {} | ||
|
||
public static final String OTEL_LAMBDA_FLUSH_TIMEOUT_ENV_KEY = | ||
"OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT"; | ||
public static final long OTEL_LAMBDA_FLUSH_TIMEOUT_DEFAULT = 1; | ||
|
||
public static final long flushTimeout() { | ||
String lambdaFlushTimeout = System.getenv(OTEL_LAMBDA_FLUSH_TIMEOUT_ENV_KEY); | ||
if (lambdaFlushTimeout != null && !lambdaFlushTimeout.isEmpty()) { | ||
try { | ||
return Long.parseLong(lambdaFlushTimeout); | ||
} catch (NumberFormatException nfe) { | ||
// ignored - default used | ||
} | ||
} | ||
return OTEL_LAMBDA_FLUSH_TIMEOUT_DEFAULT; | ||
} | ||
} |