Skip to content

Commit 22ad7d5

Browse files
authored
PR for APEX dashboard and log-sources (#29)
* Create apex.json * Delete knowlege-content/APEX/dashboards directory * APEX Dashboards * Database APEX Dashboards * Update README.md * Update README.md
1 parent 70e80ee commit 22ad7d5

16 files changed

+4688
-0
lines changed
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Oracle APEX monitoring
2+
3+
*Asset Introduction*
4+
5+
Oracle APEX is an enterprise low-code application platform that enables developers to build scalable, secure web and mobile apps. It can run on-premises as well as OCI.
6+
7+
Oracle APEX provides Administrator and monitoring Dashboards inside the framework. That requires specific APEX access and skills.
8+
9+
OCI Observability offers a single point of control for all the services. In that way the admin doesn't have to access the specific services console, all the information will be on Dashboards and all will be accessible from the Observability and Management.
10+
11+
This project is about getting out the monitoring data from the Oracle APEX repository and publishing them on an OCI Dashboard. Once the OCI admin has the Oracle APEX data out they can cross and correlate application performances and resource utilization but also have Oracle APEX data in a single pane of glass together with the other asset.
12+
13+
## When to use this asset?
14+
15+
You want to include APEX monitoring in a single pane of glass and build your checks and alerts instead of accessing APEX Console.
16+
17+
![img](images/error.png)
18+
19+
The errors widget group provides a view of application errors and application users impact.
20+
21+
![img](images/users_aut.png)
22+
23+
The user Authentication widget group shows the application user and the database login. In this case, it provides the success and the failure logon trend. It is recommended to define an alert when the failure exceeds a threshold limit.
24+
25+
![img](images/ApplicationUsage.png)
26+
27+
The application usage widget group provides an overview of the application workload in terms of workspace, application, pages and users.
28+
29+
Each widget allows to drill down. In the File Explorer, you can see there are three source
30+
31+
32+
You can use these sources to build your widget <https://docs.oracle.com/en-us/iaas/Content/Dashboards/Tasks/widgetmanagement.htm>
33+
34+
## How to use this asset?
35+
36+
![img](images/APEX_monitoring_Architecture.png)
37+
38+
For the scope, I used an ATP Database but it can be implemented also on-premises database as well as a OCI Base Database.
39+
40+
APEX monitoring data are stored in the database where APEX runs. The OCI Management Agent connects to the database by SQL connection and queries the data. The results are transered in OCI Logging Analytics. Metrics from the database are by default stored in Monitoring.
41+
42+
43+
# Pre-requisites
44+
- Database
45+
- Pluggable Database (PDB), Multitenant Container Database (CDB), and Application Container
46+
- Oracle Database Instance
47+
- Oracle Autonomous Database(ADW/ATP)
48+
- OCI Logging Analytics enabled and accessible https://docs.oracle.com/en/cloud/paas/logging-analytics/logqs/#before_you_begin
49+
50+
51+
# Installation instructions
52+
53+
1. Policies and Compartment
54+
- Create a compartment like APEX and copy the OCID.
55+
- Create a dynamic group Mng_Agent where the Management Agent will be part of
56+
57+
```json
58+
All {resource.type = 'managementagent', resource.compartment.id = 'Compartment_OCID'}
59+
```
60+
61+
- Create the following policies
62+
63+
```json
64+
allow dynamic-group Mng_Agent to MANAGE management-agents IN compartment APEX
65+
allow dynamic-group Mng_Agent to USE METRICS IN compartment APEX
66+
allow dynamic-group Mng_Agent to {LOG_ANALYTICS_LOG_GROUP_UPLOAD_LOGS} IN compartment APEX`
67+
```
68+
69+
2. Create the OCI Linux Compute
70+
71+
Create an OCI Compute in the same compartment you created in the former step. Once the Compute has been created go to Cloud Agent tab and enable the Management Agent.
72+
73+
![img](images/Enable_Agent.png)
74+
75+
Go on Observability and Management and check in the Agent section the new agent (specify the right compartment, for example, APEX)
76+
77+
Enable the Logging Analytics Plugin in the agent
78+
79+
![img](images/LA_Enable_plugin.png)
80+
81+
82+
3. Create the connection between Logging Analytics and the APEX DB
83+
84+
Create the Entity DBNAME in Logging Analytics from the OCI Console
85+
86+
![img](images/LA_AddEntity.png)
87+
88+
Download the ATP Wallet on the Compute VM
89+
90+
![img](images/DatabaseWallet.png)
91+
92+
From the Compute VM create a json file APEXcred.json
93+
94+
```json
95+
{
96+
"source": "lacollector.la_database_sql",
97+
"name": "LCAgentDBCreds.<Database_Entity_Name>",
98+
"type": "DBTCPSCreds",
99+
"usage": "LOGANALYTICS",
100+
"disabled": "false",
101+
"properties":[
102+
{"name":"DBUserName","value":"<Database_User_Name>"},
103+
{"name":"DBPassword","value":"<Database_Password>"},
104+
{"name":"ssl_trustStoreType","value":"JKS"},
105+
{"name":"ssl_trustStoreLocation","value":"<SSL_Truststore_Location>"},
106+
{"name":"ssl_trustStorePassword","value":"<SSL_Truststore_Password>"},
107+
{"name":"ssl_keyStoreType","value":"JKS"},
108+
{"name":"ssl_keyStoreLocation","value":"<SSL_Keystore_Location>"},
109+
{"name":"ssl_keyStorePassword","value":"<SSL_Keystore_Password>"},
110+
{"name":"ssl_server_cert_dn","value":"yes"}]
111+
}
112+
```
113+
114+
run this command to register it
115+
116+
```console
117+
cat APEXcred.json | sh /var/lib/oracle-cloud-agent/plugins/oci-managementagent/polaris/agent_inst/bin/credential_mgmt.sh -o upsertCredentials -s logan
118+
-o upsertCredentials -s logan
119+
```
120+
121+
For detailed steps please refer to https://docs.oracle.com/en/cloud/paas/logging-analytics/tutorial-atp-adw-support/#before_you_begin
122+
123+
4. Create the Dashboard
124+
125+
Download the zip and the json file from project dashboards and log-sources folder
126+
127+
Import the Sources definition
128+
129+
From OCI Console -> Observability and Management -> Logging analytics -> Administration Overview -> Import Configuration Content
130+
131+
![img](images/LA_Import_Source.png)
132+
133+
Select one by one all the zip files
134+
135+
For each Source APEX_ created, associate the Source with the ATP Entity
136+
137+
From OCI Console -> Observability and Management -> Logging analytics -> Administration Overview -> Source and for each source click "Unassociated Entity" and select the DBName
138+
139+
![img](images/LA_Associate_Entity.png)
140+
141+
Import the Dashboard
142+
143+
From OCI Console -> Observability and Management -> Logging analytics -> Dashboard -> Import and select the dashboard JSON
144+
145+
![img](images/LA_Import_Dashboard.png)
146+
147+
## Useful Links (Optional)
148+
149+
- [OCI Observability ](https://www.oracle.com/manageability/)
150+
- [OCI Logging Analytics ](https://docs.oracle.com/en-us/iaas/logging-analytics/index.html)
151+
- [OCI APEX ](https://apex.oracle.com/en/platform/apex-oracle-cloud/)
152+
153+
154+
# License
155+
156+
Copyright (c) 2023 Oracle and/or its affiliates.
157+
158+
Licensed under the Universal Permissive License (UPL), Version 1.0.
159+
160+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/folder-structure/LICENSE) for more details.

0 commit comments

Comments
 (0)