Exposing More Public Endpoints for Sending Metrics and Errors to AppSignal

Robert Robert Beekman on

Today, we launch a new feature: sending metrics and errors to AppSignal over our “Public Endpoint” API.

AppSignal has many web frameworks, databases and background job frameworks automatically instrumented when you want to monitor a Node.js, Ruby or Elixir app.

If you have code running on serverless architecture such as AWS Lambda, you can’t run our agent, so our standard integration with all of the out-of-the-box magic won’t work.

For this use case we’re exposing two new endpoints on our “Public Endpoint” API:

Sending Metrics to AppSignal

https://appsignal-endpoint.net/metrics/json

This endpoint accepts metrics in a JSON format. Similar to our StatsD Endpoint, this JSON endpoint allows customers that aren’t able to use an integration to send metrics over to AppSignal.

1
2
3
4
5
6
[
  {"name": "traffic_gauge", "metricType": "gauge", "value": 19.8, "tags": {"hostname": "frontend1"}},
  {"name": "error_counter", "metricType": "counter", "value": 10, "tags": {"hostname": "frontend1", "disk": "vda"}},
  {"name": "duration_timing", "metricType": "timing", "value": 19, "tags": {"lambda": "login"}},
  {"name": "duration_timing", "metricType": "histogram", "value": 5, "tags": {"lambda": "login"}}
]

For more details on supported metrics and the JSON structure, check out our documentation.

Sending Errors to AppSignal

https://appsignal-endpoint.net/metrics/errors

This endpoint allows customers to send errors to AppSignal without using our integrations.

It exposes all the fields used by our integrations, allowing inclusion of all the metadata you are used to seeing in AppSignal such as parameters, tags and breadcrumbs.

An example of the payload that this endpoint accepts is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 {
   "action": "BlogpostController#show",
   "namespace": "frontend",
   "timestamp": 1559201249,
   "error": {
     "name": "StandardError",
     "message": "Error message",
     "backtrace": [
       "backtrace/line:1",
       "backtrace/line:2"
     ]
   },
   "environment": {
     "os": "windows",
     "agent": "super secret user agent"
   },
   "params": {
     "foo": "bar"
   },
   "tags": {
     "account_id": "abc-123"
   },
   "revision": "revision-abc",
   "breadcrumbs": [
     {
       "timestamp": 1559201249,
       "category": "request",
       "action": "http://google.com",
       "message": "request failed",
       "metadata": {
         "code": "not_found"
       }
     }
   ],
   "language": "javascript"
 }

To learn more about each field and the format of the JSON payload, see our documentation.

Wrapping Up

AppSignal works out-of-the-box for many setups. But we also let you build a lot of custom things on top of AppSignal. You can build custom dashboards to display data, you can use the GraphQL API to get data out in a raw form and now, you have another way of adding data to AppSignal. So every corner of your architecture can be monitored with AppSignal, and you get the whole picture.

If you are using AppSignal, let us know if you have any wishes for more ways to send data to AppSignal. If you aren’t using AppSignal yet, check out how to get started with the APM for Node.js, Ruby (on Rails) and Elixir.

10 latest articles

Go back
Ruby magic icon

Subscribe to

Ruby Magic

Magicians never share their secrets. But we do. Sign up for our Ruby Magic email series and receive deep insights about garbage collection, memory allocation, concurrency and much more.

We'd like to set cookies, read why.