Naar hoofdinhoud gaan

Samples index

Endpoints [GET]:
EndpointBeschrijving
/api/[app_id]/samples.jsonDit geeft ALLE sampletypes terug
/api/[app_id]/samples/performance.jsonDit geeft performance-samples terug
/api/[app_id]/samples/errors.jsonDit geeft error-samples terug
Parameters:
ParamTypeBeschrijving
action_idstringVoorbeeld: BlogPostsController-hash-show
exceptionstringVoorbeeld: NoMethodError
sincetimestamp/integerAlle tijden zijn UTC
beforetimestamp/integerAlle tijden zijn UTC
limitintegerHet aantal teruggegeven entries (standaard 10)
count_onlyboolean(true/false) Om alleen een count terug te geven
Escape actions door te vervangen:
  • # met -hash-
  • / met -slash-
  • . met -dot-
Dus BlogPostsController#show wordt: BlogPostsController-hash-show Een voorbeeld van een volledige request zou zijn:
Shell
https://appsignal.com/api/5114f7e38c5ce90000000011/samples.json?token=HseUe&action_id=AccountsController-hash-index&exception=ActionView::Template::Error&since=1374843246

Resultaat

Dit endpoint geeft de volgende JSON terug (een trage sample en een errorsample):
{
  "count": 2,
  "log_entries": [
    {
      "id": "51f29e7b183d700800150358_SlowController#show_1476962400",
      "action": "SlowController#show",
      "path": "/slow-request",
      "duration": 3182.545407,
      "status": 200,
      "time": 1476962400,
      "is_exception": false,
      "exception": {
        "name": null
      }
    },
    {
      "id": "57f653fa16b7e24cb0dc9e2b_ErrorController#trigger_1475761080",
      "action": "ErrorController#trigger",
      "path": "/error-request",
      "duration": null,
      "status": null,
      "time": 1475761080,
      "is_exception": true,
      "exception": {
        "name": "ActionView::Template::Error"
      }
    }
  ]
}

Samples show

Endpoint [GET]: /api/[app_id]/samples/[id].json Parameters:
ParamTypeBeschrijving
idstringGesanitiseerd sample-id (voorbeeld: 51f29e7b183d700800150358_SlowController-hash-show_1476962400)

Resultaat

Dit is een SLOW log entry:
{
  "id": "51f29e7b183d700800150358_SlowController#show_1476962400",
  "action": "slow#request",
  "db_runtime": 500.0,
  "duration": 300.0,
  "environment": {},
  "hostname": "app1",
  "is_exception": null,
  "kind": "http_request",
  "params": {},
  "path": "/blog",
  "request_format": "html",
  "request_method": "GET",
  "session_data": {},
  "status": "200",
  "view_runtime": 500.0,
  "time": 1002700800,
  "end": 978339601,
  "allocation_count": 110101,
  "events": [
      {
          "action": "query",
          "duration": 250.0,
          "group": "mongoid",
          "name": "query.mongoid",
          "payload": {
              "query": "this is a mongoid query"
          },
          "time": 0,
          "end": 0
          "digest": 00000,
          "allocation_count": 1010101

      }
  ],
  "exception": null
}
Dit is een ERROR log entry:
{
  "id": "57f653fa16b7e24cb0dc9e2b_ErrorController#trigger_1475761080",
  "action": "Error#trigger",
  "db_runtime": 500.0,
  "duration": null,
  "environment": {
    "HTTP_USER_AGENT": "Mozilla/5.0 (Macintosh"
  },
  "hostname": "app1",
  "is_exception": true,
  "kind": "http_request",
  "params": {
    "id": 1,
    "get": "something"
  },
  "path": "/blog",
  "request_format": "html",
  "request_method": "GET",
  "session_data": {
    "current_user_id": 1
  },
  "status": "200",
  "view_runtime": 500.0,
  "time": 1002700800,
  "end": 978339601,
  "events": [],
  "tags": {
    "user": "john doe",
    "id": 1
  },
  "exception": {
    "message": "The method was not found",
    "name": "NoMethodError",
    "backtrace": ["Backtrace line 1", "Backtrace line 2", "Backtrace line 3"]
  }
}
Let op: Als u meer geavanceerde queryfunctionaliteit nodig heeft, zoals het zoeken naar samples op tag, kunt u dat doen met onze GraphQL API. Bekijk de documentatie van de GraphQL API voor queryvoorbeelden en meer details.