Metrics exporter

Use metrics exporter to export error and crash data as hierarchical groupings of time-series metrics that can be pushed or pulled to external systems like Circonus, Datadog, Graphite, Grafana, Prometheus, and InfluxDB.

To use the metric export feature, you need to define:

  • Metric Sets: Are collections of different metrics that will be shared with one or more Metric Stores.
  • Metrics: Are defined as an aggregate query with scalar values (i.e. unique or count or min or max) in the results.
  • Metric Stores: Used to share metric information with. Metric Stores are connected to one or more Metrics Sets.

Metrics sets

Metric sets are containers used for grouping various metrics together. Metric sets can be connected to one or more metric stores. Metrics are created by defining the query in the Explore view and using the 'Export As Metric' function.

To create a metrics set, in the Unity Editor, go to your project’s Settings > Metrics exporter > Create a metrics set in explore.

In the Explore view, create a query that mimics the shape of the metrics you want to push to your dashboards. You can make use of Filters, Group By, and Aggregates that generate scalar values (i.e. count, unique, min, max, sum, first, last).

Metrics stores

Metric stores use adapters to connect with third party stores via push or pull mechanism. When creating a metric store, you’ll specify a name, a period (in seconds) for how often to share data, and choose an adapter to use. Depending on the adapter you choose, you’ll need to specify additional connection information. Please see your third party's documentation for the best way to ingest metrics from third-party systems.

To create a metrics store, in the Unity Editor, go to your project’s Settings > Metrics exporter.

Supported metrics stores

The following adapters are supported for metrics stores:

Circonus

You can connect to Circonus via one of two adapters:

  • Circonus_pull: Generates a randomly secure URL from which to pull JSON data and a randomly generated username and password with basic authentication. No additional configuration is required.

    1. From metrics exporter, copy the generated URL (View details) and paste it into your Circonus integration as a JSON:Pull check.
  • Circonus_push:

    1. In Circonus, set up a JSON Push check then copy the Data Submission URL that Circonus provides.
    2. In Metrics exporter, create a new Circonus_push adapter then paste the Data Submission URL from Circonus. You can configure the frequency (in minutes) at which metrics are pushed to this URL. The default is 60 seconds.

Datadog

You can connect to Datadog via the HTTP Post API with an API key. When you create a Datadog adapter, you must specify a DD_CLIENT_API_KEY to use. You can configure the frequency (in minutes) at which metrics are pushed to this API. The default is 60 seconds.

Graphite

You can connect to Graphite via the Carbon API and share plaintext as described here. When you create a Graphite adapter, specify a hostname and a port to write data into, netcat style. You can configure the frequency (in minutes) at which metrics are pushed to this API. The default is 60 seconds.

Grafana

You can connect to Grafana via the HTTP API. Depending on whether you are using a shared or dedicated cluster, you must specify:

  • An instance URL:

    • If it looks like https://graphite-us-central1.grafana.net/metrics, then it is a shared instance and an instance ID is also required.
    • If it looks like https://tsdb-123-your-company-name.hosted-metrics.grafana.net/graphite then it is a dedicated instance and you do not require an instance ID.
  • An API key.

  • An instance ID (optional): See the description for Instance URL above.

You can also configure the frequency (in minutes) at which metrics are pushed to this API. The default is 60 seconds.

Prometheus

You can connect to Prometheus via a randomly generated secure URL used to scrape from. No additional configuration is required. See the Prometheus documentation on targets to scrape.

InfluxDB

You can connect to InfluxDB with the InfluxDB API. You must specify the URL to post to. You can also configure the frequency (in minutes) at which metrics are pushed to this API. The default is 60 seconds.