A newer version is available. For the latest information, see the
current release documentation.
Span Indicesedit
Spans are stored in separate indices of the format apm-[version]-span-[date].
Conceptually, spans are part of transactions.
Example documentsedit
See how span documents can look like when indexed in Elasticsearch:
{
"events": [
{
"@timestamp": "2018-07-30T18:53:42.281Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"parent": {
"id": "abcdef0123456789"
},
"processor": {
"event": "span",
"name": "transaction"
},
"service": {
"name": "backendspans"
},
"span": {
"action": "query.custom",
"duration": {
"us": 141581
},
"id": "abcdef01234567",
"name": "GET /api/types",
"subtype": "postgresql",
"type": "db"
},
"timestamp": {
"us": 1532976822281000
},
"trace": {
"id": "fdedef0123456789abcdef9876543210"
},
"transaction": {
"id": "01af25874dec69dd"
}
},
{
"@timestamp": "2018-07-30T18:53:42.281Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"parent": {
"id": "0000000011111111"
},
"processor": {
"event": "span",
"name": "transaction"
},
"service": {
"name": "backendspans"
},
"span": {
"duration": {
"us": 32592
},
"id": "1234abcdef567895",
"name": "GET /api/types",
"start": {
"us": 22000
},
"type": "request"
},
"timestamp": {
"us": 1532976822281000
},
"trace": {
"id": "abcdef0123456789abcdef9876543210"
},
"transaction": {
"id": "ab45781d265894fe"
}
},
{
"@timestamp": "2018-08-01T10:00:00.001845Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"labels": {
"tag1": "value1",
"tag2": 123,
"tag3": 12.34,
"tag4": true
},
"parent": {
"id": "abcdefabcdef7890"
},
"processor": {
"event": "span",
"name": "transaction"
},
"service": {
"name": "backendspans"
},
"span": {
"duration": {
"us": 3564
},
"id": "0123456a89012345",
"name": "GET /api/types",
"start": {
"us": 1845
},
"subtype": "http",
"type": "request"
},
"timestamp": {
"us": 1533117600001845
},
"trace": {
"id": "abcdef0123456789abcdef9876543210"
},
"transaction": {
"id": "ab23456a89012345"
}
},
{
"@timestamp": "2018-08-01T10:00:00Z",
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"parent": {
"id": "ababcdcdefefabde"
},
"processor": {
"event": "span",
"name": "transaction"
},
"service": {
"name": "backendspans"
},
"span": {
"action": "call",
"duration": {
"us": 13980
},
"id": "abcde56a89012345",
"name": "get /api/types",
"start": {
"us": 0
},
"subtype": "http",
"sync": false,
"type": "request"
},
"timestamp": {
"us": 1533117600000000
},
"trace": {
"id": "abcdef0123456789abcdef9876543210"
}
},
{
"@timestamp": "2018-08-01T10:00:00.00283092Z",
"agent": {
"ephemeral_id": "justanid",
"name": "elastic-ruby",
"version": "2.2"
},
"parent": {
"id": "abcdef0123456789"
},
"processor": {
"event": "span",
"name": "transaction"
},
"service": {
"name": "service1"
},
"span": {
"action": "query",
"db": {
"instance": "customers",
"statement": "SELECT * FROM product_types WHERE user_id=?",
"type": "sql",
"user": {
"name": "readonly_user"
}
},
"duration": {
"us": 3781
},
"http": {
"method": "get",
"response": {
"status_code": 200
},
"url": {
"original": "http://localhost:8000"
}
},
"id": "1234567890aaaade",
"name": "SELECT FROM product_types",
"stacktrace": [
{
"exclude_from_grouping": false,
"filename": "net.js",
"line": {
"number": 547
}
},
{
"context": {
"post": [
" ins.currentTransaction = prev",
"}"
]
},
"exclude_from_grouping": false,
"filename": "file2.js",
"line": {
"number": 12
}
},
{
"abs_path": "net.js",
"context": {
"post": [
" ins.currentTransaction = prev",
" return result"
],
"pre": [
" var trans = this.currentTransaction",
""
]
},
"exclude_from_grouping": false,
"filename": "net.js",
"function": "onread",
"library_frame": true,
"line": {
"column": 4,
"context": "line3",
"number": 547
},
"module": "some module",
"vars": {
"key": "value"
}
}
],
"start": {
"us": 2830
},
"subtype": "postgresql",
"sync": true,
"type": "db"
},
"timestamp": {
"us": 1533117600002830
},
"trace": {
"id": "abcdef0123456789abcdef9876543210"
}
}
]
}