Error Indices

edit

Errors are stored in separate indices of the format apm-[version]-error-[date].

Example documents

edit

See how error documents can look like when indexed in Elasticsearch:

{
    "events": [
        {
            "@timestamp": "2017-05-09T15:04:05.999999Z",
            "context": {
                "custom": {
                    "and_objects": {
                        "foo": [
                            "bar",
                            "baz"
                        ]
                    },
                    "my_key": 1,
                    "some_other_value": "foo bar"
                },
                "process": {
                    "argv": [
                        "node",
                        "server.js"
                    ],
                    "pid": 1234,
                    "ppid": 6789,
                    "title": "node"
                },
                "request": {
                    "body": "Hello World",
                    "cookies": {
                        "c1": "v1",
                        "c2": "v2"
                    },
                    "env": {
                        "GATEWAY_INTERFACE": "CGI/1.1",
                        "SERVER_SOFTWARE": "nginx"
                    },
                    "headers": {
                        "array": [
                            "foo",
                            "bar",
                            "baz"
                        ],
                        "content-type": "text/html",
                        "cookie": "c1=v1; c2=v2",
                        "some-other-header": "foo",
                        "user-agent": "Mozilla Chrome Edge"
                    },
                    "http_version": "1.1",
                    "method": "POST",
                    "socket": {
                        "encrypted": true,
                        "remote_address": "12.53.12.1"
                    },
                    "url": {
                        "full": "https://www.example.com/p/a/t/h?query=string#hash",
                        "hash": "#hash",
                        "hostname": "www.example.com",
                        "pathname": "/p/a/t/h",
                        "port": "8080",
                        "protocol": "https:",
                        "raw": "/p/a/t/h?query=string#hash",
                        "search": "?query=string"
                    }
                },
                "response": {
                    "finished": true,
                    "headers": {
                        "content-type": "application/json"
                    },
                    "headers_sent": true,
                    "status_code": 200
                },
                "service": {
                    "agent": {
                        "name": "elastic-node",
                        "version": "3.14.0"
                    },
                    "environment": "staging",
                    "framework": {
                        "name": "Express",
                        "version": "1.2.3"
                    },
                    "language": {
                        "name": "ecmascript",
                        "version": "8"
                    },
                    "name": "1234_service-12a3",
                    "runtime": {
                        "name": "node",
                        "version": "8.0.0"
                    },
                    "version": "5.1.3"
                },
                "system": {
                    "architecture": "x64",
                    "hostname": "prod1.example.com",
                    "ip": "192.0.0.1",
                    "platform": "darwin"
                },
                "tags": {
                    "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8"
                },
                "user": {
                    "email": "foo@example.com",
                    "id": 99,
                    "username": "foo"
                }
            },
            "error": {
                "culprit": "my.module.function_name",
                "exception": {
                    "attributes": {
                        "foo": "bar"
                    },
                    "code": "42",
                    "handled": false,
                    "message": "The username root is unknown",
                    "module": "__builtins__",
                    "stacktrace": [
                        {
                            "abs_path": "/real/file/name.py",
                            "context": {
                                "post": [
                                    "line4",
                                    "line5"
                                ],
                                "pre": [
                                    "line1",
                                    "line2"
                                ]
                            },
                            "exclude_from_grouping": false,
                            "filename": "file/name.py",
                            "function": "foo",
                            "library_frame": true,
                            "line": {
                                "column": 4,
                                "context": "line3",
                                "number": 3
                            },
                            "module": "App::MyModule",
                            "vars": {
                                "key": "value"
                            }
                        },
                        {
                            "abs_path": "/Users/watson/code/node_modules/elastic/lib/instrumentation/index.js",
                            "context": {
                                "post": [
                                    "    ins.currentTransaction = prev",
                                    "    return result",
                                    "}",
                                    "}",
                                    "",
                                    "Instrumentation.prototype._recoverTransaction = function (trans) {",
                                    "  if (this.currentTransaction === trans) return"
                                ],
                                "pre": [
                                    "  var trans = this.currentTransaction",
                                    "",
                                    "  return instrumented",
                                    "",
                                    "  function instrumented () {",
                                    "    var prev = ins.currentTransaction",
                                    "    ins.currentTransaction = trans"
                                ]
                            },
                            "exclude_from_grouping": false,
                            "filename": "lib/instrumentation/index.js",
                            "function": "instrumented",
                            "line": {
                                "context": "    var result = original.apply(this, arguments)",
                                "number": 102
                            },
                            "vars": {
                                "key": "value"
                            }
                        }
                    ],
                    "type": "DbError"
                },
                "grouping_key": "50f62f37edffc4630c6655ba3ecfcf46",
                "id": "0123456789012345",
                "log": {
                    "level": "warning",
                    "logger_name": "my.logger.name",
                    "message": "My service could not talk to the database named foobar",
                    "param_message": "My service could not talk to the database named %s",
                    "stacktrace": [
                        {
                            "abs_path": "/real/file/name.py",
                            "context": {
                                "post": [
                                    "line4",
                                    "line5"
                                ],
                                "pre": [
                                    "line1",
                                    "line2"
                                ]
                            },
                            "exclude_from_grouping": false,
                            "filename": "/webpack/file/name.py",
                            "function": "foo",
                            "library_frame": false,
                            "line": {
                                "column": 4,
                                "context": "line3",
                                "number": 3
                            },
                            "module": "App::MyModule",
                            "vars": {
                                "key": "value"
                            }
                        },
                        {
                            "abs_path": "/Users/watson/code/node_modules/elastic/lib/instrumentation/index.js",
                            "context": {
                                "post": [
                                    "    ins.currentTransaction = prev",
                                    "    return result",
                                    "}",
                                    "}",
                                    "",
                                    "Instrumentation.prototype._recoverTransaction = function (trans) {",
                                    "  if (this.currentTransaction === trans) return"
                                ],
                                "pre": [
                                    "  var trans = this.currentTransaction",
                                    "",
                                    "  return instrumented",
                                    "",
                                    "  function instrumented () {",
                                    "    var prev = ins.currentTransaction",
                                    "    ins.currentTransaction = trans"
                                ]
                            },
                            "exclude_from_grouping": false,
                            "filename": "lib/instrumentation/index.js",
                            "function": "instrumented",
                            "line": {
                                "context": "    var result = original.apply(this, arguments)",
                                "number": 102
                            },
                            "vars": {
                                "key": "value"
                            }
                        }
                    ]
                }
            },
            "processor": {
                "event": "error",
                "name": "error"
            },
            "timestamp": {
                "us": 1494342245999999
            }
        },
        {
            "@timestamp": "2018-08-09T14:59:05.999Z",
            "context": {
                "process": {
                    "argv": [
                        "node",
                        "server.js"
                    ],
                    "pid": 1234,
                    "ppid": 6789,
                    "title": "node"
                },
                "service": {
                    "agent": {
                        "name": "elastic-node",
                        "version": "3.14.0"
                    },
                    "environment": "staging",
                    "framework": {
                        "name": "Express",
                        "version": "1.2.3"
                    },
                    "language": {
                        "name": "ecmascript",
                        "version": "8"
                    },
                    "name": "1234_service-12a3",
                    "runtime": {
                        "name": "node",
                        "version": "8.0.0"
                    },
                    "version": "5.1.3"
                },
                "system": {
                    "architecture": "x64",
                    "hostname": "prod1.example.com",
                    "ip": "192.0.0.1",
                    "platform": "darwin"
                }
            },
            "error": {
                "exception": {
                    "message": "Cannot read property 'baz' no defined"
                },
                "grouping_key": "ae0232fed4cb40e7ebc62a585a421d60",
                "id": "cdefab0123456789"
            },
            "processor": {
                "event": "error",
                "name": "error"
            },
            "timestamp": {
                "us": 1533826745999000
            }
        },
        {
            "@timestamp": "2018-08-01T10:00:00Z",
            "context": {
                "process": {
                    "argv": [
                        "node",
                        "server.js"
                    ],
                    "pid": 1234,
                    "ppid": 6789,
                    "title": "node"
                },
                "service": {
                    "agent": {
                        "name": "elastic-node",
                        "version": "3.14.0"
                    },
                    "environment": "staging",
                    "framework": {
                        "name": "Express",
                        "version": "1.2.3"
                    },
                    "language": {
                        "name": "ecmascript",
                        "version": "8"
                    },
                    "name": "1234_service-12a3",
                    "runtime": {
                        "name": "node",
                        "version": "8.0.0"
                    },
                    "version": "5.1.3"
                },
                "system": {
                    "architecture": "x64",
                    "hostname": "prod1.example.com",
                    "ip": "192.0.0.1",
                    "platform": "darwin"
                }
            },
            "error": {
                "exception": {
                    "type": "DbError"
                },
                "grouping_key": "c3868d6704b923014eaffea034e70a3d",
                "id": "cdefab0123456789"
            },
            "processor": {
                "event": "error",
                "name": "error"
            },
            "timestamp": {
                "us": 1533117600000000
            }
        },
        {
            "@timestamp": "2018-08-09T15:04:05.999Z",
            "context": {
                "process": {
                    "argv": [
                        "node",
                        "server.js"
                    ],
                    "pid": 1234,
                    "ppid": 6789,
                    "title": "node"
                },
                "service": {
                    "agent": {
                        "name": "elastic-node",
                        "version": "3.14.0"
                    },
                    "environment": "staging",
                    "framework": {
                        "name": "Express",
                        "version": "1.2.3"
                    },
                    "language": {
                        "name": "ecmascript",
                        "version": "8"
                    },
                    "name": "1234_service-12a3",
                    "runtime": {
                        "name": "node",
                        "version": "8.0.0"
                    },
                    "version": "5.1.3"
                },
                "system": {
                    "architecture": "x64",
                    "hostname": "prod1.example.com",
                    "ip": "192.0.0.1",
                    "platform": "darwin"
                }
            },
            "error": {
                "grouping_key": "d6b3f958dfea98dc9ed2b57d5f0c48bb",
                "id": "abcdef0123456789",
                "log": {
                    "level": "custom log level",
                    "message": "Cannot read property 'baz' of undefined"
                }
            },
            "parent": {
                "id": "9632587410abcdef"
            },
            "processor": {
                "event": "error",
                "name": "error"
            },
            "timestamp": {
                "us": 1533827045999000
            },
            "trace": {
                "id": "0123456789abcdeffedcba0123456789"
            },
            "transaction": {
                "id": "1234567890987654"
            }
        }
    ]
}