Metrics

LeanIX Metrics helps you to display KPIs and their development over time in the context of the right Fact Sheet.

πŸ‘

Metrics V2

This page documents V2 of the Metrics Service. If you used Metrics V1 in the past, you will notice that the API is more explicit than in V1.

In case you have existing scripts or processes based on Metrics V1, we've got you covered - all Metrics V1 URLs will keep working and behave just as before.

Metrics Overview

In modern IT organizations, a wide range of expert tools generate high amounts of data. The big challenge is to leverage this data. According to Gartner, 90% of the information assets from big data analytics efforts through 2017 will be siloed and unleveragable. LeanIX Metrics allows to display time series data in the context of Fact Sheets and thereby establish a useful business context.

With LeanIX Metrics, you can store time series data in LeanIX and create interactive charts to display the data. In addition the data can be linked to Fact Sheets, presented on the Dashboard or be displayed within the "Reports" area.

975975

Best Use

The following whitepaper gives you a case study and 5 concrete scenarios on the use of LeanIX metrics:

LeanIX Metrics - Data is Only Valuable in the Right Context

Charts

Create Chart

Navigate over to the Administration area, by selecting the person icon available in the upper right hand corner. Then select Metrics from the left hand panel.

28522852

Once you have imported the points the measurement is available in your workspace. You can create a chart and define other specifics.

To do so select the plus icon next to the measurement that you would like to graphically represent.

13011301

Associate a chart to a measurement.

19051905

Give the chart a name, define the Y axis and time span.

Associate series information, by using the drop downs. The field name directly corresponds to the key fields in the measure JSON. Define the color for this particular field and the Type of chart, the options are bar, line and area, as well as other information.

19041904

Associate Series information

Link the Fact Sheet ID used in LeanIX to the right field you provided by adding a rule.

Use the Add button to continue adding Series information to your chart.

19081908

Developer Resources

Definitions

Key

Definition

Schema (V1 name: "measurement")

Schemas contain data points stored over time, which are related to the same topic. The schema defines which Metrics (numeric attributes) and Dimensions (string attributes to filter in charts) exist in points.

Point

Each data-point is stored for a specific moment (timestamp) and has one or more values for that instant of time. The values are stored in Metric attributes.

Metric attributes (V1 name: "fields")

Each data-point stores has one or more Metrics, which contain numeric values that have been collected for the instant of time associated with the data point. When creating a chart the values of the fields can be displayed as a series. For that different aggregation functions are available such as COUNT or SUM.

Dimension attributes (V1 name: "tags")

Furthermore a data-point has Dimension attributes, consisting of a key and a value.

The Dimensions further describe a data point and enable to filter for certain data points when displaying a chart for different contexts.

Import your first metric

To import your first metric, go to API Explorer - Metrics EU or USA customers please navigate to API Explorer - Metrics USA

You need to generate an API Token by using the Technical User functionality and enter it on the top right to execute queries directly from the API documentation.

In the API Explorer, you can see all the available actions.

15081508

πŸ“˜

Change to Metrics V1

Schemas are what was called Measurements in Metrics V1. In contrast to V1, schemas are not created or altered implicity by writing points. Instead, a schema has to be created explicitly via the schemas API.

Use this code snippet as body to POST /schemas to create a new schema named "My First Metric":

{
  "name": "My First Metric",
  "description": "This is a test metric for LeanIX EAM docs",
  "attributes": [
    {
      "name": "Availability",
      "type": "metric"
    },
    {
      "name": "factSheetID",
      "type": "dimension"
    }
  ]
}

This call will return the UUID of the newly created schema. Then write a point to this schema by sending a POST request to /schemas/<schema_uuid>/points with the following body:

{
  "timestamp": 1621608440,
  "Availability": 100,
  "factSheetID": "<your Fact Sheet ID>"
}

You need to adapt to your context. Now, go to Admin -> Metrics, and you should see the first measurement.

Use Python

We provide a showcase python implementation here:
LeanIX Metrics Python Script to import metrics

API Documentation

For more details on the Metrics API and supported functionalities, have a look at the
OpenAPI docs. There, all endpoints are explained with examples and descriptions.

Utilize the Integration API

The Integration API provides the ability to import and export data using a generic LeanIX Data Interchange Format (LDIF). LDIF is a JSON format with a very simple structure described in the following sections. All mapping and processing of the incoming and outgoing data is done using "Data Processors" that are configured behind the API. Configuration of the processors can be done using the UI, please see the Setup page for more information. The configurations can be managed using the Integration API as well.

Please see the Integration API documentation for Metrics Example.

Steps to Create Integration

Steps

Notes

Review Swagger API documentation

https://dev.leanix.net/docs/available-apis#section-metrics-api-real-time-data

Schemas should contain the uploaded data, split into Points

Each Point has a unique time stamp

Charts describe how to represent the Schema graphically

For example as a Bar Chart

Charts contain Rules which define how the measurement data is mapped to your Fact Sheets (one option is to map using the External ID)


Did this page help you?