generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 98
feat: Support CRaC priming for powertools-tracing #2121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
dcabib
wants to merge
17
commits into
aws-powertools:main
from
dcabib:feat/crac-priming-tracing-issue-2004
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
eea14d7
feat: Support CRaC priming for powertools-tracing and powertools-seri…
dcabib 9fb3739
Address PR review feedback from Philipp
dcabib 786a16a
feat: Support CRaC priming for powertools-tracing
dcabib fdbb6db
fix: Support provisioned concurrency in cold start detection
dcabib 136a3fa
fix: Address SonarQube issues in CRaC implementation
dcabib ea2d50c
fix: Simplify isColdStart method to single return statement
dcabib 71d2247
fix: Address Critical SonarQube issue with thread-safe ObjectMapper i…
dcabib bd2db02
fix: Suppress SonarQube singleton pattern warning for CRaC Resource
dcabib 0167d2b
fix: Use NOSONAR comment to suppress singleton pattern warning
dcabib f42d4a9
fix: Remove NOSONAR comment and use clean MetricsFactory pattern
dcabib 10f4890
fix: Add SonarQube exclusion for singleton pattern in CRaC implementa…
dcabib 711ada7
trigger: Force SonarCloud re-analysis with exclusion rules
dcabib 99b7422
fix: Use DynamoDB constructor registration pattern to eliminate singl…
dcabib d8f89ad
Merge branch 'main' into feat/crac-priming-tracing-issue-2004
dreamorosi e2865e3
fix: Add GraalVM compatibility for CRaC tracing functionality
dcabib e2d934f
fix: Address PR review feedback from @dreamorosi
dcabib 0959c63
fix: Use correct license header for TracingUtilsCracTest.java
dcabib File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,66 @@ | ||
| java.lang.Object | ||
| java.io.Serializable | ||
| java.lang.Comparable | ||
| java.lang.CharSequence | ||
| java.lang.String | ||
| java.lang.Class | ||
| java.lang.Cloneable | ||
| java.lang.ClassLoader | ||
| java.lang.System | ||
| java.lang.Throwable | ||
| java.lang.Error | ||
| java.lang.Exception | ||
| java.lang.RuntimeException | ||
| com.amazonaws.xray.AWSXRay | ||
| com.amazonaws.xray.entities.Entity | ||
| com.amazonaws.xray.entities.Subsegment | ||
| com.amazonaws.xray.entities.Segment | ||
| com.amazonaws.xray.entities.TraceID | ||
| com.amazonaws.xray.entities.TraceHeader | ||
| com.amazonaws.xray.strategy.sampling.SamplingStrategy | ||
| com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy | ||
| com.amazonaws.xray.strategy.sampling.NoSamplingStrategy | ||
| com.amazonaws.xray.strategy.sampling.AllSamplingStrategy | ||
| com.amazonaws.xray.strategy.sampling.CentralizedSamplingStrategy | ||
| com.amazonaws.xray.strategy.ContextMissingStrategy | ||
| com.amazonaws.xray.strategy.LogErrorContextMissingStrategy | ||
| com.amazonaws.xray.strategy.RuntimeErrorContextMissingStrategy | ||
| com.amazonaws.xray.strategy.IgnoreErrorContextMissingStrategy | ||
| com.amazonaws.xray.contexts.LambdaSegmentContext | ||
| com.amazonaws.xray.contexts.SegmentContext | ||
| com.amazonaws.xray.contexts.ThreadLocalSegmentContext | ||
| com.amazonaws.xray.emitters.Emitter | ||
| com.amazonaws.xray.emitters.UDPEmitter | ||
| com.amazonaws.xray.listeners.SegmentListener | ||
| com.amazonaws.xray.plugins.Plugin | ||
| com.amazonaws.xray.plugins.ECSPlugin | ||
| com.amazonaws.xray.plugins.EC2Plugin | ||
| com.amazonaws.xray.plugins.EKSPlugin | ||
| software.amazon.lambda.powertools.tracing.TracingUtils | ||
| software.amazon.lambda.powertools.tracing.Tracing | ||
| software.amazon.lambda.powertools.tracing.CaptureMode | ||
| software.amazon.lambda.powertools.tracing.internal.LambdaTracingAspect | ||
| software.amazon.lambda.powertools.common.internal.LambdaHandlerProcessor | ||
| software.amazon.lambda.powertools.common.internal.LambdaConstants | ||
| com.fasterxml.jackson.databind.ObjectMapper | ||
| com.fasterxml.jackson.databind.JsonNode | ||
| com.fasterxml.jackson.databind.node.ObjectNode | ||
| com.fasterxml.jackson.databind.node.ArrayNode | ||
| com.fasterxml.jackson.databind.node.TextNode | ||
| com.fasterxml.jackson.databind.node.NumericNode | ||
| com.fasterxml.jackson.databind.node.BooleanNode | ||
| com.fasterxml.jackson.databind.node.NullNode | ||
| com.fasterxml.jackson.core.JsonFactory | ||
| com.fasterxml.jackson.core.JsonGenerator | ||
| com.fasterxml.jackson.core.JsonParser | ||
| com.fasterxml.jackson.core.JsonToken | ||
| com.fasterxml.jackson.databind.DeserializationFeature | ||
| com.fasterxml.jackson.databind.SerializationFeature | ||
| com.fasterxml.jackson.databind.MapperFeature | ||
| com.fasterxml.jackson.databind.JsonSerializer | ||
| com.fasterxml.jackson.databind.JsonDeserializer | ||
| com.fasterxml.jackson.databind.SerializerProvider | ||
| com.fasterxml.jackson.databind.DeserializationContext | ||
| org.slf4j.Logger | ||
| org.slf4j.LoggerFactory | ||
| org.slf4j.MDC |
45 changes: 45 additions & 0 deletions
45
...tracing/src/test/java/software/amazon/lambda/powertools/tracing/TracingUtilsCracTest.java
This file contains hidden or 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,45 @@ | ||
| /* | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| * this software and associated documentation files (the "Software"), to deal in | ||
| * the Software without restriction, including without limitation the rights to | ||
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| * the Software, and to permit persons to whom the Software is furnished to do so. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
| * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| */ | ||
|
|
||
| package software.amazon.lambda.powertools.tracing; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThatNoException; | ||
| import static org.mockito.Mockito.mock; | ||
|
|
||
| import java.lang.reflect.Field; | ||
| import org.crac.Context; | ||
| import org.crac.Resource; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| class TracingUtilsCracTest { | ||
|
|
||
| Context<Resource> context = mock(Context.class); | ||
|
|
||
| @Test | ||
| void testPrimeMethodDoesNotThrowException() { | ||
| assertThatNoException().isThrownBy(() -> TracingUtils.prime()); | ||
| } | ||
|
|
||
| @Test | ||
| void testTracingUtilsLoadsSuccessfully() { | ||
| // Simply calling TracingUtils.prime() should trigger CRaC registration | ||
| assertThatNoException().isThrownBy(() -> TracingUtils.prime()); | ||
|
|
||
| // Verify that TracingUtils class is loaded and accessible | ||
| assertThatNoException().isThrownBy(() -> TracingUtils.objectMapper()); | ||
| } | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being excluded from the spotbugs configuration?