-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #312 from newrelic/feature/report-external-conn-db
[NR-299706] External connection reporting support for DynamoDB, Redis Client, Spymemcached
- Loading branch information
Showing
21 changed files
with
374 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
.../software/amazon/awssdk/services/dynamodb/DefaultDynamoDbAsyncClient_Instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package software.amazon.awssdk.services.dynamodb; | ||
|
||
import com.newrelic.agent.security.instrumentation.dynamodb_210.DynamoDBUtil; | ||
import com.newrelic.api.agent.security.NewRelicSecurity; | ||
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper; | ||
import com.newrelic.api.agent.security.schema.ExternalConnectionType; | ||
import com.newrelic.api.agent.security.utils.logging.LogLevel; | ||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import software.amazon.awssdk.core.client.config.SdkClientConfiguration; | ||
import software.amazon.awssdk.core.client.config.SdkClientOption; | ||
|
||
import java.net.URI; | ||
|
||
@Weave(originalName = "software.amazon.awssdk.services.dynamodb.DefaultDynamoDbAsyncClient", type = MatchType.ExactClass) | ||
final class DefaultDynamoDbAsyncClient_Instrumentation { | ||
|
||
protected DefaultDynamoDbAsyncClient_Instrumentation(SdkClientConfiguration clientConfiguration) { | ||
try { | ||
URI endpoint = clientConfiguration != null ? clientConfiguration.option(SdkClientOption.ENDPOINT) : null; | ||
if (endpoint != null) { | ||
NewRelicSecurity.getAgent().recordExternalConnection(endpoint.getHost(), endpoint.getPort(), null, null, | ||
ExternalConnectionType.DATABASE_CONNECTION.name(), DynamoDBUtil.DYNAMODB_2_1_0); | ||
} | ||
} catch (Exception e) { | ||
NewRelicSecurity.getAgent().log(LogLevel.WARNING, String.format(GenericHelper.ERROR_WHILE_DETECTING_CONNECTION_STATS, DynamoDBUtil.DYNAMODB_2_1_0, e.getMessage()), this.getClass().getName()); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
.../java/software/amazon/awssdk/services/dynamodb/DefaultDynamoDbClient_Instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package software.amazon.awssdk.services.dynamodb; | ||
|
||
import com.newrelic.agent.security.instrumentation.dynamodb_210.DynamoDBUtil; | ||
import com.newrelic.api.agent.security.NewRelicSecurity; | ||
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper; | ||
import com.newrelic.api.agent.security.schema.ExternalConnectionType; | ||
import com.newrelic.api.agent.security.utils.logging.LogLevel; | ||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import software.amazon.awssdk.core.client.config.SdkClientConfiguration; | ||
import software.amazon.awssdk.core.client.config.SdkClientOption; | ||
|
||
import java.net.URI; | ||
|
||
@Weave(originalName = "software.amazon.awssdk.services.dynamodb.DefaultDynamoDbClient", type = MatchType.ExactClass) | ||
final class DefaultDynamoDbClient_Instrumentation { | ||
|
||
protected DefaultDynamoDbClient_Instrumentation(SdkClientConfiguration clientConfiguration) { | ||
try { | ||
URI endpoint = clientConfiguration != null ? clientConfiguration.option(SdkClientOption.ENDPOINT) : null; | ||
if (endpoint != null) { | ||
NewRelicSecurity.getAgent().recordExternalConnection(endpoint.getHost(), endpoint.getPort(), null, null, | ||
ExternalConnectionType.DATABASE_CONNECTION.name(), DynamoDBUtil.DYNAMODB_2_1_0); | ||
} | ||
} catch (Exception e) { | ||
NewRelicSecurity.getAgent().log(LogLevel.WARNING, String.format(GenericHelper.ERROR_WHILE_DETECTING_CONNECTION_STATS, DynamoDBUtil.DYNAMODB_2_1_0, e.getMessage()), this.getClass().getName()); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
.../software/amazon/awssdk/services/dynamodb/DefaultDynamoDbAsyncClient_Instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package software.amazon.awssdk.services.dynamodb; | ||
|
||
import com.newrelic.agent.security.instrumentation.dynamodb_212.DynamoDBUtil; | ||
import com.newrelic.api.agent.security.NewRelicSecurity; | ||
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper; | ||
import com.newrelic.api.agent.security.schema.ExternalConnectionType; | ||
import com.newrelic.api.agent.security.utils.logging.LogLevel; | ||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import software.amazon.awssdk.core.client.config.SdkClientConfiguration; | ||
import software.amazon.awssdk.core.client.config.SdkClientOption; | ||
|
||
import java.net.URI; | ||
|
||
@Weave(originalName = "software.amazon.awssdk.services.dynamodb.DefaultDynamoDbAsyncClient", type = MatchType.ExactClass) | ||
final class DefaultDynamoDbAsyncClient_Instrumentation { | ||
|
||
protected DefaultDynamoDbAsyncClient_Instrumentation(SdkClientConfiguration clientConfiguration) { | ||
try { | ||
URI endpoint = clientConfiguration != null ? clientConfiguration.option(SdkClientOption.ENDPOINT) : null; | ||
if (endpoint != null) { | ||
NewRelicSecurity.getAgent().recordExternalConnection(endpoint.getHost(), endpoint.getPort(), null, null, | ||
ExternalConnectionType.DATABASE_CONNECTION.name(), DynamoDBUtil.DYNAMODB_2_1_2); | ||
} | ||
} catch (Exception e) { | ||
NewRelicSecurity.getAgent().log(LogLevel.WARNING, String.format(GenericHelper.ERROR_WHILE_DETECTING_CONNECTION_STATS, DynamoDBUtil.DYNAMODB_2_1_2, e.getMessage()), this.getClass().getName()); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
.../java/software/amazon/awssdk/services/dynamodb/DefaultDynamoDbClient_Instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package software.amazon.awssdk.services.dynamodb; | ||
|
||
import com.newrelic.agent.security.instrumentation.dynamodb_212.DynamoDBUtil; | ||
import com.newrelic.api.agent.security.NewRelicSecurity; | ||
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper; | ||
import com.newrelic.api.agent.security.schema.ExternalConnectionType; | ||
import com.newrelic.api.agent.security.utils.logging.LogLevel; | ||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import software.amazon.awssdk.core.client.config.SdkClientConfiguration; | ||
import software.amazon.awssdk.core.client.config.SdkClientOption; | ||
|
||
import java.net.URI; | ||
|
||
@Weave(originalName = "software.amazon.awssdk.services.dynamodb.DefaultDynamoDbClient", type = MatchType.ExactClass) | ||
final class DefaultDynamoDbClient_Instrumentation { | ||
|
||
protected DefaultDynamoDbClient_Instrumentation(SdkClientConfiguration clientConfiguration) { | ||
try { | ||
URI endpoint = clientConfiguration != null ? clientConfiguration.option(SdkClientOption.ENDPOINT) : null; | ||
if (endpoint != null) { | ||
NewRelicSecurity.getAgent().recordExternalConnection(endpoint.getHost(), endpoint.getPort(), null, null, | ||
ExternalConnectionType.DATABASE_CONNECTION.name(), DynamoDBUtil.DYNAMODB_2_1_2); | ||
} | ||
} catch (Exception e) { | ||
NewRelicSecurity.getAgent().log(LogLevel.WARNING, String.format(GenericHelper.ERROR_WHILE_DETECTING_CONNECTION_STATS, DynamoDBUtil.DYNAMODB_2_1_2, e.getMessage()), this.getClass().getName()); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
.../software/amazon/awssdk/services/dynamodb/DefaultDynamoDbAsyncClient_Instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package software.amazon.awssdk.services.dynamodb; | ||
|
||
import com.newrelic.agent.security.instrumentation.dynamodb_215.DynamoDBUtil; | ||
import com.newrelic.api.agent.security.NewRelicSecurity; | ||
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper; | ||
import com.newrelic.api.agent.security.schema.ExternalConnectionType; | ||
import com.newrelic.api.agent.security.utils.logging.LogLevel; | ||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import com.newrelic.api.agent.weaver.WeaveAllConstructors; | ||
import com.newrelic.api.agent.weaver.Weaver; | ||
import software.amazon.awssdk.core.client.config.SdkClientConfiguration; | ||
import software.amazon.awssdk.core.client.config.SdkClientOption; | ||
|
||
import java.net.URI; | ||
|
||
@Weave(originalName = "software.amazon.awssdk.services.dynamodb.DefaultDynamoDbAsyncClient", type = MatchType.ExactClass) | ||
final class DefaultDynamoDbAsyncClient_Instrumentation { | ||
|
||
private final SdkClientConfiguration clientConfiguration = Weaver.callOriginal(); | ||
|
||
@WeaveAllConstructors | ||
protected DefaultDynamoDbAsyncClient_Instrumentation() { | ||
try { | ||
URI endpoint = clientConfiguration != null ? clientConfiguration.option(SdkClientOption.ENDPOINT) : null; | ||
if (endpoint != null) { | ||
NewRelicSecurity.getAgent().recordExternalConnection(endpoint.getHost(), endpoint.getPort(), null, null, | ||
ExternalConnectionType.DATABASE_CONNECTION.name(), DynamoDBUtil.DYNAMODB_2_15_34); | ||
} | ||
} catch (Exception e) { | ||
NewRelicSecurity.getAgent().log(LogLevel.WARNING, String.format(GenericHelper.ERROR_WHILE_DETECTING_CONNECTION_STATS, DynamoDBUtil.DYNAMODB_2_15_34, e.getMessage()), this.getClass().getName()); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
.../java/software/amazon/awssdk/services/dynamodb/DefaultDynamoDbClient_Instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package software.amazon.awssdk.services.dynamodb; | ||
|
||
import com.newrelic.agent.security.instrumentation.dynamodb_215.DynamoDBUtil; | ||
import com.newrelic.api.agent.security.NewRelicSecurity; | ||
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper; | ||
import com.newrelic.api.agent.security.schema.ExternalConnectionType; | ||
import com.newrelic.api.agent.security.utils.logging.LogLevel; | ||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import com.newrelic.api.agent.weaver.WeaveAllConstructors; | ||
import com.newrelic.api.agent.weaver.Weaver; | ||
import software.amazon.awssdk.core.client.config.SdkClientConfiguration; | ||
import software.amazon.awssdk.core.client.config.SdkClientOption; | ||
|
||
import java.net.URI; | ||
|
||
@Weave(originalName = "software.amazon.awssdk.services.dynamodb.DefaultDynamoDbClient", type = MatchType.ExactClass) | ||
final class DefaultDynamoDbClient_Instrumentation { | ||
|
||
private final SdkClientConfiguration clientConfiguration = Weaver.callOriginal(); | ||
|
||
@WeaveAllConstructors | ||
protected DefaultDynamoDbClient_Instrumentation() { | ||
try { | ||
URI endpoint = clientConfiguration != null ? clientConfiguration.option(SdkClientOption.ENDPOINT) : null; | ||
if (endpoint != null) { | ||
NewRelicSecurity.getAgent().recordExternalConnection(endpoint.getHost(), endpoint.getPort(), null, null, | ||
ExternalConnectionType.DATABASE_CONNECTION.name(), DynamoDBUtil.DYNAMODB_2_15_34); | ||
} | ||
} catch (Exception e) { | ||
NewRelicSecurity.getAgent().log(LogLevel.WARNING, String.format(GenericHelper.ERROR_WHILE_DETECTING_CONNECTION_STATS, DynamoDBUtil.DYNAMODB_2_15_34, e.getMessage()), this.getClass().getName()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.