appsignal

Exposing More Public Endpoints for Sending Metrics and Errors to AppSignal

Robert Beekman

Robert Beekman on

Exposing More Public Endpoints for Sending Metrics and Errors to AppSignal

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    "name": "traffic_gauge",
4    "metricType": "gauge",
5    "value": 19.8,
6    "tags": { "hostname": "frontend1" }
7  },
8  {
9    "name": "error_counter",
10    "metricType": "counter",
11    "value": 10,
12    "tags": { "hostname": "frontend1", "disk": "vda" }
13  },
14  {
15    "name": "duration_timing",
16    "metricType": "timing",
17    "value": 19,
18    "tags": { "lambda": "login" }
19  },
20  {
21    "name": "duration_timing",
22    "metricType": "histogram",
23    "value": 5,
24    "tags": { "lambda": "login" }
25  }
26]

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

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.

Share this article

RSS
Robert Beekman

Robert Beekman

As a co-founder, Robert wrote our very first commit. He's also our support role-model and knows all about the tiny details in code. Travels and photographs (at the same time).

All articles by Robert Beekman

AppSignal monitors your apps

AppSignal provides insights for Ruby, Rails, Elixir, Phoenix, Node.js, Express and many other frameworks and libraries. We are located in beautiful Amsterdam. We love stroopwafels. If you do too, let us know. We might send you some!

Discover AppSignal
AppSignal monitors your apps