Skip to content

Commit

Permalink
New API introduced in security agent to read the config for low prior…
Browse files Browse the repository at this point in the history
…ity instrumentation enabled or not
  • Loading branch information
monu-k2io committed Sep 25, 2023
1 parent 647d395 commit c682cd6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,9 @@ public void setInitialised(boolean initialised) {
public Instrumentation getInstrumentation() {
return this.instrumentation;
}

@Override
public boolean isLowPriorityInstrumentationEnabled() {
return NewRelic.getAgent().getConfig().getValue(LowSeverityHelper.LOW_SEVERITY_HOOKS_ENABLED, LowSeverityHelper.DEFAULT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.newrelic.api.agent.NewRelic;
import com.newrelic.api.agent.Transaction;
import com.newrelic.api.agent.security.instrumentation.helpers.LowSeverityHelper;
import com.newrelic.api.agent.security.schema.AbstractOperation;
import com.newrelic.api.agent.security.schema.SecurityMetaData;
import com.newrelic.api.agent.security.schema.policy.AgentPolicy;
Expand Down Expand Up @@ -131,4 +132,9 @@ public String getAgentTempDir() {
public Instrumentation getInstrumentation() {
return null;
}

@Override
public boolean isLowPriorityInstrumentationEnabled() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.newrelic.api.agent.security;

import com.newrelic.api.agent.security.instrumentation.helpers.LowSeverityHelper;
import com.newrelic.api.agent.security.schema.AbstractOperation;
import com.newrelic.api.agent.security.schema.SecurityMetaData;
import com.newrelic.api.agent.security.schema.policy.AgentPolicy;
Expand Down Expand Up @@ -72,4 +73,9 @@ public Instrumentation getInstrumentation() {
return null;
}

@Override
public boolean isLowPriorityInstrumentationEnabled() {
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ public interface SecurityAgent {
String getAgentTempDir();

Instrumentation getInstrumentation();

boolean isLowPriorityInstrumentationEnabled();
}

0 comments on commit c682cd6

Please sign in to comment.