Sling Metrics :: Sling Bundle

Sling Plugin for Coda Hales Metrics

License

License

Categories

Categories

Metrics Application Testing & Monitoring Monitoring
GroupId

GroupId

com.github.digital-wonderland.sling-metrics
ArtifactId

ArtifactId

sling-metrics-bundle
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

bundle
Description

Description

Sling Metrics :: Sling Bundle
Sling Plugin for Coda Hales Metrics

Download sling-metrics-bundle

Dependencies

compile (1)

Group / Artifact Type Version
org.apache.felix : org.apache.felix.scr.annotations jar 1.9.6

provided (10)

Group / Artifact Type Version
com.codahale.metrics : metrics-core jar 3.0.1
com.codahale.metrics : metrics-graphite jar 3.0.1
com.codahale.metrics : metrics-jvm jar 3.0.1
com.codahale.metrics : metrics-servlets jar 3.0.1
javax.servlet : servlet-api jar 2.3
org.slf4j : slf4j-api jar 1.6.4
org.apache.sling : org.apache.sling.api jar 2.2.4
org.apache.sling : org.apache.sling.event jar 3.1.4
org.osgi : org.osgi.compendium jar 4.0.0
commons-lang : commons-lang jar 2.5

Project Modules

There are no modules declared in this project.

Sling Metrics Build Status

Integration of Coda Hales Metrics with Apache Sling and Adobe CQ.

Goal

Create a tool that monitors & measures all interesting things in Sling / CQ out of the box and can be easily leveraged to measure / monitor a custom application running on top of one of them.

Features

The plugin consists of two separate bundles:

  • sling-metrics-bundle (Sling/JVM/... - WIP)
  • cq-metrics-bundle (CQ specific - TBD)

sling-metrics-bundle

General Sling/Metrics integration:

  • central MetricRegistry available via an OSGi MetricService.
  • central HealthCheckRegistry available via an OSGi HealthCheckService.
  • several listeners register to topics prefixed with metric/ to allow creation of metrics via OSGi events (not all metrics available yet).
  • reporters for SLF4J, Graphite & JMX
  • general JVM metrics
  • Proxies around Metrics' servlets (Health Check, Metrics, Ping & Thread dump)

Sling specific functionality:

  • component filter for timing requests per resource type (measured resource types can be filtered with a regular expressions)
  • meters for resource added, changed and removed events
  • other Sling specific metrics (TBD)

cq-metrics-bundle

can be deployed on top of that and provides CQ specific checks & metrics (TBD - e.g. replication queue health check / metrics, ...).

3rd party applications

By following the same approach custom metrics for additional applications can be brought in on top of that.

This way custom applications can generate whatever metrics they wish while avoiding compile time dependecies (publishing a metric is just generating an OSGi event) and or develop their own metrics bundles, which, when deployed, provide more insight by registering whatever metrics sets to the global metrics registry.

Graphite

For your convenience there is a Vagrant config included providing a Graphite installation at http://localhost:8080. The respective Carbon instance is listening to 33.33.33.12 port 2003.

The Vagrant box is based on this CentOS Packer template (The box is just a minimal CentOS 6 installation so anything similar should do as well).

Note: If you have a close look at your Graphite dashboard while metrics start to roll in, you will notice that not all submetrics are stored immediately. This happens because by default MAX_CREATES_PER_MINUTE in /etc/carbon/carbon.conf is set to 50 which means that no more than 50 whisper files will be created per minute.

Installation to CQ

The metrics plugin can be easily installed into an existing CQ installation by using the server-package-deploy profile of the cq-metrics-package submodule. The CQ instance can be specified via the cq.server property.

E.g. to install to http://localhost:4502:

mvn -f cq-metrics-package/pom.xml install -Pserver-package-deploy -Dcq.server=http://localhost:4502

Now the different components can be configured via their respective OSGi configuration

Note: the cq-metrics-package also deploys the cq-metrics-fragment which exports sun.misc from system.bundle so you don't have to edit your sling.properties.

Installation Pitfalls

Coda Hales Metrics accesses sun.misc.Unsafe which has to be made explicitely accessible by adding the following to your sling.properties:

org.osgi.framework.system.packages.extra=sun.misc

To make this change effective CQ has to be restarted.

License

Copyright © 2013-2014 Stephan Kleine

Published under Apache Software License 2.0, see LICENSE

Versions

Version
0.1.0