Skip to main content

Custom Metrics

Embrace captures your mobile data, and aggregates it into time series data. This data is useful for monitoring the health of your system. By default, Embrace provides standard, out-of-the-box metrics by default. These can be consumed via the Embrace Metrics API or can be forwarded into your Data Destination of choice.

Custom metrics allow you to define your own time series metrics with custom labels. This feature enables you to create specific metrics that suit your unique needs, beyond the default metrics provided.

Get Started

via Boards

Some Widgets on custom Boards can be directly converted to Custom Metrics.

Open the menu on a Widget, and click "Create Custom Metric". This will open up a Custom Metric creation form, pre-populated with the same parameters as the Widget.

Screenshot of Widgets settings menu Screenshot of custom metrics pre-filled form

From there, follow the rest of the Custom Metric create flow by selecting a (optional) Data Destination and measurement time interval.

via Settings

Go to the Settings page in the Embrace Dashboard and click on the Custom Metrics tab. Here you can create, view, and delete custom metrics. When you define a custom metric, you can specify:

  • Metric - The aggregation you want to track.
  • Name - The name of the metric. Must conform to the Prometheus spec.
  • Filter - (Optional) Aggregate only a subset of the data.
  • Group By - (Optional) Group the data by a set of dimensions. These will become the labels in your time series data.
Screenshot of custom metrics definition tab

After defining a custom metric you must select a Data Destination and time period. You can choose amongst our existing integrations, or you can select the Embrace Metrics API and query the data from there.

Screenshot of custom metrics output tab

via API

Refer to this to understand how to use the public API.

Supported Metrics

Global filters and global group bys are available to use on all the metrics.

  • Global filters: app_version, country, model, os_major_version and os_version.
  • Global group bys: app_version, country, os_major_version, os_version and top_n_market_name.

Metrics with the suffix "_total" are gauges.

MetricDescriptionFiltersGroup by granularityTime granularity
anrs_totalNumber of anrsmethod, sample_typefive_minute, hourly, daily
anrs_duration_totalSum of anrs durationsmethod, sample_typefive_minute, hourly, daily
crashes_totalNumber of crashesmsg, tag_name, tag_value,five_minute, hourly, daily
flutter_exceptions_totalNumber of flutter exceptionsgroup_id, is_handled, msg, stategroup_id, msgfive_minute, hourly, daily
logs_totalNumber of logslog_property_key, log_property_value, msg, typelog_propertyfive_minute, hourly, daily
moments_totalNumber of momentsduration_bucket, moment_property_key, moment_property_value, nameduration_bucket, moment_property_valuefive_minute, hourly, daily
network_requests_successful_duration_totalSum of successful network requests durationsdomain, method, pathtop_n_domain, top_n_pathhourly, daily
network_requests_successful_totalNumber of successful network requestsdomain, duration_bucket (note: currently we do not support duration, only buckets as described in our documentation), method, pathtop_n_domain, top_n_pathhourly, daily
network_requests_totalNumber of network requestsdomain, method, path, status_codestatus_code, top_n_domain, top_n_pathfive_minute, hourly, daily
sessions_totalNumber of sessionshas_anr, session_property_key, sessions_property_valuesession_propertyfive_minute, hourly, daily
sessions_duration_totalSum of sessions durationshas_anr, session_property_key, sessions_property_valuesession_propertyfive_minute, hourly, daily
root_spans_totalNumber of root spansroot_span_attribute_key, root_span_attribute_value, root_span_duration_bucket, root_span_name, root_span_outcomeroot_span_attribute, root_span_duration_bucket, root_span_name, root_span_outcomefive_minute, hourly, daily
root_spans_duration_totalSum of root spans durationroot_span_attribute_key, root_span_attribute_value, root_span_name, root_span_outcomeroot_span_attribute, root_span_name, root_span_outcomefive_minute, hourly, daily
unity_exceptions_totalNumber of unity exceptionsgroup_id, is_handled, msg, stategroup_id, msgfive_minute, hourly, daily
info
  • Refer to this documentation to understand how top_n dimensions work.
  • You can also pull the latest set of supported metrics directly from the API.