Skip to content

sentry sdk가 보내오는실제 json 구조

Dongmin Shin edited this page Nov 29, 2020 · 1 revision

express.js 예시

{
  "event_id": "35e4b80ee2e344d295e2f2778fd33846",
  "project": 5519287,
  "release": null,
  "dist": null,
  "platform": "node",
  "message": "",
  "datetime": "2020-11-20T06:45:12.060000Z",
  "tags": [
    ["environment", "production"],
    ["handled", "yes"],
    ["level", "error"],
    ["mechanism", "generic"]
  ],
  "_metrics": { "bytes.ingested.event": 7476, "bytes.stored.event": 11719 },
  "breadcrumbs": {
    "values": [
      {
        "category": "console",
        "timestamp": 1605854711.023,
        "message": "test",
        "type": "default",
        "level": "info"
      },
      {
        "category": "console",
        "timestamp": 1605854711.029,
        "message": "[]",
        "type": "default",
        "level": "info"
      }
    ]
  },
  "culprit": "mainHandler(C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\routes\\index)",
  "environment": "production",
  "exception": {
    "values": [
      {
        "stacktrace": {
          "frames": [
            {
              "function": "router",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "pre_context": [
                " * @public",
                " */",
                "",
                "var proto = module.exports = function(options) {",
                "  var opts = options || {};",
                "",
                "  function router(req, res, next) {"
              ],
              "post_context": [
                "  }",
                "",
                "  // mixin Router class functions",
                "  setPrototypeOf(router, proto)",
                "",
                "  router.params = {};",
                "  router._params = [];"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "lineno": 47,
              "colno": 12,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "    router.handle(req, res, next);"
            },
            {
              "function": "Function.handle",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "pre_context": [
                "    });",
                "  }",
                "",
                "  // setup basic req values",
                "  req.baseUrl = parentUrl;",
                "  req.originalUrl = req.originalUrl || req.url;",
                ""
              ],
              "post_context": [
                "",
                "  function next(err) {",
                "    var layerError = err === 'route'",
                "      ? null",
                "      : err;",
                "",
                "    // remove added slash"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "lineno": 174,
              "colno": 3,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "  next();"
            },
            {
              "function": "next",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "pre_context": [
                "    // Capture one-time layer values",
                "    req.params = self.mergeParams",
                "      ? mergeParams(layer.params, parentParams)",
                "      : layer.params;",
                "    var layerPath = layer.path;",
                "",
                "    // this should be done for the layer"
              ],
              "post_context": [
                "      if (err) {",
                "        return next(layerError || err);",
                "      }",
                "",
                "      if (route) {",
                "        return layer.handle_request(req, res, next);",
                "      }"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "lineno": 275,
              "colno": 10,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "    self.process_params(layer, paramcalled, req, res, function (err) {"
            },
            {
              "function": "Function.process_params",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "pre_context": [
                "  var params = this.params;",
                "",
                "  // captured parameters from the layer, keys and values",
                "  var keys = layer.keys;",
                "",
                "  // fast track",
                "  if (!keys || keys.length === 0) {"
              ],
              "post_context": [
                "  }",
                "",
                "  var i = 0;",
                "  var name;",
                "  var paramIndex = 0;",
                "  var key;",
                "  var paramVal;"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "lineno": 335,
              "colno": 12,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "    return done();"
            },
            {
              "function": "null.<anonymous>",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "pre_context": [
                "    // this should be done for the layer",
                "    self.process_params(layer, paramcalled, req, res, function (err) {",
                "      if (err) {",
                "        return next(layerError || err);",
                "      }",
                "",
                "      if (route) {"
              ],
              "post_context": [
                "      }",
                "",
                "      trim_prefix(layer, layerError, layerPath, path);",
                "    });",
                "  }",
                "",
                "  function trim_prefix(layer, layerError, layerPath, path) {"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\index.js",
              "lineno": 281,
              "colno": 22,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "        return layer.handle_request(req, res, next);"
            },
            {
              "function": "Layer.handle [as handle_request]",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\layer.js",
              "pre_context": [
                "",
                "  if (fn.length > 3) {",
                "    // not a standard request handler",
                "    return next();",
                "  }",
                "",
                "  try {"
              ],
              "post_context": [
                "  } catch (err) {",
                "    next(err);",
                "  }",
                "};",
                "",
                "/**",
                " * Check if this route matches `path`, if so"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\layer",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\layer.js",
              "lineno": 95,
              "colno": 5,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "    fn(req, res, next);"
            },
            {
              "function": "Route.dispatch",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\route.js",
              "pre_context": [
                "  var method = req.method.toLowerCase();",
                "  if (method === 'head' && !this.methods['head']) {",
                "    method = 'get';",
                "  }",
                "",
                "  req.route = this;",
                ""
              ],
              "post_context": [
                "",
                "  function next(err) {",
                "    // signal to exit route",
                "    if (err && err === 'route') {",
                "      return done();",
                "    }",
                ""
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\route",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\route.js",
              "lineno": 112,
              "colno": 3,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "  next();"
            },
            {
              "function": "next",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\route.js",
              "pre_context": [
                "    if (layer.method && layer.method !== method) {",
                "      return next(err);",
                "    }",
                "",
                "    if (err) {",
                "      layer.handle_error(err, req, res, next);",
                "    } else {"
              ],
              "post_context": [
                "    }",
                "  }",
                "};",
                "",
                "/**",
                " * Add a handler for all HTTP verbs to this route.",
                " *"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\route",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\route.js",
              "lineno": 137,
              "colno": 13,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "      layer.handle_request(req, res, next);"
            },
            {
              "function": "Layer.handle [as handle_request]",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\layer.js",
              "pre_context": [
                "",
                "  if (fn.length > 3) {",
                "    // not a standard request handler",
                "    return next();",
                "  }",
                "",
                "  try {"
              ],
              "post_context": [
                "  } catch (err) {",
                "    next(err);",
                "  }",
                "};",
                "",
                "/**",
                " * Check if this route matches `path`, if so"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\layer",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\node_modules\\express\\lib\\router\\layer.js",
              "lineno": 95,
              "colno": 5,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "    fn(req, res, next);"
            },
            {
              "function": "mainHandler",
              "abs_path": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\routes\\index.js",
              "pre_context": [
                "const Tracing = require(\"@sentry/tracing\");",
                "/* GET home page. */",
                "router.get(\"/\", function (req, res, next) {",
                "  res.render(\"index\", { title: \"Express\" });",
                "});",
                "",
                "router.get(\"/error\", function mainHandler(req, res) {"
              ],
              "post_context": [
                "});",
                "",
                "router.get(\"/test\", function mainHandler(req, res) {",
                "  console.info(\"test\");",
                "  console.log(console.logs);",
                "});",
                "module.exports = router;"
              ],
              "module": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\routes\\index",
              "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\routes\\index.js",
              "lineno": 11,
              "colno": 9,
              "in_app": false,
              "data": { "orig_in_app": 1 },
              "context_line": "  throw new Error(\"\uc13c\ud2b8\ub9ac \uc5d0\ub7ec \ubc1c\uc0dd\ud588\uc74c22222222222222\");"
            }
          ]
        },
        "type": "Error",
        "mechanism": { "type": "generic", "handled": true },
        "value": "\uc13c\ud2b8\ub9ac \uc5d0\ub7ec \ubc1c\uc0dd\ud588\uc74c22222222222222"
      }
    ]
  },
  "fingerprint": ["{{ default }}"],
  "grouping_config": {
    "enhancements": "eJybzDhxY3J-bm5-npWRgaGlroGxrpHxBABcTQcY",
    "id": "newstyle:2019-10-29"
  },
  "hashes": ["bd400680af5e7df76ffd2bb6ef14ada9"],
  "key_id": "1407805",
  "level": "error",
  "location": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\routes\\index.js",
  "logger": "",
  "metadata": {
    "function": "mainHandler",
    "type": "Error",
    "value": "\uc13c\ud2b8\ub9ac \uc5d0\ub7ec \ubc1c\uc0dd\ud588\uc74c22222222222222",
    "filename": "C:\\Users\\sdm82\\Desktop\\boostcamp\\sentrytest\\sentrytest\\routes\\index.js"
  },
  "received": 1605854712.848676,
  "sdk": {
    "version": "5.27.4",
    "name": "sentry.javascript.node",
    "packages": [{ "version": "5.27.4", "name": "npm:@sentry/node" }],
    "integrations": [
      "InboundFilters",
      "FunctionToString",
      "Console",
      "OnUncaughtException",
      "OnUnhandledRejection",
      "LinkedErrors",
      "Http",
      "Express"
    ]
  },
  "timestamp": 1605854712.06,
  "title": "Error: \uc13c\ud2b8\ub9ac \uc5d0\ub7ec \ubc1c\uc0dd\ud588\uc74c22222222222222",
  "type": "error",
  "version": "7"
}

Clone this wiki locally