SlideShare a Scribd company logo
AppDynamics Webinars:
Building Custom Extensions
Todd Radel, Senior Manager – Customer Advocacy
Agenda
• Introduction
• Writing a script extension
• Writing a Java extension
• Using your custom metrics
• Best practices
• Office hours
About Me
Todd Radel
SENIOR MANAGER
CUSTOMER ADVOCACY TEAM
• More than 20 years experience in the software industry
• Java, .NET, Python, Perl
• Author of the Python SDK for AppDynamics REST API
• Author of six AppDynamics Extensions: F5, Tibco EMS,
Redis, Keynote, SQL, URL Monitor
Copyright © 2015 AppDynamics. All rights reserved. 3
tradel@appdynamics.com
+1 (484) 857-2335
tradel
todd.radel
linkedin.com/in/tradel
INTRODUCTION
What is an Extension?
• Plugs in to Machine Agent
• Imports additional metrics to AppDynamics
Copyright © 2015 AppDynamics. All rights reserved. 5
Why Use Extensions?
“I already have Graphite/Nagios/my own custom tools…”
BUT:
• Add more color to overall AppDynamics picture
• Baseline and alert on custom metrics
• Create custom dashboards
• Work towards a “single pane of glass”
Copyright © 2015 AppDynamics. All rights reserved. 6
Example Extensions
• Apache Server Monitor
• F5 Monitor
• ActiveMQ Monitor
…or build your own!
Copyright © 2015 AppDynamics. All rights reserved. 7
Use Cases
• Run a SQL query every few minutes to count
sales/signups/etc.
• Extract metrics from custom instrumentation
• Eliminate redundant tools
Copyright © 2015 AppDynamics. All rights reserved. 8
SCRIPT EXTENSIONS
Anatomy of a Simple Script Extension
• Script file
• monitor.xml – describes the extension
Copyright © 2015 AppDynamics. All rights reserved. 10
Example
• Write an extension to count the number of files in /var/tmp
and alert if there are too many
Copyright © 2015 AppDynamics. All rights reserved. 11
Simple Extension Script
Copyright © 2015 AppDynamics. All rights reserved. 12
Script Output
name=Custom Metrics|File Count|count, value=29, aggregator=OBSERVATION,
time-rollup=CURRENT, cluster-rollup=COLLECTIVE
• name – path and name of your metric
• value – metric value
• aggregator – how to handle multiple values in one interval
• time-rollup – how to aggregate values over time
• cluster-rollup – how to aggregate values over nodes
Copyright © 2015 AppDynamics. All rights reserved. 13
Metric Aggregation
Aggregation Time Rollup Cluster Rollup
How should the controller handle
multiple values in a single minute?
How should values be aggregated over
time?
How should values be aggregated
across nodes in a tier?
AVERAGE
Average of all reported values in that
minute
AVERAGE
Average of all one-minute values
INDIVIDUAL
Average of metric values across each
node in the tier
SUM
Sum of all reported values in the
minute
SUM
Sum of all one-minute values
COLLECTIVE
Sum of metric values across each node
in the tier
OBSERVATION
Last reported value in the minute
CURRENT
Last reported one-minute value
Copyright © 2015 AppDynamics. All rights reserved. 14
Simple monitor.xml for a Script
Copyright © 2015 AppDynamics. All rights reserved. 15
”periodic” or “continuous”
script filename
OS-Specific monitor.xml for a Script
Copyright © 2015 AppDynamics. All rights reserved. 16
JAVA EXTENSIONS
Anatomy of a Java Extension
• Class file or JAR file
• Dependent libraries
• Configuration file
• monitor.xml
Copyright © 2015 AppDynamics. All rights reserved. 18
Structuring Your Java Code
• Can be a single class
• Extend from com.singularity.ee.agent.systemagent.api.AManagedMonitor
• Override and implement execute() method
• Call getMetricWriter().printMetric() to send data
Copyright © 2015 AppDynamics. All rights reserved. 19
Example
• Write an extension to import metrics from the Linux
collectd(8) daemon
Copyright © 2015 AppDynamics. All rights reserved. 20
Sample Execute() Method
Copyright © 2015 AppDynamics. All rights reserved. 21
Configuring Your Extension
• Task arguments from monitor.xml are sent as first
parameter to execute() method
public TaskOutput execute(Map<String, String> args,
TaskExecutionContext taskExecutionContext)
throws TaskExecutionException {
• Configure via external file (e.g. config.yml), read the file
during execute()
Copyright © 2015 AppDynamics. All rights reserved. 22
Monitor.xml for Java
Copyright © 2015 AppDynamics. All rights reserved. 23
Installation
Copyright © 2015 AppDynamics. All rights reserved. 24
HTTP LISTENER
When to use the HTTP Listener
• When you don’t have control over the code
• When the data collector runs on another machine
Copyright © 2015 AppDynamics. All rights reserved. 26
Starting Machine Agent with HTTP Listener
java -Dmetric.http.listener=true
-Dmetric.http.listener.port=8000
-jar machineagent.jar
Copyright © 2015 AppDynamics. All rights reserved. 27
Sending Metric Data
Copyright © 2015 AppDynamics. All rights reserved. 28
Sending Metrics as JSON
Copyright © 2015 AppDynamics. All rights reserved. 29
USING CUSTOM METRICS
Locating Your Custom Metrics
Copyright © 2015 AppDynamics. All rights reserved. 31
Tier name
Node name
Metric path
Create Custom Dashboards
Copyright © 2015 AppDynamics. All rights reserved. 32
Sample Custom Dashboard
Copyright © 2015 AppDynamics. All rights reserved. 33
Create Health Rules
Copyright © 2015 AppDynamics. All rights reserved. 34
BEST PRACTICES
Best Practices
• Make it configurable via monitor.xml or config.yml
• Allow a custom metric path
• Write portable code
• Send output to the machine agent log
• Follow our “mavenized” project structure
• Post the code on GitHub and encourage pull requests
Copyright © 2015 AppDynamics. All rights reserved. 36
Increasing the Agent Metric Limit
• If you don’t see all metrics in the controller UI
• Check machine agent logs for “metric limit reached”
• Add command line options and restart machine agent
• Without custom extensions:
java -jar machineagent.jar
• With extensions:
java -Xmx256m -Dappdynamics.agent.maxMetrics=10000
-jar machineagent.jar
Copyright © 2015 AppDynamics. All rights reserved. 37
Publishing Your Extension
• Remove any usernames/passwords/hostnames from
configuration files
• Add README.md and LICENSE files
• Post the code on GitHub
• Create new thread on AppDynamics Community to
announce and publish!
Copyright © 2015 AppDynamics. All rights reserved. 38
Contents of Your README.md
• Description
• Requirements
• Installation
• Configuration
• Metrics Produced
• How to Contribute (optional)
• History/Release Notes
• Screenshots
Copyright © 2015 AppDynamics. All rights reserved. 39
FURTHER READING
Documentation
• Extensions and Custom Metrics
• Build a Monitoring Extension Using Java
• Build a Monitoring Extension Using Scripts
• Machine Agent HTTP Listener
Copyright © 2015 AppDynamics. All rights reserved. 41
Sample Java code
• Apache Monitoring Extension
• URL Monitoring Extension
• Follow along as I finish these extensions!
https://github.com/tradel/collectd-monitoring-extension
https://github.com/tradel/file-count-monitoring-extension
Copyright © 2015 AppDynamics. All rights reserved. 42
Thank You

More Related Content

PPTX
Solving Data Problems to Accelerate Digital Transformation.pptx
PPTX
Introduction to Microservices
PPTX
REST vs gRPC: Battle of API's
PDF
The Four Keys - Measuring DevOps Success
PPTX
Voice Dubbing Automation
KEY
Enterprise Agile Transformation Strategies
PPTX
Prometheus with Grafana - AddWeb Solution
PPTX
Enterprise Integration Patterns
Solving Data Problems to Accelerate Digital Transformation.pptx
Introduction to Microservices
REST vs gRPC: Battle of API's
The Four Keys - Measuring DevOps Success
Voice Dubbing Automation
Enterprise Agile Transformation Strategies
Prometheus with Grafana - AddWeb Solution
Enterprise Integration Patterns

What's hot (20)

PDF
Webinar: “Introduction to the Postman API Network”
PDF
PMI-ACP Lesson 04 Nugget 1 Agile Estimation
PPTX
Api gateway in microservices
PPTX
Platforms, Platform Engineering, & Platform as a Product
PDF
Sync async-blocking-nonblocking-io
PPTX
The RabbitMQ Message Broker
PPTX
Observabilidad: Todo lo que hay que ver
PPT
Introducing Agile User Stories
PPTX
Vertical Slicing Architectures
PDF
Observability
PDF
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
PDF
Introducing Saga Pattern in Microservices with Spring Statemachine
PDF
Agile, the Pivotal way
PPTX
DevSecOps : an Introduction
PDF
Devops Scorecard
PDF
Locking down your Kubernetes cluster with Linkerd
PPTX
Kubernetes CI/CD with Helm
PDF
Rabbitmq an amqp message broker
PDF
Opentracing jaeger
PPTX
Microservices Architecture - Bangkok 2018
Webinar: “Introduction to the Postman API Network”
PMI-ACP Lesson 04 Nugget 1 Agile Estimation
Api gateway in microservices
Platforms, Platform Engineering, & Platform as a Product
Sync async-blocking-nonblocking-io
The RabbitMQ Message Broker
Observabilidad: Todo lo que hay que ver
Introducing Agile User Stories
Vertical Slicing Architectures
Observability
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
Introducing Saga Pattern in Microservices with Spring Statemachine
Agile, the Pivotal way
DevSecOps : an Introduction
Devops Scorecard
Locking down your Kubernetes cluster with Linkerd
Kubernetes CI/CD with Helm
Rabbitmq an amqp message broker
Opentracing jaeger
Microservices Architecture - Bangkok 2018
Ad

Viewers also liked (8)

PDF
Cisco Tetration Analytics
PPTX
British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...
PDF
Cистема сетевой аналитики для ЦОД Cisco Tetration Analytics
PDF
TechWiseTV Workshop: Tetration Analytics
PPTX
AppDynamics VS New Relic – The Complete Guide
PPTX
Forrester Research: How To Organise Your Business For Digital Success - AppD ...
PDF
Business Transactions with AppDynamics
PPTX
Cisco and AppDynamics: Redefining Application Intelligence - AppD Summit Europe
Cisco Tetration Analytics
British Medical Journal: Refine Your Metrics For Digital Success - AppD Summi...
Cистема сетевой аналитики для ЦОД Cisco Tetration Analytics
TechWiseTV Workshop: Tetration Analytics
AppDynamics VS New Relic – The Complete Guide
Forrester Research: How To Organise Your Business For Digital Success - AppD ...
Business Transactions with AppDynamics
Cisco and AppDynamics: Redefining Application Intelligence - AppD Summit Europe
Ad

Similar to Webinar - Building Custom Extensions With AppDynamics (20)

PDF
Use AppDynamics SDK to Integrate with your Applications - AppSphere16
PDF
Hot sos em12c_metric_extensions
PDF
Metrics driven development 10.09.2014
PDF
Introduction to MicroProfile Metrics
PDF
15minutesintroductiontoappdynamics1.pdf
PDF
Introduction to MicroProfile Metrics
PPTX
Top 5 Java Performance Metrics, Tips & Tricks
PDF
StatsD DevOps Boulder 7/20/15
PDF
Metrics & more
PDF
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
PPTX
DevOps monitoring: Feedback loops in enterprise environments
PDF
Thinking DevOps in the era of the Cloud - Demi Ben-Ari
PDF
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
PPTX
Google Cloud Platform monitoring with Zabbix
PPTX
TopConf : DevOps Monitoring: Feedback Loops in Enterprise Environments
PPTX
Monitoring 101 - Leveraging on the power of JMX
PDF
Advanced APM .NET Hands-On Lab - AppSphere16
PPTX
Advanced REST API Scripting With AppDynamics
PPTX
Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org - Dev...
PPTX
AppDynamics User Group
Use AppDynamics SDK to Integrate with your Applications - AppSphere16
Hot sos em12c_metric_extensions
Metrics driven development 10.09.2014
Introduction to MicroProfile Metrics
15minutesintroductiontoappdynamics1.pdf
Introduction to MicroProfile Metrics
Top 5 Java Performance Metrics, Tips & Tricks
StatsD DevOps Boulder 7/20/15
Metrics & more
Open Source Monitoring for Java with JMX and Graphite (GeeCON 2013)
DevOps monitoring: Feedback loops in enterprise environments
Thinking DevOps in the era of the Cloud - Demi Ben-Ari
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Google Cloud Platform monitoring with Zabbix
TopConf : DevOps Monitoring: Feedback Loops in Enterprise Environments
Monitoring 101 - Leveraging on the power of JMX
Advanced APM .NET Hands-On Lab - AppSphere16
Advanced REST API Scripting With AppDynamics
Real-Time Metrics and Distributed Monitoring - Jeff Pierce, Change.org - Dev...
AppDynamics User Group

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Machine Learning_overview_presentation.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Approach and Philosophy of On baking technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Empathic Computing: Creating Shared Understanding
A comparative analysis of optical character recognition models for extracting...
Machine Learning_overview_presentation.pptx
The AUB Centre for AI in Media Proposal.docx
Dropbox Q2 2025 Financial Results & Investor Presentation
Programs and apps: productivity, graphics, security and other tools
Approach and Philosophy of On baking technology
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Big Data Technologies - Introduction.pptx
sap open course for s4hana steps from ECC to s4
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Digital-Transformation-Roadmap-for-Companies.pptx
MIND Revenue Release Quarter 2 2025 Press Release

Webinar - Building Custom Extensions With AppDynamics

  • 1. AppDynamics Webinars: Building Custom Extensions Todd Radel, Senior Manager – Customer Advocacy
  • 2. Agenda • Introduction • Writing a script extension • Writing a Java extension • Using your custom metrics • Best practices • Office hours
  • 3. About Me Todd Radel SENIOR MANAGER CUSTOMER ADVOCACY TEAM • More than 20 years experience in the software industry • Java, .NET, Python, Perl • Author of the Python SDK for AppDynamics REST API • Author of six AppDynamics Extensions: F5, Tibco EMS, Redis, Keynote, SQL, URL Monitor Copyright © 2015 AppDynamics. All rights reserved. 3 tradel@appdynamics.com +1 (484) 857-2335 tradel todd.radel linkedin.com/in/tradel
  • 5. What is an Extension? • Plugs in to Machine Agent • Imports additional metrics to AppDynamics Copyright © 2015 AppDynamics. All rights reserved. 5
  • 6. Why Use Extensions? “I already have Graphite/Nagios/my own custom tools…” BUT: • Add more color to overall AppDynamics picture • Baseline and alert on custom metrics • Create custom dashboards • Work towards a “single pane of glass” Copyright © 2015 AppDynamics. All rights reserved. 6
  • 7. Example Extensions • Apache Server Monitor • F5 Monitor • ActiveMQ Monitor …or build your own! Copyright © 2015 AppDynamics. All rights reserved. 7
  • 8. Use Cases • Run a SQL query every few minutes to count sales/signups/etc. • Extract metrics from custom instrumentation • Eliminate redundant tools Copyright © 2015 AppDynamics. All rights reserved. 8
  • 10. Anatomy of a Simple Script Extension • Script file • monitor.xml – describes the extension Copyright © 2015 AppDynamics. All rights reserved. 10
  • 11. Example • Write an extension to count the number of files in /var/tmp and alert if there are too many Copyright © 2015 AppDynamics. All rights reserved. 11
  • 12. Simple Extension Script Copyright © 2015 AppDynamics. All rights reserved. 12
  • 13. Script Output name=Custom Metrics|File Count|count, value=29, aggregator=OBSERVATION, time-rollup=CURRENT, cluster-rollup=COLLECTIVE • name – path and name of your metric • value – metric value • aggregator – how to handle multiple values in one interval • time-rollup – how to aggregate values over time • cluster-rollup – how to aggregate values over nodes Copyright © 2015 AppDynamics. All rights reserved. 13
  • 14. Metric Aggregation Aggregation Time Rollup Cluster Rollup How should the controller handle multiple values in a single minute? How should values be aggregated over time? How should values be aggregated across nodes in a tier? AVERAGE Average of all reported values in that minute AVERAGE Average of all one-minute values INDIVIDUAL Average of metric values across each node in the tier SUM Sum of all reported values in the minute SUM Sum of all one-minute values COLLECTIVE Sum of metric values across each node in the tier OBSERVATION Last reported value in the minute CURRENT Last reported one-minute value Copyright © 2015 AppDynamics. All rights reserved. 14
  • 15. Simple monitor.xml for a Script Copyright © 2015 AppDynamics. All rights reserved. 15 ”periodic” or “continuous” script filename
  • 16. OS-Specific monitor.xml for a Script Copyright © 2015 AppDynamics. All rights reserved. 16
  • 18. Anatomy of a Java Extension • Class file or JAR file • Dependent libraries • Configuration file • monitor.xml Copyright © 2015 AppDynamics. All rights reserved. 18
  • 19. Structuring Your Java Code • Can be a single class • Extend from com.singularity.ee.agent.systemagent.api.AManagedMonitor • Override and implement execute() method • Call getMetricWriter().printMetric() to send data Copyright © 2015 AppDynamics. All rights reserved. 19
  • 20. Example • Write an extension to import metrics from the Linux collectd(8) daemon Copyright © 2015 AppDynamics. All rights reserved. 20
  • 21. Sample Execute() Method Copyright © 2015 AppDynamics. All rights reserved. 21
  • 22. Configuring Your Extension • Task arguments from monitor.xml are sent as first parameter to execute() method public TaskOutput execute(Map<String, String> args, TaskExecutionContext taskExecutionContext) throws TaskExecutionException { • Configure via external file (e.g. config.yml), read the file during execute() Copyright © 2015 AppDynamics. All rights reserved. 22
  • 23. Monitor.xml for Java Copyright © 2015 AppDynamics. All rights reserved. 23
  • 24. Installation Copyright © 2015 AppDynamics. All rights reserved. 24
  • 26. When to use the HTTP Listener • When you don’t have control over the code • When the data collector runs on another machine Copyright © 2015 AppDynamics. All rights reserved. 26
  • 27. Starting Machine Agent with HTTP Listener java -Dmetric.http.listener=true -Dmetric.http.listener.port=8000 -jar machineagent.jar Copyright © 2015 AppDynamics. All rights reserved. 27
  • 28. Sending Metric Data Copyright © 2015 AppDynamics. All rights reserved. 28
  • 29. Sending Metrics as JSON Copyright © 2015 AppDynamics. All rights reserved. 29
  • 31. Locating Your Custom Metrics Copyright © 2015 AppDynamics. All rights reserved. 31 Tier name Node name Metric path
  • 32. Create Custom Dashboards Copyright © 2015 AppDynamics. All rights reserved. 32
  • 33. Sample Custom Dashboard Copyright © 2015 AppDynamics. All rights reserved. 33
  • 34. Create Health Rules Copyright © 2015 AppDynamics. All rights reserved. 34
  • 36. Best Practices • Make it configurable via monitor.xml or config.yml • Allow a custom metric path • Write portable code • Send output to the machine agent log • Follow our “mavenized” project structure • Post the code on GitHub and encourage pull requests Copyright © 2015 AppDynamics. All rights reserved. 36
  • 37. Increasing the Agent Metric Limit • If you don’t see all metrics in the controller UI • Check machine agent logs for “metric limit reached” • Add command line options and restart machine agent • Without custom extensions: java -jar machineagent.jar • With extensions: java -Xmx256m -Dappdynamics.agent.maxMetrics=10000 -jar machineagent.jar Copyright © 2015 AppDynamics. All rights reserved. 37
  • 38. Publishing Your Extension • Remove any usernames/passwords/hostnames from configuration files • Add README.md and LICENSE files • Post the code on GitHub • Create new thread on AppDynamics Community to announce and publish! Copyright © 2015 AppDynamics. All rights reserved. 38
  • 39. Contents of Your README.md • Description • Requirements • Installation • Configuration • Metrics Produced • How to Contribute (optional) • History/Release Notes • Screenshots Copyright © 2015 AppDynamics. All rights reserved. 39
  • 41. Documentation • Extensions and Custom Metrics • Build a Monitoring Extension Using Java • Build a Monitoring Extension Using Scripts • Machine Agent HTTP Listener Copyright © 2015 AppDynamics. All rights reserved. 41
  • 42. Sample Java code • Apache Monitoring Extension • URL Monitoring Extension • Follow along as I finish these extensions! https://github.com/tradel/collectd-monitoring-extension https://github.com/tradel/file-count-monitoring-extension Copyright © 2015 AppDynamics. All rights reserved. 42

Editor's Notes

  • #13: This example is in bash, but you can use any language that is capable of writing to stdout: Python, Perl, Ruby, Bash, etc.