As technology continues to evolve at a rapid pace, applications are no longer simple, monolithic entities. They’re complex systems that span multiple environments – cloud, microservices, on-premises, and open-source – making it increasingly difficult to monitor their performance. Imagine trying to solve a puzzle with many moving pieces. That’s what it’s like to monitor modern applications without the right tools. But what if you had a single platform that could help you simplify application monitoring across all these environments?
Enter OCI Application Performance Monitoring (APM) for end-to-end visibility
APM is designed to provide end-to-end visibility into your application’s performance. With its distributed tracing capability, you can track every step of every transaction as it passes through all components of your distributed system. No sampling, no aggregation – just pure visibility. This means you can quickly identify bottlenecks and areas for improvement in real-time. Your DevOps teams will love the ability to track every transaction without having to sift through mountains of data.
What does using APM mean for you?
- Simplify application monitoring across multiple environments
- Improve problem diagnosis and resolution
- Enhance overall application performance
- Support both microservices-based and legacy applications
In short, APM helps tame the complexity of modern application monitoring so you can focus on delivering exceptional user experiences.
This blog provides a step by step quick guide to onboard and add APM Java agent and Real user monitoring agent to help monitor Application servers and provide end to end visibility.
How to enable distributed tracing for your application
- Add policies (Skip if suggested policies already exist for user group) – Similar to any other OCI resource, a policy is required to enable a group to manage the APM domain, which serves as a fundamental OCI resource necessary for utilizing APM.
Option 1: Using Generate APM policy
OCI Application Performance Monitoring overview
Click on “Generate APM Policies” and update inputs to automatically generate and add required policies.
Option 2: Using manual way, add below policies:
Allow group <group name> to manage apm-domains in compartment <compartment name>
Allow group <group name> to manage management-dashboard in compartment <compartment name>
Allow group <group name> to manage management-saved-search in compartment <compartment name>
Allow group <group name> to read metrics in compartment <compartment name>
Allow group <group name> to manage alarms in compartment <compartment name>
Allow group <group name> to read ons-topics in compartment <compartment name>
APM domain is basic OCI resource needed to start using APM. This step is skipped if APM domain is already active.
Create APM Domain Overview
- Configuring Trace monitoring – APM Java agent
Purpose: Gives in-depth insights of backend transaction like JDBC calls (Execution time, Return status, Infra details like Hostname, SQL query details, etc)
Download agent here or https://cloud.oracle.com/apm/apm-admin/admin/downloadAgents
OR
Using Menu navigation (Observability and Management -> Administration in Application Performance monitoring -> Download agents)
Provisioning APM Agent – Will create agent libraries and config files on provided directory
java -jar ./apm-java-agent-installer-<version>.jar provision-agent -service-name=<Name of the Service> -destination=<Destination Directory> -private-data-key=<Agent installation key generated during APM domain creation> -data-upload-endpoint=<dataUploadEndpoint URL generated during APM domain creation>
Deploying APM agent – Enable APM agent monitoring
Update Application server startup script such a way that below “javagent” option to be app server process.
-javaagent: <Destination Directory>/oracle-apm-agent>/bootstrap/ApmAgent.jar
For example, if the app server is Weblogic, we need to update startWebLogic.sh.
To add below line
JAVA_OPTIONS="${JAVA_OPTIONS} -javaagent:$DOMAIN_HOME/oracle-apm-agent/bootstrap/ApmAgent.jar"
Next, bounce the App server post doing this step and validate.
Check for log directory in oracle-apm-agent, if there is no Errors in AgentError.log file, check for Trace details in APM Dashboard.
- APM agent is part of App server process and not a standalone process.
- Check for a successful APM agent initialization under <Destination Directory>/oracle-apm-agent>/log
- If <Destination Directory>/oracle-apm-agent>/log directory is not created, then check whether running process has “-javaagent…” JVM options with it.
Configuring Trace monitoring – Real User Monitoring (Auto injection). This provides in-depth insights of Real User metrics Pageload time, DNS time, SSL time, First Byte time etc, error details on the page.
If APM Java agent is deployed, then update AgentConfig.properties com.oracle.apm.agent.rum.enable.injection=true com.oracle.apm.agent.public.data.key=<public-data-key_not_set from APM Admin page>
Configuring Trace monitoring – Real User Monitoring (Manual Injection)
If APM Java agent is not deployed, then use the APM browser agent to update the base html template of your UI application to include below lines.
<script> window.apmrum = (window.apmrum || {}); window.apmrum.serviceName='<APM Browser>'; window.apmrum.webApplication='<Web App Name>'; window.apmrum.ociDataUploadEndpoint='<ociDataUploadEndpoint>'; window.apmrum.OracleAPMPublicDataKey='<APM_Public_Datakey>'; </script> <script async crossorigin="anonymous" src="<ociDataUploadEndpoint>/static/jslib/apmrum.min.js"></script>
After adding above code in UI template file, perform any UI transactions. Check for UI transaction details in APM Dashboards
Real User Monitoring Overview
Now that you have onboarded APM Java agent and APM Real user monitoring agent, you get end to end visibility of the application. Check transaction details using traces and spans collected to identify potential optimization point in the application and work on implementing the optimization. Use the tool to compare overall application performance before and after performing maintenance. To get started, try APM for free or practice with our O&M Lab.