...
Note | ||
---|---|---|
| ||
Auitabs | ||
| ||
Auitabspage | title | Configuring Product Observability
Let's explore the following topics to learn more:
Table of Contents | ||||
---|---|---|---|---|
|
Configuring product observability
The configurations are two-fold
...
:
Table of Content Zone | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
log4j configsFollow the steps below to setupset up the correlation logs related to the database calls.
Tomcat valve configsFollow the steps below to setupset up the correlation ID mapping between the request database call and the response database call.
Auitabspage | | title | Enabling Observability
Code Block |
---|
<Valve className="org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve"
headerToCorrelationIdMapping="{'activityid':'Correlation-ID'}" queryToCorrelationIdMapping="{'RelayState':'Correlation-ID'}"/> |
Note |
---|
This should be the first valve under the |
Enabling observability
Follow the steps below to enable product observability.
Navigate to the
<IS_HOME>/bin
directory on the command prompt.Code Block cd <IS_HOME>/bin
To set the
-DenableCorrelationLogs
property totrue
, execute the following command.Code Block For Mac/Linux --> sh wso2server.sh -DenableCorrelationLogs=true start For Windows --> wso2server.bat -DenableCorrelationLogs=true start
Note By default, this property is set to
false
.Navigate to
...
the
<IS_HOME>/repository/logs
...
directory.
Code Block cd <IS_HOME>/repository/logs
Notice that a separate log file
...
called
correlation.log
...
is created.
Now you are ready to test the product observability of WSO2 IS.
Tip | ||
---|---|---|
In order to test product observability, make sure you create a service provider and generate client key and cilentclient secret, with which you can perform a secure database call. For more information on creating service providers, see Adding a Service Provider. Auitabspage | | title |
Log
...
patterns
Following are the log patterns that support product observability.
Table of Content Zone | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
JDBC database call loggingFormat: Example: LDAP Format
Example:
LDAP database call loggingFormat:
Example: Request Beginning
Beginning of the request callMain:
Example:
Ending of the request callFormat:
Example:
|
Reading the
...
logs
Let's analyze the following sample log lines to find if there are any timing delays for the JDBC or LDAP calls.
Code Block | ||
---|---|---|
| ||
2018-11-0514:05:18,427|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|0|HTTP-In-Request|1541406918427|POST|null|/carbon/admin/login_action.jsp |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,581|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|0|jdbc|1541406918581|executeQuery|SELECT * FROM IDN_RECOVERY_DATA WHERE USER_NAME = ? AND USER_DOMAIN = ? AND TENANT_ID = ?|jdbc:h2:./repository/database/WSO2CARBON_DB |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,591|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|7|ldap|1541406918584|initialization|ldap://localhost:10389|uid=admin,ou=system|0|empty |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,599|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|200|ldap|1541406918591|search|ldap://localhost:10389|uid=admin,ou=system|3| uid=admin,ou=Users,dc=WSO2,dc=ORG,(&(objectClass=person)(uid=admin)),javax.naming.directory.SearchControls@548e9a48 |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,610|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|0|jdbc|1541406918610|executeQuery|SELECT DATA_KEY, DATA_VALUE FROM IDN_IDENTITY_USER_DATA WHERE TENANT_ID = ? AND USER_NAME = ?|jdbc:h2:./repository/database/WSO2CARBON_DB |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,632|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|16|ldap|1541406918616|initialization|ldap://localhost:10389|uid=admin,ou=system|0|empty |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,641|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|0|jdbc|1541406918641|executeQuery|SELECT UM_ROLE_NAME, UM_RESOURCE_ID, UM_IS_ALLOWED, UM_ACTION, UM_DOMAIN_NAME FROM UM_PERMISSION, UM_ROLE_PERMISSION, UM_DOMAIN WHERE UM_ROLE_PERMISSION.UM_PERMISSION_ID=UM_PERMISSION.UM_ID AND UM_ROLE_PERMISSION.UM_DOMAIN_ID=UM_DOMAIN.UM_DOMAIN_ID AND UM_PERMISSION.UM_TENANT_ID=? AND UM_ROLE_PERMISSION.UM_TENANT_ID=?|jdbc:h2:./repository/database/WSO2CARBON_DB |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,642|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|0|jdbc|1541406918642|executeQuery|SELECT UM_USER_NAME, UM_RESOURCE_ID, UM_IS_ALLOWED, UM_ACTION FROM UM_PERMISSION, UM_USER_PERMISSION WHERE UM_USER_PERMISSION.UM_PERMISSION_ID=UM_PERMISSION.UM_ID AND UM_PERMISSION.UM_TENANT_ID=? AND UM_USER_PERMISSION.UM_TENANT_ID=?|jdbc:h2:./repository/database/WSO2CARBON_DB |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,696|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|0|jdbc|1541406918696|executeQuery|SELECT UM_RESOURCE_ID FROM UM_PERMISSION WHERE UM_ACTION=? AND UM_TENANT_ID=?|jdbc:h2:./repository/database/WSO2CARBON_DB |
Code Block | ||||
---|---|---|---|---|
| ||||
2018-11-0514:05:18,715|86b56b19-7872-4e2f-84f3-5a14f92e18c1|http-nio-9443-exec-8|480|HTTP-In-Response|1541406918715|POST|null|/carbon/admin/login_action.jsp |
- Line 1 is
...
- the
http-in-request
. - Line 10 is
...
- the
http-in-response
, which shows that the total time taken for the cycle
...
- is
480 ms
. This is almost close to half a second. With that we can assume that there is a delay with either an LDAP or JDBC call. - When we carefully analyze each line, we can see that all JDBC calls have taken less
...
- than
5 ms
. - Line 4 however, indicates an LDAP call that has
...
- taken
200 ms
, which can be a possible reason for this issue.
...
title | Advance Scenarios |
---|
Advanced scenarios
Following are a few advance scenarios that are related to product observability in WSO2 IS.
Table of Content Zone | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
Blacklisting theThreadsthreadsCertain threads continuously print unneccessaryunnecessary logs. Blacklisting prevents the unwanted threads from printing logs thereby improving the readibilityreadability of the logs. Follow the steps below to configure thread blacklisting.
Single header configsBy default, Let's consider an authentication request that is sent with a new header configuration.
Multiple header configsEven though the default configuration maps a single header to a single Correlation ID, it is possible to add multiple headers and map them to multiple Correlation IDs. Let's consider an authentication request that is sent with multiple headers.
|