Quick start
Before you begin
Ensure you are familiar with the data model to efficiently use TrueSight Intelligence in your environment.
Signing up for an account
Go to truesight.bmc.com/signup/intelligence to sign up for a TrueSight Intelligence Account. After you have signed up and created an account for your organization, refer to Managing-accounts-and-users.
Getting your account API key, defining metrics, and sending measure data
Get your account API key
Your organization's account has a unique API key that must be used for authentication while sending data to TrueSight Intelligence.
Go to truesight.bmc.com to copy the API key for your account. Navigate to My Account > Product Security.
Define your metrics
You must first define the metrics for which you want to collect data, and then send values for the metrics. After you send the metric definition, these metrics are available in the TrueSight Intelligence user interface. You must then Send measures for the metrics and associate it with apps. For more information on the data structure, refer to the data model.
The Bike Dealership app in TrueSight Intelligence is a user-defined app that collects sales data from multiple dealerships to ascertain sales across a region. Use the following sample code to create a metric named Bike Sales for a source type Bike_Business_Metrics.
# importing the requests library, run "pip3 install requests" to install
import requests
import json
# api endpoint
METRICS_CREATE_URL = "https://api.truesight.bmc.com/v1/metrics"
HEADERS = {'Content-Type': 'application/json'}
USERNAME = <Registered email address>
API_TOKEN = <Unique token from the TrueSight Account Manager>
bike_sales_metric = {
"name" :"Bike.Sales",
"type" :"Bike_Business_Metrics",
"description" : "Number of bikes sold during the interval",
"displayName" : "Bike Sales",
"displayNameShort" : "Bike Sales",
"unit" : "number",
"defaultAggregate" :"avg"
}
''' Create a metric based on the dictionary passed '''
def createMetric(metricInfo, userName, apiToken):
response = requests.post(METRICS_CREATE_URL,
auth=(userName,apiToken), data=json.dumps(metricInfo), headers=HEADERS)
if response.status_code ==requests.codes.ok:
print("Successfully created metric " + metricInfo["displayName"])
else:
print("Metric " + metricInfo["displayName"] + " not created, perhaps it already exists? " + "Error code:" + str(response.status_code))
createMetric(bike_sales_metric, USERNAME, API_TOKEN)
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '[
{
"name": "bike.sales",
"type":"Bike_Business_Metrics",
"description": "Number of bikes sold during the interval",
"displayName": "Bike Sales",
"displayNameShort": "Bike Sales",
"unit": "number",
"defaultAggregate": "avg"
}
]'
For more information, see /v1/post/metrics.
Send measures for the metrics and associate it with apps
After sending the metric definition, you can send measures for a specific time. Specify the ID for the application for providing a logical grouping of metrics from multiple sources. The Sources and Apps for the metrics defined in the previous step are available in the TrueSight Intelligence user interface only after these metrics have associated values. For more information on the data structure, refer to the data model.
The Bike Dealership app in TrueSight Intelligence is a user-defined app that collects sales data from multiple dealerships to ascertain sales across a region. Use the following sample code to send measures for a metric named bike_sales_metric, and associate it to the Bike Dealership app.
# importing the requests library, run "pip3 install requests" to install
import requests
import json
import time
# api endpoint
MEASURES_ADD_URL = "https://api.truesight.bmc.com/v1/measurements"
HEADERS = {'Content-Type': 'application/json'}
APP_NAME = "Bike Dealership"
USERNAME = <Registered email address>
API_TOKEN = <Unique token from the TrueSight Account Manager>
def sendMeasurements(userName, apiToken):
currentTime = round(time.time())
sales_dict = getMeasureDict("Bike.Sales", "San Jose Dealership", currentTime)
postMeasures(sales_dict, USERNAME, API_TOKEN)
def getMeasureDict(bike_sales_metric, sourceName, timeStamp):
measurement_dict = {
"source": sourceName,
"metric": bike_sales_metric,
"measure": <measurement for the metric>,
"timestamp": timeStamp,
"metadata" : {
"app_id" : APP_NAME
}
}
return measurement_dict
def postMeasures(measureDict, userName, apiToken):
response = requests.post(MEASURES_ADD_URL, auth=(userName,apiToken), data=json.dumps(measureDict), headers=HEADERS)
if response.status_code == requests.codes.ok:
print("Successfully sent measurement " + measureDict["metric"] + " for source " + measureDict["source"] + " @time:" + str(measureDict["timestamp"]))
else:
print("Unable to send measurement " + measureDict["metric"] + " for source " + measureDict["source"] + " @time:" + str(measureDict["timestamp"]) + " Error code:" + str(response.status_code))
sendMeasurements(USERNAME, API_TOKEN)
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '
[
{
"source": "sourceName",
"metric": "bike_sales_metric",
"measure": 21,
"timestamp": 1459286820,
"metadata": {
"app_id":"Bike Dealership"}
}
]'
Using the TrueSight Intelligence interface to set KPIs, view sources, and manage apps
Set metrics as KPIs
Carefully select KPIs to assist in application analysis. The time scales for the KPIs are synchronized, which enables you to see how metrics affect each other. For example, you can set application metrics such as request count and response time as KPIs.
- Select a metric that you want to set as an application KPI by using one of the following methods:
- Search for the metric from the search box. For more information, see Searching-for-data.
- Click Sources and select a source; then select a metric from the Metrics tab.
- From the metrics list screen, click
and select Set as App. KPI.
After you set a metric as a KPI, thelabel is displayed. For information about editing and removing KPIs, see Managing applications.
For more information, see Setting-metrics-as-KPIs-for-analysis.
Viewing Sources
Click Sources to view a list of all the data sources sending data to TrueSight Intelligence.
The following details are available:
- The list of sources configured to send data.
- Click the Name to view the list of metrics sent by the source.
- The list of Types configured for association of similar sources.
For more information, see Managing-sources.
Viewing Apps
If you specified the ID for an application while sending values for the metrics and then identified and set specific metrics as KPIs, these metrics will be grouped under the specified application in the TrueSight Intelligence user interface. For more information on the data flow, refer to the data model.
Click Apps to view a summary view of all the applications, and click an app from the list. Alternately, click Sources and select a source of type 'Application'.
The following details are available:
- Charts for all the metrics set as KPIs for the application
- Click the Sources tab to view the sources that are sending data to the App
- Click
to view app details
- Copy the App ID, if you want to configure other sources to send data to this app
- Delete the app if you don't need it anymore
- Click
to toggle listing the events associated with the app
For more information, see Managing-applications, Performing-analytics-using-data-exploration and Performing-advanced-analytics-using-machine-learning.
View all your information in easy-to-use graphs
The charts available in TrueSight Intelligence come with a host of features that allow you view relevant information in a glance. For more information, see Viewing-metric-details.
Sending event data
Sending events
Events provide you the flexibility to send and visualize any set of values at a given point in time. For more information on the data structure and events, refer to the data model and Viewing-abnormality-and-MVGD-events.
The Bike Dealership app in TrueSight Intelligence is a user-defined app that collects sales data from multiple dealerships to ascertain sales across a region. Use the following sample code to send an event and associate it to the Bike Dealership app.
# importing the requests library, run "pip3 install requests" to install
import requests
import json
import time
# api endpoint
EVENT_SEND_URL = "https://api.truesight.bmc.com/v1/events"
HEADERS = {'Content-Type': 'application/json'}
APP_NAME = "Bike Dealership"
USERNAME = <Registered email address>
API_TOKEN = <Unique token from the TrueSight Account Manager>
def getEventInfo(timeStamp, appName):
dealer = "San Jose Dealership"
make = "Harley"
eventDict = {
"fingerprintFields": [
"@title", "@createdAt"
],
"source": {
"ref": dealer,
"type": "APPLICATION"
},
"title": "Motorcycle sold at " + dealer + "make:" + make,
"createdAt": timeStamp * 1000,
"eventClass": "BIKE_SALE",
"properties" : {
"app_id": appName,
"make" : make,
"buyer_age" : <Age of the buyer>,
"buyer_state" : <Home State>,
"buyer_sex" : <Male/Female>
}
}
return eventDict
def postEvent(timeStamp, applicationName, userName, apiToken):
eventDict = getEventInfo(timeStamp,applicationName)
response = requests.post(EVENT_SEND_URL, auth=(userName,apiToken), data=json.dumps(eventDict), headers=HEADERS)
if response.status_code ==requests.codes.ok or response.status_code == requests.codes.accepted:
print("Successfully sent event " + eventDict["title"])
else:
print("Unable to send event " + eventDict["title"] + "Error code:" + str(response.status_code))
currentTime = round(time.time())
postEvent(currentTime, APP_NAME, USERNAME, API_TOKEN)
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d \
' {
"source":
{
"ref": "dealer",
"type": "Application",
},
"sender":
{
"ref": "dealer",
"type": "Application",
},
"fingerprintFields": ["@title", "@createdAt"],
"title": "Motorcycle sold at " + dealer + "make:" + make,
"eventClass": "BIKE_SALE",
"createdAt": 1459299931000,
"properties":
{
"app_id": Bike Dealership,
"make" : make,
"buyer_age" : <Age of the buyer>,
"buyer_state" : <Home State>,
"buyer_sex" : <Male/Female>
}
} '
For more information, see /v1/post/events.
View and filter events
View events by type, severity or status in a bar chart, and filter to view data for a selected time frame.
Customize visualization
View and create custom bar charts and donuts for a visual representation of event data.
Searching and analyzing data
Search for data collected by TrueSight Intelligence, and use an array of features to analyze data. For more information, see Performing-analytics-using-data-exploration and Performing-advanced-analytics-using-machine-learning.
Searching data
Select one of the preset time periods or specify a customer time period to search and view data across TrueSight Intelligence.
Click and type the name of a metric, source, or application that you want to search. Use search conditions and custom aggregation to narrow down your results.
For more information, see Searching-for-data.
Correlating metric data | ||
---|---|---|
Correlation analysis allows you to select a primary/base metric and get a list of correlated metrics. This analysis can be helpful in performing a root cause analysis for changes that affect the performance of your systems. | ||
Performing statistical analysis on a metric | ||
View relevant statistics for a metric. Apply available statistic options or add a custom percentile value to perform a statistical analysis on the data for a metric and display the values on the chart. | ||
Comparing the value of a metric over time | ||
Compare the values for a metric to itself for another time period or compare with other metrics. |