Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W-11939773-businessEvents-duke #2387

Open
wants to merge 5 commits into
base: v4.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/ROOT/pages/_partials/set-transaction-id.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ image:mruntime-custom-transaction-id.png[custom-transaction-id]
//tag::transactionIdReference[]
== Set Transaction ID Reference

[%header,cols="1,4"]
[%header,cols="1a,1a,4a"]
|===
| Field | Description
| Transaction ID (`id`) a| Defines the value of the identifier. It can be an expression or a literal. By default, the component assigns a numeric value.
| Field | XML | Description
| Transaction ID | `id` | Defines the value of the identifier. It can be an expression or a literal. By default, the component assigns a numeric value.
|===
//end::transactionIdReference[]
18 changes: 13 additions & 5 deletions modules/ROOT/pages/business-events-custom.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,30 @@ ifndef::env-site,env-github[]
include::_attributes.adoc[]
endif::[]

Use the Custom Business Event component (`tracking:custom-event` element in the XML view) to add metadata and Key Performance Indicators (KPIs) to your flow. Configure the component as follows:
Use the Custom Business Event component (`<tracking:custom-event />`) to add metadata and Key Performance Indicators (KPIs) to your flow. Configure the component in the Anypoint Studio UI or the configuration XML for the Mule application as follows:
Copy link
Contributor Author

@dukesphere dukesphere Oct 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Say how & where you can see these events once you've configured them. Can you see them via the logs, for example?


* In the Studio UI:
. Click the *Mule Palette* tab in Anypoint Studio.
. Drag *Custom Business Event* to any point of your flow.
. Open the component properties view and specify values for *Display Name* and *Event Name*:
+
image::mruntime-custom-business-event.png[custom-business-event]
* In the configuration XML for the same custom business event:
+
[source,xml]
----
<tracking:custom-event doc:name="Custom Business Event" event-name="New order"/>
----

You can also configure Key Performance Indicators (KPIs) to capture information from the message payload:

* In the UI:
* In the Studio UI:
. Click the plus button (image:green-plus-icon.png[2%,2%]) inside *Key Performance Indicators*.
. Configure *Name* and *Expression / Value*:
+
image::mruntime-business-events-kpi.png[business-events-kpi]

* In the XML:
* In the configuration XML for the same KPI configuration:
. Add a child `tracking:meta-data` element to the `tracking:custom-event`.
. Configure the `key` and `value` attributes inside `tracking:meta-data`:
+
Expand All @@ -28,7 +35,7 @@ For example:
[source,xml,linenums]
----
<tracking:custom-event doc:name="Custom Business Event" event-name="New order">
<tracking:meta-data key="order-id" value="#[payload.order.header.orderID]" />
<tracking:meta-data key="order-id" value="#[payload.order.header.orderID]" />
</tracking:custom-event>
----

Expand All @@ -47,4 +54,5 @@ For your KPIs, use names that are easy to search for in the Anypoint Runtime Man

== See Also

xref:business-events.adoc[Business Events]
* xref:business-events.adoc[]
* xref:set-transaction-id.adoc[]
11 changes: 6 additions & 5 deletions modules/ROOT/pages/business-events-in-components.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@ Because event tracking requires processing and network overhead to aggregate and
* At the flow level
* At the message processor (connector or component) level, which takes precedence over the flow level setting

After you enable event tracking, customize the transaction ID to identify specific tracked events so that you can analyze them at runtime.
After you enable event tracking, customize the transaction ID with <<customize-transaction-id>> to identify specific tracked events so that you can analyze them at runtime.

[events_tracking_flow_level]
== Flow-Level Event Tracking

Use this option to enable default event tracking for all elements in a flow that support event tracking.
You can disable tracking for specific processors or connectors to override the flow level setting.

Steps to enable default events tracking for all components in a flow:
Steps to enable default events tracking for all components in a flow within Anypoint Studio and the configuration XML for a Mule application:

* In Studio:
. Select your flow component to open the properties view.
. Enable default business events using either the UI or XML:
+
* In the UI, select *Enable default events tracking*:
+
image::mruntime-business-event-flow.png[default-event-tracking-flow]
+
* In the XML, add attribute `tracking:enable-default-events="true"` to the `flow` element:
* In the configuration XML, add the attribute `tracking:enable-default-events="true"` to the `flow` element:
+
[source,xml,linenums]
----
Expand All @@ -43,11 +44,11 @@ Steps to enable enable default events tracking for an individual component:
. Open the connector or component properties view.
. Enable default business events using any of the following options:
+
* In the UI, select *Enable default events tracking*:
* In the Studio UI, select *Enable default events tracking*:
+
image::mruntime-business-event-component.png[default-event-tracking-component]
+
* In the XML, add attribute `tracking:enable-default-events="true"` inside your component element:
* In the configuration XML, add attribute `tracking:enable-default-events="true"` inside your component element:
+
[source,xml,linenums]
----
Expand Down
21 changes: 10 additions & 11 deletions modules/ROOT/pages/business-events.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,31 @@ Mule applications collect _business event_ information (such as transaction exec

You can track two types of business events: _default events_ and _custom events_.

Default event tracking is supported by all connectors and selected message processors. Enabling default events for these elements enables you to perform advanced debugging at runtime. You can enable default event tracking at either the flow level or the message processor level. +
See xref:business-events-in-components.adoc[Configure Default Events Tracking] for configuration details.
Default event tracking is supported by all connectors and selected message processors. Enabling default events for these elements enables you to perform advanced debugging at runtime. You can enable default event tracking at either the flow level or the message processor level.
See xref:business-events-in-components.adoc[] for configuration details.

Custom event tracking is supported by the Custom Business Event component. Custom events are always tracked, enabling you to monitor high-level activities in your flow that are relevant to your business. +
See xref:business-events-custom.adoc[Custom Business Event Component] for configuration details.
Custom event tracking is supported by the Custom Business Event component. Custom events are always tracked, enabling you to monitor high-level activities in your flow that are relevant to your business. See xref:business-events-custom.adoc[] for configuration details.

== Monitoring Business Events

You can enable Insight in Runtime Manager to monitor business events at runtime. These events can help you analyze the root cause of failures, isolate performance bottlenecks, and test for compliance with company procedures.

Certain default events are tracked automatically after you enable Insight, but you must enable others in your application before they are tracked.

See the xref:runtime-manager::insight.adoc[Insight] documentation for more details.
See xref:runtime-manager::insight.adoc[] for more details.

== Best Practices for Business Events

Consider the following recommended practices when configuring business events tracking:

* Enable default events only for processes that have particular value to you. To filter out unnecessary information, determine which stages within a business transaction you need to track, and enable tracking for only those stages.
* Use custom events to track key process indicators: for example, "Total Order Amount" or "Tracking Number" to surface the high-level business activities in your flow.
* Customize the transaction ID so that meaningful information, such as an order number, an employee identification number, or a shipment tracking number, is displayed for a transaction. +
* Use custom events to track key process indicators, for example, "Total Order Amount" or "Tracking Number" to surface the high-level business activities in your flow.
* Customize the transaction ID with xref:set-transaction-id.adoc[Set Transaction Id] so that meaningful information, such as an order number, an employee identification number, or a shipment tracking number, is displayed for a transaction.
This practice makes analysis and debugging easier and more intuitive at runtime.

== See Also

* xref:about-mule-event.adoc[Mule Events]
* xref:transaction-management.adoc[Transaction Management]
* xref:business-events-in-components[Configure Default Events Tracking]
* xref:business-events-custom.adoc[Custom Business Event Component]
* xref:about-mule-event.adoc[]
* xref:transaction-management.adoc[]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: In the intro, say something about the relationship to business events and transaction management. Doc needs more context in this regard.

* xref:business-events-in-components[]
* xref:business-events-custom.adoc[]