Send telemetry
This page describes StackState version 4.1.
The StackState 4.1 version range is End of Life (EOL) and no longer supported. We encourage customers still running the 4.1 version range to upgrade to a more recent release.

Overview

StackState can either pull telemetry from a data source or can receive pushed telemetry. Pushed telemetry is stored by StackState, while pulled telemetry is not. Pushed telemetry is stored for the duration of the configured retention period. This page describes how telemetry can be pushed.
There are several ways to send telemetry to StackState. A large number of integrations are provided out of the box that may help you get started. If there is no out of the box integration you can send telemetry to StackState using either HTTP or the StackState CLI.

Sending telemetry over HTTP

StackState's receiver API is responsible for receiving both telemetry and topology. By default the receiver API is hosted at https://<baseUrl>:<receiverPort>/stsAgent/intake?api_key=<API_KEY>. Both the base URL and API_KEY are set during installation. For details see:
Telemetry is sent to the receiver API via HTTP POST and has a common JSON object for all messages. One message can contain multiple metrics and multiple events.
1
{
2
"collection_timestamp": 1548855554, // int - the epoch timestamp for the collection
3
"events": {}, // see section on events
4
"internalHostname": "localdocker.test", // string - the host that is sending this data
5
"metrics": [], // see section on metrics
6
"service_checks": [],
7
"topologies": [] // used for sending topological data
8
}
Copied!
Note: Depending on your StackState configuration, metrics or events that are too old will be ignored.

Metrics

Metrics can be sent to the receiver API using the metrics property. Every metric has a name, timestamp, value, hostname, type and optionally a set of tags.
Example of a single metric:
1
[
2
"test.metric", // string - name of the metric
3
1548857152, // int - the epoch timestamp for the metric
4
10.0, // double - value of the metric
5
{
6
"hostname": "localdocker.test", // string - the host this metric is from
7
"tags": [ // (optional) list - a list of tags to associate with this metric. Colon separated key/value pairs.
8
"tag_key1:tag_value1",
9
"tag_key2:tag_value2"
10
],
11
"type": "gauge" // string - type of metric options: gauge, count, rate, counter, raw
12
}
13
]
Copied!
Multiple metrics can be sent in one message. The timestamp and value of the metric is what is used to plot the metrics as a time series. The name and tags can be used to define a metric stream in StackState.
curl example:
1
curl -X POST \
2
'http://<stackstateURL>/stsAgent/intake?api_key=<API_KEY>' \
3
-H 'Content-Type: application/json' \
4
-d '{
5
"collection_timestamp": 1548857167,
6
"events": {},
7
"internalHostname": "localdocker.test",
8
"metrics": [
9
[
10
"test.metric",
11
1548857152,
12
10.0,
13
{
14
"hostname": "localdocker.test",
15
"tags": [
16
"tag_key1:tag_value1",
17
"tag_key2:tag_value2"
18
],
19
"type": "gauge"
20
}
21
],
22
[
23
"test.metric",
24
1548857167,
25
10.0,
26
{
27
"hostname": "localdocker.test",
28
"tags": [
29
"tag_key1:tag_value1",
30
"tag_key2:tag_value2"
31
],
32
"type": "gauge"
33
}
34
]
35
],
36
"service_checks": [],
37
"topologies": []
38
}'
Copied!
You can also send metrics to StackState with the CLI metric send command.
Metric names cannot start with any of the following prefixes:
  • host
  • name
  • timestamp
  • timeReceived
  • labels
  • tags
  • values

Events

Events can be sent to the receiver API using the events property. Every event has a name, timestamp, and optionally msg_title, msg_text, tags and source_type_name.
Example of a single event:
1
"event.test": [ // string - the event name
2
{
3
"msg_text": "event_text", // (optional) string - the text body of the event
4
"msg_title": "event_title", // (optional) string - the title of the event,
5
"source_type_name": "event.test", // (optional) string - the source type name
6
"tags": [ // (optional) list - a list of tags to associate with this event. Colon separated key/value pairs.
7
"tag_key1:tag_value1",
8
"tag_key2:tag_value2"
9
],
10
"timestamp": 1548857342 // int - the epoch timestamp for the event
11
}
12
]
Copied!
Multiple events can be sent in one message. Any of an events' properties can be used to define an event stream in StackState.
curl example:
1
curl -X POST \
2
'http://<stackstateURL>/stsAgent/intake?api_key=<API_KEY>' \
3
-H 'Content-Type: application/json' \
4
-d '{
5
"collection_timestamp": 1548857342,
6
"events": {
7
"event.test01": [
8
{
9
"msg_text": "event_text",
10
"msg_title": "event_title",
11
"source_type_name": "event.test",
12
"tags": [
13
"tag_key1:tag_value1",
14
"tag_key2:tag_value2"
15
],
16
"timestamp": 1548857342
17
},
18
{
19
"msg_text": "event_text",
20
"msg_title": "event_title",
21
"source_type_name": "event.test",
22
"tags": [
23
"tag_key1:tag_value1",
24
"tag_key2:tag_value2"
25
],
26
"timestamp": 1548857340
27
}
28
],
29
"event.test02": [
30
{
31
"msg_text": "event_text",
32
"msg_title": "event_title",
33
"source_type_name": "event.test",
34
"tags": [
35
"tag_key1:tag_value1",
36
"tag_key2:tag_value2"
37
],
38
"timestamp": 1548857342
39
}
40
]
41
},
42
"internalHostname": "localdocker.test",
43
"metrics": [],
44
"service_checks": [],
45
"topologies": []
46
}'
Copied!
You can also send events to StackState with the CLI event send command.
Event names cannot start with any of the following prefixes:
  • host
  • name
  • title
  • eventType
  • message
  • timestamp
  • timeReceived
  • labels
  • tags
Last modified 5mo ago