Quick start


Before you begin

Ensure you are familiar with the data model to efficiently use TrueSight Intelligence in your environment.

tsierdiag.pngsource_app.pngdatamodel_events.png

 

 

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.

api_token.png

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.

metric_measure0.png

Info

Sources are created only after measure data is sent. If the source type is not specified, the metrics will be added to TrueSight Intelligence with the source type set to 'unknown'.

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.

Create a metric using Python
# python 3 sample to create metric definitions
# 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)
Create a metric using the POST method
curl https://api.truesight.bmc.com/v1/metrics \
-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.

API_metric.png

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.

metric_measure.png

Warning

You must send metric data before sending measures. If the metrics are not defined, dummy metrics will be created, which you will need to manually delete.

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.

Create a measurement for a metric using Python
# python 3 sample to send measurements
# 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)
Create a measurement for a metric using the POST method
curl https://api.truesight.bmc.com/v1/measurements \
-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.

Note

The device data must be tagged with the application ID before you can set a metric as a KPI.

  1. 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.
  2. From the metrics list screen, click the action menu and select Set as App. KPI.
    After you set a metric as a KPI, the KPI label 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.

Tip

Use the same app_id for metrics originating from multiple sources to associate and view them as part of a single app in the TrueSight Intelligence user interface. If an app with the app_id specified in the code does not exist, a new app is automatically created.

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'.

App_KPIs.png

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 show details 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 events 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.

Metric_Details.png

 

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.

 

Create an event using Python
# python 3 sample to send events
# 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)
Create an event using the POST method
curl https://api.truesight.bmc.com/v1/events \
-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>
}
} '
Info
  • Use the eventClass field to assign a type to the event. This is used by TrueSight Intelligence to categorize events, and you can filter the event list using this field. For example, if you are sending events from various social media sources and want to bucket them, use Social as the value for eventClass.
  • Use the app_id field to associate the event to a TrueSight Intelligence App. Navigate to Apps, select your application, and click Events to view the associated events.

For more information, see /v1/post/events.

API_mapping.png

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.

Icon_Type.png

Icon_Severity.png

Icon_status.png

Type_filter.png

Severity_filter.png

Status_filter.png

Customize visualization

View and create custom bar charts and donuts for a visual representation of event data.

Ch_EventsByType.png

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.

Search_time.png

Click the search icon 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.

Correlation_chart.png

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.

Stats_applied.png

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.

Compare_TimePeriod.jpg

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*