Skip to content

Instantly share code, notes, and snippets.

@CharlesLuxinger
Last active July 3, 2021 18:02
Show Gist options
  • Save CharlesLuxinger/5d138ec22f7e208baed480cc150dda9f to your computer and use it in GitHub Desktop.
Save CharlesLuxinger/5d138ec22f7e208baed480cc150dda9f to your computer and use it in GitHub Desktop.
Ignore Spring Actuator Endpoint in New Relic Transactions Metrics
FROM adoptopenjdk/openjdk11:jre-11.0.9.1_1-alpine
VOLUME /tmp
COPY ./app.jar .
COPY ./newrelic-custom-instrumentation.xml ./extensions/newrelic-custom-instrumentation.xml
COPY ./newrelic.yml .
CMD java -javaagent:newrelic.jar
<?xml version="1.0" encoding="UTF-8"?>
<extension xmlns="https://newrelic.com/docs/java/xsd/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="newrelic-extension extension.xsd " name="newrelic-custom-instrumentation"
version="1.0" enabled="true">
<instrumentation>
<pointcut ignoreTransaction="true" excludeFromTransactionTrace="true" transactionType="web">
<className>
org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler
</className>
<method>
<name>handle</name>
</method>
</pointcut>
</instrumentation>
</extension>
common: &default_settings
error_collector:
ignore_status_codes: 404
class_transformer:
com.newrelic.instrumentation.servlet-user:
enabled: false
com.newrelic.instrumentation.spring-aop-2:
enabled: false
classloader_excludes:
org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment