-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Warn if OpenTracing is detected (#2513)
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 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
26 changes: 26 additions & 0 deletions
26
src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AwsLambda/OpenTracingWrapper.cs
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,26 @@ | ||
// Copyright 2020 New Relic, Inc. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
using NewRelic.Agent.Api; | ||
using NewRelic.Agent.Extensions.Providers.Wrapper; | ||
|
||
namespace NewRelic.Providers.Wrapper.AwsLambda | ||
{ | ||
public class OpenTracingWrapper : IWrapper | ||
{ | ||
private const string WrapperName = "OpenTracingWrapper"; | ||
|
||
public bool IsTransactionRequired => false; | ||
|
||
public CanWrapResponse CanWrap(InstrumentedMethodInfo methodInfo) | ||
{ | ||
return new CanWrapResponse(WrapperName.Equals(methodInfo.RequestedWrapperName)); | ||
} | ||
|
||
public AfterWrappedMethodDelegate BeforeWrappedMethod(InstrumentedMethodCall instrumentedMethodCall, IAgent agent, ITransaction transaction) | ||
{ | ||
agent.Logger.Log(Agent.Extensions.Logging.Level.Warn, "OpenTracing is not compatible with the full .NET Agent and may result in undefined behavior. Please remove OpenTracing from your application."); | ||
return Delegates.NoOp; | ||
} | ||
} | ||
} |