diff --git a/src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AwsLambda/Instrumentation.xml b/src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AwsLambda/Instrumentation.xml index f59d19a0e0..436a2878f1 100644 --- a/src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AwsLambda/Instrumentation.xml +++ b/src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AwsLambda/Instrumentation.xml @@ -11,5 +11,11 @@ SPDX-License-Identifier: Apache-2.0 + + + + + + diff --git a/src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AwsLambda/OpenTracingWrapper.cs b/src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AwsLambda/OpenTracingWrapper.cs new file mode 100644 index 0000000000..24f1dff237 --- /dev/null +++ b/src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AwsLambda/OpenTracingWrapper.cs @@ -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; + } + } +}