Commit 43c5883b authored by Daniel Gerhardt's avatar Daniel Gerhardt

Only include annotations instead of full Stagemonitor dependency

Stagemonitor and its dependencies are no longer included in builds. To
enable Stagemonitor in production, the libraries must be provided by the
host system. Additionally, the Java Servlet container needs to be setup
to load these additional dependencies for the web app.

For Tomcat 8 this is done by setting up a context config file in
conf/Catalina/localhost/<context path>.xml with the following content:

    <Context>
      <Resources className="org.apache.catalina.webresources.StandardRoot">
        <JarResources className="org.apache.catalina.webresources.DirResourceSet"
            base="<path to Stagemonitor JARs>"
            webAppMount="/WEB-INF/lib">
        </JarResources>
      </Resources>
    </Context>

See https://tomcat.apache.org/tomcat-8.0-doc/config/resources.html for
more configuration options.
parent dd2a6a7e
......@@ -293,9 +293,9 @@
<version>1.5.12</version>
</dependency>
<dependency>
<groupId>org.stagemonitor</groupId>
<artifactId>stagemonitor-web</artifactId>
<version>0.31.0</version>
<groupId>com.codahale.metrics</groupId>
<artifactId>metrics-annotation</artifactId>
<version>3.0.2</version>
</dependency>
</dependencies>
......
package org.stagemonitor.core.metrics;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* When a type is marked with this annotation, the creation of gauges with
* @{@link com.codahale.metrics.annotation.Gauge} is activated for that type.
*
* <pre><code>
* \@MonitorGauges
* public class Queue {
* \@Gauge(name = "queueSize")
* public int getQueueSize() {
* return queue.size;
* }
* }
* </code></pre>
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface MonitorGauges {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment