All Products
Search
Document Center

Application Real-Time Monitoring Service:Configure a custom interaction event for a trace

Last Updated:Oct 30, 2024

Application Real-Time Monitoring Service (ARMS) allows you to perform a drill down on a single field or the result of a single query statement to gain a deeper insight into data. You can configure interaction events for one or more attributes of a trace. This way, you can query more details about the trace or view the logs and metrics related to the trace. This topic describes how to configure an interaction event.

Interaction events are important for data analysis. You can use interaction events to switch between dimensions or granularities to obtain more detailed information. Trace Explorer allows you to configure interaction events for fields and attributes of a span. The following event types are provided:

  • Open the log library: redirects to the specified Simple Log Service (SLS) Logstore.

  • Customize HTTP Link: redirects to the specified HTTP URL.

  • Open from the edit box: displays the field value in the text or JSON format in a pop-up window.

  • Open Quick Search: redirects to the SLS saved search.

Configure a custom interaction event

  1. On the Trace Explorer page, click a trace ID.

  2. Click on an interface and click Event Config in the Span Details section.

    image

  3. In the Drilldown Config panel, select the effective mode of the interaction event.

    Custom interaction events take effect in two modes: Service event configuration and Global event configuration. The "Service event configuration" mode specifies that the event takes effect only in all traces of the current application, whereas the "Global event configuration" mode specifies that the event takes effect in all traces in the current region.

    image

  4. Click Add fields, select a field and click OK.

    image

  5. Click Add event and select an interaction event from the drop-down list.

    image

  6. Set the parameters for the event and click OK.

    For more information about the parameters, see the Interaction event parameters section.

    image

Trigger a custom interaction event

In the Span Details section, move the pointer over a blue field. A tooltip displays the custom interaction events configured for the field. Click on an event name to trigger the event.

image

Interaction event parameters

Open the log library

When the Open the log library event is triggered, the page redirects to the specified Logstore.

  • Prerequisites

    A Logstore is created. For more information, see Manage a Logstore.

  • Parameters

    Parameter

    Required

    Description

    Custom Name

    Yes

    Enter the name of the custom interaction event. The name is displayed in the tooltip.

    Please select region

    Yes

    Select the region where the SLS project resides.

    Please select the project

    Yes

    Select the name of the SLS project.

    Please select a log repository

    Yes

    Select the name of the SLS Logstore. When the event is triggered, the page redirects to the Logstore.

    Open a new window

    No

    Specify whether to open the Logstore in a pop-up window when the event is triggered.

    Time range

    No

    Select the time range of the data to query in the Logstore. Valid values:

    • Default: The default time range is used, which is 15 Minutes(Relative).

    • Use Query Time: The time range specified in Trace Explorer when the event is triggered is used.

    • Data Point Time: The start time of the time range is the value of the Time Range Field parameter minus that of the Time range field difference parameter. The end time of the time range is the value of the Time Range Field parameter plus the value of the Time range field difference parameter.

    • Relative time range: The specified relative time range is used.

    • Time frame: The hourly points within the specified time frame are used.

    Filter statement

    No

    Enter a filter statement to synchronize it to the Logstore, and add it before the query statement by using the AND operator.

    Click Add variables to add fields as variables to the filter statement and use the field values as filter conditions.

    Example: traceId=${{traceID}} AND spanId=${{spanID}}

Customize HTTP Link

When the Customize HTTP Link event is triggered, the page redirects to the specified HTTP URL.

  • Prerequisites

    An HTTP URL is available.

  • Parameters

    Parameter

    Required

    Description

    Custom Name

    Yes

    Enter the name of the custom interaction event. The name is displayed in the tooltip.

    agreement

    Yes

    Select the protocol of the HTTP URL.

    Link address

    Yes

    Enter the HTTP URL.

    The path in the HTTP URL represents the hierarchical path to the target file. You can click Add variables to add fields as variables in the path. When the URL is clicked, the corresponding field values will replace the parameters in the URL, redirecting to a repositioned HTTP URL.

    Whether to transcode

    No

    Specify whether to encode the HTTP URL.

    Open a new window

    No

    Specify whether to navigate to the HTTP URL in a pop-up window when the event is triggered.

Open from the edit box

When the Open from the edit box interaction event is triggered, the field value is displayed in the text or JSON format in a pop-up window.

Parameter

Required

Description

Custom Name

Yes

Enter the name of the custom interaction event. The name is displayed in the tooltip.

Text type

No

Select a format to display the field value. Valid values: text and JSON.

Open Quick Search

When the Open Quick Search event is triggered, the page redirects to the SLS saved search.

  • Prerequisites

    A saved search is created in SLS. For more information, see Saved search.

    If you want to configure a variable for the interaction event, make sure that the variable has been configured in the query statement of the saved search. For more information, see Variables.

  • Parameters

    Parameter

    Required

    Description

    Custom Name

    Yes

    Enter the name of the custom interaction event. The name is displayed in the tooltip.

    Please select region

    Yes

    Select the region where the SLS project resides.

    Please select the project

    Yes

    Select the name of the SLS project.

    Please select Quick Search

    Yes

    Select the saved search. When the event is triggered, the page redirects to the saved search.

    Open a new window

    No

    Specify whether to open the saved search in a pop-up window when the event is triggered.

    Time range

    No

    Select the time range to query of the saved search. Valid values:

    • Default: The default time range is used, which is 15 Minutes(Relative).

    • Use Query Time: The time range specified in Trace Explorer when the event is triggered is used.

    • Data Point Time: The start time of the time range is the value of the Time Range Field parameter minus that of the Time range field difference parameter. The end time of the time range is the value of the Time Range Field parameter plus the value of the Time range field difference parameter.

    • Relative time range: The specified relative time range is used.

    • Relative time range: The specified relative time range is used.

    Filter statement

    No

    Enter a filter statement to synchronize it to the Logstore, and add it before the query statement by using the AND operator.

    Click Add variables to add fields as variables to the filter statement and use the field values as filter conditions.

    Dynamic variables

    No

    SLS allows you to modify the query statement of the saved search by using variables. If a variable that you specify here is the same as one specified in the query statement, the variable specified here prevails.

    Note

    You can add up to five dynamic variables and five static variables.

    • Dynamic variables

      • Variable: the name of the variable.

      • Variable Value Column: the column in which the variable values are located. The values are used to dynamically replace the variable in the saved search.

    • Static variables

      • Variable: the name of the variable.

      • Value: the value of the static variable, which is used to replace the placeholder variable in the saved search.

    Static variables

    No

Preset interaction events (advanced settings)

Trace Explorer provides preset interaction events. The following table describes the events.

image

Event

Effective field

Description

Use the current condition to query the trace

All except Span Events

Appends the field as a query condition.

View application details

serviceName

Redirects to the Overview tab of the application details page.

View the services provided

spanName

Redirects to the Provided Services tab of the application details page.

View instance monitoring details

IP

Redirects to the Instance Monitoring tab of the application details page.

View raw trace data

TraceID and SpanId

Views the raw trace data stored in SLS.

Usage notes

If you access the Trace Explorer page using a virtual domain name (for example, embedding an ARMS console page into a self-managed web application), you will be redirected to the SLS logon page rather than being able to access the SLS console after triggering the Open the log library or Open Quick Search event. If you are not using a virtual domain name, you can use the Customize HTTP Link event to configure two redirects. Perform the following steps:

  1. Configure the Customize HTTP Link event.

  2. Select the HTTPS protocol and enter the URL of an SLS console page in the Link Address field.

  3. Replace the domain name sls.console.aliyun.com of the URL with sls4service.console.aliyun.com, which is the virtual domain name of SLS. For more information, see Embed console pages and share log data.image

  4. If you want to carry query parameters when you access the Logstore, click Add variables to add them as variables.

    The following URL opens a Logstore named test-logstore whose project is test-project, and searches for the current trace.

    https://sls.console.aliyun.com/lognext/project/test-project/logsearch/test-logstore?queryString=traceId=${{traceID}}