1. Introduction
This blog outlines the objective to gain insights into the usage patterns and effectiveness of the Cognos dashboard by leveraging Instana's website monitoring capabilities. Our focus will be on crafting a personalized widget through the Cognos dashboard JavaScript API and seamlessly incorporating it into the Instana website monitoring ecosystem.
2. Prerequisites
- Access to IBM Cognos Dashboard environment
- Access to IBM Instana account with Website Monitoring capabilities
- Familiarity with JavaScript, Cognos JavaScript API, IBM Instana
3. Creating a Custom Widget in Cognos Dashboard
Detailed instructions on setting up the custom widget on Cognos dashboard here.
Cognos dashboard JavaScript API documentation here.
4. Integrating Instana Website Tracking Script
1. Obtain Tracking Script: Log in to your Instana account and retrieve the website tracking script from your Instana dashboard.
2. Edit Custom Widget Code: Edit the custom widget's code. spec.json
{
"name": "instana_metrics",
"schemaVersion": "1.0",
"extensions": [
{
"perspective": "dashboard",
"comment": "instana widgets for dashboard",
"features": [
{
"id": "com.ibm.bi.dashboard.instana_metrics",
"collectionItems": [
{
"containerId": "com.ibm.bi.dashboard.widgets",
"id": "instana_metrics",
"title": "instana_metrics",
"iconUrl": "v1/ext/instana_metrics/images/ibm.png",
"widget": "v1/ext/instana_metrics/app.js",
"scroll": "scrollNone",
"disableTitle": true,
"params": {
"name": "IBM"
}
}
]
}
]
}
]
}
3. Integrate Instana Script: Integrate the Instana website tracking script into your custom widget's code. This script will be invoked whenever the dashboard loads, ensuring continuous monitoring.
define([
"dashboard-core/js/ca/AppFactory",
"jquery",
"dashboard/widgets/CustomWidget",
], function (AppFactory, $, Base) {
// Define a new Widget based on the CustomWidget base class
var Widget = Base.extend({
userAccount: null, // Declare userAccount at the Widget level
onInit: function (params) {
// Initialize the widget with parameters
this.name = params.name;
var appFactory = new AppFactory();
// Get user account information from the UserProfile feature
this.userAccount = appFactory
.getFeature("UserProfile")
.getUserAccount();
},
onRender: function () {
// Get the root node for the widget content
var root = this.getContentRootNode();
// Append a greeting message to the root node
$(root).append(
'<script>(function(s,t,a,n){s[t]||(s[t]=a,n=s[a]=function(){n.q.push(arguments)},n.q=[],n.v=2,n.l=1*new Date)})(window,"InstanaEumObject","ineum");ineum("reportingUrl", "https://<your-instana-url>.instana.io");ineum("key", "<your-website-key>");ineum("trackSessions");ineum("user", "' +
this.userAccount.userName +
'", null, null);</script><script defer crossorigin="anonymous" src="https://eum.instana.io/eum.min.js"></script>'
);
},
});
// Return the custom widget
return Widget;
});
5. Monitoring Metrics in Instana Dashboard
Configuring Instana Website Monitoring
- Access Instana Dashboard: Log in to your Instana account and access your dashboard.
- Monitor Performance Metrics: Instana will automatically start monitoring your dashboard's performance metrics, providing insights into load times, response times, and more.
6. Conclusion
In this technical blog, we've delved into the steps involved in monitoring Cognos dashboard metrics through Instana Website Monitoring. Through the integration of these robust tools and the utilization of the Cognos dashboard JavaScript API for widget customization, you have the opportunity to elevate your monitoring prowess. This synergy empowers you to extract meaningful insights, conduct thorough data analysis, and ultimately enhance your decision-making processes.