Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
*
* * Copyright 2025 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package com.nr.agent.instrumentation.micronaut;

import com.newrelic.agent.bridge.AgentBridge;
import com.newrelic.api.agent.NewRelic;
import com.newrelic.api.agent.Token;
import com.newrelic.api.agent.Trace;

import java.util.function.BiConsumer;

public class NRBiConsumerTokenWrapper<R> implements BiConsumer<R, Throwable> {
BiConsumer<R, Throwable> delegate = null;
private static boolean isTransformed = false;


public NRBiConsumerTokenWrapper(BiConsumer<R, Throwable> d) {
delegate = d;
if(!isTransformed) {
isTransformed = true;
AgentBridge.instrumentation.retransformUninstrumentedClass(getClass());
}
}

@Override
@Trace(dispatcher = true)
public void accept(R r, Throwable throwable) {
if(throwable != null) {
NewRelic.noticeError(throwable);
}
if(delegate != null) {
delegate.accept(r, throwable);
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.micronaut.core.execution;

import com.newrelic.api.agent.Trace;
import com.newrelic.api.agent.weaver.*;

import java.util.function.BiConsumer;

@Weave(originalName = "io.micronaut.core.execution.ExecutionFlow", type = MatchType.Interface)
public class ExecutionFlow_Instrumentation<T> {

@Trace
public ImperativeExecutionFlow<T> tryComplete() {
return Weaver.callOriginal();
}

@Trace
public void onComplete(BiConsumer<? super T, Throwable> fn) {
Weaver.callOriginal();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.micronaut.core.propagation;

import com.newrelic.api.agent.weaver.SkipIfPresent;

/**
* Necessary to keep from instrumenting 4.3.0 and higher because instrumentation for 4.3.0 includes
* instrumentation for new functionality
*/
@SkipIfPresent(originalName = "io.micronaut.core.propagation.ThreadContext")
public class ThreadContext_Skip {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
*
* * Copyright 2025 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package com.nr.agent.instrumentation.micronaut;

import com.newrelic.agent.bridge.AgentBridge;
import com.newrelic.api.agent.NewRelic;
import com.newrelic.api.agent.Token;
import com.newrelic.api.agent.Trace;

import java.util.function.BiConsumer;

public class NRBiConsumerTokenWrapper<R> implements BiConsumer<R, Throwable> {
BiConsumer<R, Throwable> delegate = null;
private static boolean isTransformed = false;


public NRBiConsumerTokenWrapper(BiConsumer<R, Throwable> d) {
delegate = d;
if(!isTransformed) {
isTransformed = true;
AgentBridge.instrumentation.retransformUninstrumentedClass(getClass());
}
}

@Override
@Trace(dispatcher = true)
public void accept(R r, Throwable throwable) {
if(throwable != null) {
NewRelic.noticeError(throwable);
}
if(delegate != null) {
delegate.accept(r, throwable);
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package io.micronaut.core.execution;

import com.newrelic.api.agent.Trace;
import com.newrelic.api.agent.weaver.*;

import java.util.function.BiConsumer;

@Weave(originalName = "io.micronaut.core.execution.ExecutionFlow", type = MatchType.Interface)
public class ExecutionFlow_Instrumentation<T> {

@Trace
public ImperativeExecutionFlow<T> tryComplete() {
return Weaver.callOriginal();
}

@Trace
public T tryCompleteValue() {
return Weaver.callOriginal();
}

@Trace
public Throwable tryCompleteError() {
return Weaver.callOriginal();
}

@Trace
public void onComplete(BiConsumer<? super T, Throwable> fn) {
Weaver.callOriginal();
}
}
Loading
Loading