Custom Metrics
About Custom Metrics
- Allow users to configure how metrics for their spans are collected depending on their reporting needs.
- Users can set up their own definitions of metrics based on properties of the spans, which enables them to configure customized ways of monitoring their applications.
- Custom metrics use span filters to select the spans for which metrics are to be computed. This allows users to define different sets of metrics for different types of spans.
- For fine-grained reporting, the metrics can be assigned dimensions which allows for grouping and filtering based on those dimensions. For example, reporting users per browser type or articles sold per country.
- Custom Metrics are configured at APM Domain level.
Custom Metrics Example Use Cases
Example 1: Create a metric to track the number of errors that happen during the checkout step.
For this use case, you need to identify the spans which have failed
during the checkout step. Assuming the URL for the checkout page ends with
checkout.jsp
, you can define a Span Filter
that checks if the HttpUrl
attribute ends with
checkout.jsp
, and also checks if the Error
attribute is set to true.
HttpUrl like '%checkout.jsp' AND Error = 'true'
As value source, select the SpanErrorCount
. This will
have the value 1
if there was an error in the page and
0
otherwise. Additionally, it might be interesting to know if
the errors only happen with specific browsers so you can add the
BrowserName
dimension.
Example 2: Create a metric to track the home page response time
In this scenario, we want to track the response time of our home page. For this, you
can use the PageResponseTime
value source. You can set up a
Span Filter
to match your home page called
home.php
.
HttpUrl like '%home.php' AND ApmrumType = 'PAGE'
Now, select PageResponseTime
for the value source. Additionally, you
can add dimensions as you see fit. For example, GeoCountry
to get a
breakdown on response times per country.
Manage Custom Metrics
-
Go to the APM Domains page and click on the desired APM domain.
The Domain Details page is displayed.
-
Go to Resources, located at the bottom left and click Custom Metrics
The Custom Metrics pane is displayed.
-
From the Custom Metrics pane, click Create Custom Metric.
The Create Custom Metric window is displayed.
- Enter the Metric Name of the new custom metric.
- From the Span filter box, choose a predefined (global) span filter or type in a local span filter definition.
- From the Metric dropdown list, select a metric.
- From the Dimensions dropdown list, select one or multiple dimensions. The maximum number of dimensions is 10.
- Optional: Click Validate custom metric to check if any recently ingested spans match the configured span filter. The validation tool allows for checking on ingested spans for up to 24 hours in the past.
- Click Next to proceed to the Metric Storage options.
- From the Compartment dropdown list, select a compartment.
- From the Namespace dropdown list, select a namespace.
- Optional: From the Resource Group dropdown list, select a resource group.
- Click Create.
Use the action menu to edit or delete a custom metric.