Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dhilpipre committed Mar 12, 2024
1 parent e823421 commit f3e4158
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
.git
.github
/.metadata/
.settings
.classpath
.project
build
bin
Binary file modified apache-sling-event/build/libs/apache-sling-event.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions apache-sling-event/build/tmp/jar/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Implementation-Title: com.newrelic.instrumentation.labs.apache-sling-j
obs
Implementation-Title: com.newrelic.instrumentation.labs.apache-sling-e
vent
Implementation-Version: 1.0
Implementation-Vendor-Id: com.newrelic.labs
Implementation-Vendor: New Relic Labs
Expand Down
60 changes: 60 additions & 0 deletions apache-sling-event/build/verifier/passes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,63 @@ apache-sling-event org.apache.sling:org.apache.sling.event:4.2.10
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.12
apache-sling-event org.apache.sling:org.apache.sling.event:4.0.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.18
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.8
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.6
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.4
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.8
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.24
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.6
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.14
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.12
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.22
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.20
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.12
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.18
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.1.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.0.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.0.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.10
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.8
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.6
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.4
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.12
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.6
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.8
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.14
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.24
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.20
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.22
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.12
apache-sling-event org.apache.sling:org.apache.sling.event:4.1.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.0.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.10
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.0.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.18
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.8
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.14
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.6
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.3.12
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.8
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.4
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.6
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.24
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.10
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.18
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.20
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.22
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.12
apache-sling-event org.apache.sling:org.apache.sling.event:4.2.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.1.0
apache-sling-event org.apache.sling:org.apache.sling.event:4.0.2
apache-sling-event org.apache.sling:org.apache.sling.event:4.0.0
10 changes: 4 additions & 6 deletions apache-sling-scripting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
implementation 'org.apache.sling:org.apache.sling.scripting.core:2.2.0'
implementation 'javax.servlet:javax.servlet-api:3.1.0'
// https://mvnrepository.com/artifact/org.apache.sling/org.apache.sling.api
compileOnly group: 'org.apache.sling', name: 'org.apache.sling.api', version: '2.22.0'
compileOnly 'org.apache.sling:org.apache.sling.api:2.22.0'

// New Relic Java Agent dependencies
implementation 'com.newrelic.agent.java:newrelic-agent:6.4.0'
Expand All @@ -26,9 +26,7 @@ jar {
}

verifyInstrumentation {
// Verifier plugin documentation:
// https://github.com/newrelic/newrelic-gradle-verify-instrumentation
// Example:
// passes 'javax.servlet:servlet-api:[2.2,2.5]'
// exclude 'javax.servlet:servlet-api:2.4.public_draft'
passes('org.apache.sling:org.apache.sling.scripting.core:[2.2.0,)') {
compile 'org.apache.sling:org.apache.sling.api:2.22.0'
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
package org.apache.sling.scripting.core.impl;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.apache.sling.api.scripting.SlingBindings;

import com.newrelic.api.agent.NewRelic;
import com.newrelic.api.agent.Trace;
import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.Weaver;

@Weave
abstract class DefaultSlingScript {

public abstract String getServletName();

@Trace
public void service(ServletRequest req, ServletResponse res) {
NewRelic.getAgent().getTracedMethod().setMetricName("Custom","Sling","DefaultSlingScript","service",getServletName());

Weaver.callOriginal();
}

@Trace
public Object call(SlingBindings props, String method, Object... args) {
NewRelic.getAgent().getTracedMethod().addCustomAttribute("Method", method);
NewRelic.getAgent().getTracedMethod().setMetricName("Custom","Sling","DefaultSlingScript","call");
return Weaver.callOriginal();
}
}

0 comments on commit f3e4158

Please sign in to comment.