-
Notifications
You must be signed in to change notification settings - Fork 669
Add a forceIgnoring mechanism and apply it to the plugins (Spring Clo… #689
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d751b53
Add a forceIgnoring mechanism and apply it to the plugins (Spring Clo…
gzlicanyi e5d4a48
Fix the continued call within the createLocalSpan method.
gzlicanyi b579dcf
Add a forceIgnoring mechanism in a CROSS_THREAD scenario.
gzlicanyi 8a793f4
Revert "Fix the continued call within the createLocalSpan method."
gzlicanyi 1f739cc
Revert "Add a forceIgnoring mechanism and apply it to the plugins (Sp…
gzlicanyi 1aa68cc
Merge branch 'forceIgnoring_by_continued' into forceIgnoring
gzlicanyi c10decc
Merge remote-tracking branch 'old-origin/main' into forceIgnoring
gzlicanyi 77b1dc6
Add ignored flag to span
gzlicanyi a3eda47
fix ContextSnapshot mock
gzlicanyi 0e2368a
Add the IgnoreSnapshot test in CallableOrRunnableInterceptorTest.
gzlicanyi 321eb30
Apply suggestions from code review
gzlicanyi 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
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
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
98 changes: 98 additions & 0 deletions
98
...core/src/test/java/org/apache/skywalking/apm/agent/core/context/ContinuedContextTest.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,98 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| */ | ||
|
|
||
| package org.apache.skywalking.apm.agent.core.context; | ||
|
|
||
| import org.apache.skywalking.apm.agent.core.boot.ServiceManager; | ||
| import org.apache.skywalking.apm.agent.core.conf.Config; | ||
| import org.apache.skywalking.apm.agent.core.context.ids.NewDistributedTraceId; | ||
| import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; | ||
| import org.apache.skywalking.apm.agent.core.context.trace.LocalSpan; | ||
| import org.apache.skywalking.apm.agent.core.context.trace.NoopSpan; | ||
| import org.apache.skywalking.apm.agent.core.profile.ProfileStatusContext; | ||
| import org.apache.skywalking.apm.agent.core.test.tools.AgentServiceRule; | ||
| import org.apache.skywalking.apm.agent.core.test.tools.SegmentStorage; | ||
| import org.apache.skywalking.apm.agent.core.test.tools.SegmentStoragePoint; | ||
| import org.apache.skywalking.apm.agent.core.test.tools.TracingSegmentRunner; | ||
| import org.junit.AfterClass; | ||
| import org.junit.BeforeClass; | ||
| import org.junit.Rule; | ||
| import org.junit.Test; | ||
| import org.junit.runner.RunWith; | ||
| import org.junit.Assert; | ||
|
|
||
| @RunWith(TracingSegmentRunner.class) | ||
| public class ContinuedContextTest { | ||
|
|
||
| @SegmentStoragePoint | ||
| private SegmentStorage tracingData; | ||
|
|
||
| @Rule | ||
| public AgentServiceRule agentServiceRule = new AgentServiceRule(); | ||
|
|
||
| @BeforeClass | ||
| public static void beforeClass() { | ||
| Config.Agent.KEEP_TRACING = true; | ||
| } | ||
|
|
||
| @AfterClass | ||
| public static void afterClass() { | ||
| Config.Agent.KEEP_TRACING = false; | ||
| ServiceManager.INSTANCE.shutdown(); | ||
| } | ||
|
|
||
| @Test | ||
| public void testContinued() { | ||
|
|
||
| NewDistributedTraceId distributedTraceId = new NewDistributedTraceId(); | ||
| ContextSnapshot snapshot = new ContextSnapshot( | ||
| "1, 2, 3", | ||
| 1, | ||
| distributedTraceId, | ||
| "/for-test-continued", | ||
| new CorrelationContext(), | ||
| new ExtensionContext(), | ||
| ProfileStatusContext.createWithNone() | ||
| ); | ||
|
|
||
| AbstractSpan span = ContextManager.createLocalSpan("test-span"); | ||
| ContextManager.continued(snapshot); | ||
|
|
||
| Assert.assertEquals(distributedTraceId.getId(), ContextManager.getGlobalTraceId()); | ||
| ContextManager.stopSpan(); | ||
| } | ||
|
|
||
| @Test | ||
| public void testContinuedWithIgnoredSnapshot() { | ||
|
|
||
| ContextSnapshot snapshot = | ||
| new ContextSnapshot(null, -1, null, null, new CorrelationContext(), new ExtensionContext(), ProfileStatusContext.createWithNone()); | ||
|
|
||
| AbstractSpan span = ContextManager.createLocalSpan("test-span"); | ||
| ContextManager.continued(snapshot); | ||
|
|
||
| Assert.assertTrue(span instanceof LocalSpan); | ||
|
|
||
| AbstractSpan span2 = ContextManager.createLocalSpan("test-span2"); | ||
| Assert.assertTrue(span2 instanceof NoopSpan); | ||
|
|
||
| ContextManager.stopSpan(); | ||
| ContextManager.stopSpan(); | ||
| } | ||
|
|
||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.