-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to publish traces, metrics from Enforcer to App Insights #2212
Conversation
Add throtting trace
Add analytics filter tracing
Add cors and oauth filter tracing
Add new fixes
Add latency values to metrics
Add synchronization for AzureTraceExporter
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/analytics/AccessLoggingService.java
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/api/RequestContext.java
Outdated
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/metrics/MetricsManager.java
Outdated
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/metrics/MetricsManager.java
Outdated
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/metrics/MetricsManager.java
Outdated
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/metrics/MetricsUtils.java
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/metrics/MetricsUtils.java
Outdated
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/metrics/MetricsUtils.java
Outdated
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/server/AuthServer.java
Outdated
Show resolved
Hide resolved
enforcer/src/main/java/org/wso2/choreo/connect/enforcer/server/WebSocketHandler.java
Outdated
Show resolved
Hide resolved
|
||
CMD java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="${ENFORCER_HOME}/logs/heap-dump.hprof" $JAVA_OPTS -Dlog4j.configurationFile="${ENFORCER_HOME}/conf/log4j2.properties" -cp "lib/*:lib/dropins/*" org.wso2.choreo.connect.enforcer.server.AuthServer | ||
|
||
CMD java -javaagent:/home/wso2/conf/applicationinsights-agent-3.1.1.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="${ENFORCER_HOME}/logs/heap-dump.hprof" $JAVA_OPTS -Dlog4j.configurationFile="${ENFORCER_HOME}/conf/log4j2.properties" -DtracingEnabled="true" -cp "lib/*:lib/dropins/*" org.wso2.choreo.connect.enforcer.server.AuthServer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we place this in lib directory (rather than using conf dir)? @Rajith90 wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah since we are asking to mount the entire lib directory (due to the way lib directory provided in docker compose file), I think we may need some other directory here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw applicationinsights-agent-3.1.1.jar
jar is comitted to the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to decide on placing the agent jar and mounting the applicationinsights.json file. I have removed this JVM arg and added a todo section in the dockerfile to track this. For tracking purposes I have commited the agent jar and its config file with this PR. It should not be an issue as we do not pack either the jar or the config file.
Type: "azure", | ||
ConfigProperties: map[string]string{ | ||
"connectionString": "", | ||
"instrumentationName": "WSO2-CHOREO", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we change the default instrumentation name to something more generic that identifies the product.
Suggestion:
CHOREO-CONNECT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be fixed in an upcoming PR
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-monitor-opentelemetry-exporter</artifactId> | ||
<version>${azure.monitor.opentelemetry.exporter.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>applicationinsights-core</artifactId> | ||
<version>${applicationinsights.core.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
<version>${enforcer.jackson.databind.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-annotations</artifactId> | ||
<version>${jackson.annotations.version}</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These dependencies should be defined in root pom's dependencyManagement
. Then refered here without the version similar to other dependencies in this pom file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be fixed in an upcoming PR
Purpose
This PR adds support to publish traces and metrics from Enforcer to Azure App Insights.
Traces are generated using Open-telemetry and then published to App Insights using AzureOpenTelemetry exporter. Azure standalone Java agent is configured to publish standard, custom metrics.
Related configurations: https://docs.google.com/document/d/19n5_3NcNY9zdBJi_mQkCYezkOtoLd4gkU0fH0RusyLc/edit?usp=sharing
PoC document: https://docs.google.com/document/d/1te1PQJZdTV-i6dXh_GG0e_hwyVZ_Zxlii3gAHxW6O2M/edit?usp=sharing
Usecases: https://docs.google.com/document/d/1TQkwmbsK8MwtQ52u9wvOdNG7fgpEl55r4qc6xHFEMM8/edit?usp=sharing
ToDos,
Issues
Partially fixes #2234
Automation tests
Tested environments
Mac OS, JDK 11
Maintainers: Check before merge