"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Anypoint Custom Metrics Mastery
1. April 11, 2023 4:00 PM IST
Hyderabad MuleSoft Meetup
Group Present’s # 28
Anypoint Custom Metrics
Mastery
2. Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only. We are
not representing our companies here.
● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any
responsibility that same solution will work for your business requirements.
● This presentation is not meant for any promotional activities.
3
3. A recording of this meetup will be uploaded to events page within 72 hours.
Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab.
Make it more Interactive!!!
Share us the feedback! Rate this meetup session by filling feedback form at the end of the day.
We Love Feedbacks !!
Housekeeping
4
4. Organizer
About:
● Mulesoft Meetup Leader
● Working as MuleSoft Developer & Administrator @
Salesforce.
● 5+ years of Experience.
● Certified MuleSoft Developer and Architect.
● Bangalore and Hyderabad Meetup Leader
Bharath Kumar NJ,
AMTS, Salesforce
5. About the Speaker :
Introductions
Madhu Dileep Duddukuri,
Senior Technical Consultant,
MuleSoft, a Salesforce
Company
6
● Working as Senior Technical Consultant @ Salesforce.
● 8+ years of IT experience, specializing in integration
space, and around 6 years of experience in MuleSoft
technology.
● Certified MuleSoft Architect.
9. ● API Manager instances already enabled.
● CloudHub implementations need to be enabled via the following options:
○ Runtime Manager - properties window
○ Anypoint Monitoring - settings panel
○ CI/CD pipeline / Maven pom.xml - Most reliable as it is automated.
● Hybrid implementations require an agent install
Enable Monitoring
10
15. Custom Metrics
16
● Saves and sends operational and business metrics to Anypoint Monitoring.
● These metrics can be used in real-time using built-in or custom dashboards.
● Utilizing Send Custom Metric component.
● Requires titanium subscription
16. Custom Metrics
17
a custom metric event contains sections of data
● Metric collection name – custom metric events are grouped together into collections, where
each collection contains a time-series sequence of metric events of the same type.
● Metric event timestamp – represents the time of the event object creation during the
runtime.
● Contextual values (aka dimensional values) – these values represents the context within
which the metric is generated. Each contextual value is for a contextual dimension. A
contextual value may be any type: string, numbers, IP, etc.
● Fact values – these values are numerical measurement (e.g. purchase amount, order count)
17. Custom Metrics best practices
18
Best practices include using time period and frequency effectively as well as using data with low
cardinality dimensions
● Time range
○ Determines how much data is fetched or processed to generate the chart.
● Refresh frequency
○ Determines how often a chart refreshes. High refresh frequencies put more stress on a system
and can affect performance.
● Low Cardinality Dimensions
○ Do not add high cardinality data, or data with many unique values, to custom metrics. Some examples
of high cardinality dimensions include order_id, product_id, location_id (latitude/longitude)
○ Replace a high cardinality dimension with a low cardinality dimension, such as:
■ category_id instead of product_id
■ country_code instead of location_id
■ order_count instead of order_id
18. Custom Metrics
API-Led view
19
● The company has 3 different ERP
systems based on region. They
eventually would like to consolidate
to one.
● Orders are originating from either
EDI, mobile or their commerce site
channels.
● Sales Rep orders are still originating
from the ERP UI.
21. Custom Metrics
Use Case #1 - Problem
A story has been added to the sprint planning:
The integration team is looking for ways to charge back MuleSoft vCore costs back to the
business. A couple of options have already been discussed, but with the api-led structure it has
been decided that custom metrics is the way to go.
Create a custom metric that stores the count and the total order value for each order processed
via MuleSoft. Group these values by region, business unit and region + business unit.
Why Custom Metrics: The process api would be the best place to pull this data since it is one
location vs. looking at ERP data from three sources.
22
23. Custom Metrics
Use Case #1 - Solution
24
Dimensions are
alphanumeric, no
spaces, but can contain
some special
characters
- _ / : .
Facts must be numeric
24. Custom Metrics Connector
25
● Custom Metrics Connector is available in MuleSoft Exchange
○ https://anypoint.mulesoft.com/exchange/com.mule.modules/mule-custom-
metrics-extension/
● Maven Dependency
● For troubleshooting use the below packages
○ com.mulesoft.analytics
○ com.mule.modules.acm.internal
<dependency>
<groupId>com.mule.modules</groupId>
<artifactId>mule-custom-metrics-extension</artifactId>
<version>2.2.0</version>
<classifier>mule-plugin</classifier>
</dependency>
26. Custom Metrics
Use Case #2 - Problem
A story has been added to the sprint planning:
The sales department has tasked the MuleSoft team with generating some analytics dashboards
to capture why orders are failing to reach their respective ERP system.
Why Custom Metrics: Thanks to guaranteed delivery, order failures are only captured in the
integration layer.
27
30. Custom Metrics
Clone from Built-in Dashboard
Cloning from built-in dashboard is the easiest way to get started since the initial graphs are
already present.
Steps:
1. Open Anypoint Monitoring.
2. Go to desired implementation and select the “Custom Metrics” tab
3. Configure the graph with options
4. Click “Save As” button to save into custom dashboard.
31
35. Take a stand !
36
●Nominate yourself for the next meetup speaker
https://sfdc.co/hyd-meetup-nomination
36. 37
● Share:
○ Tweet using the hashtag #MuleSoftMeetups #MuleSoftCommunity
○ Join Hyderabad Group: https://meetups.mulesoft.com/hyderabad
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
What’s next?