You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2019/06/28 14:17:31 UTC

[james-project] branch master updated (c5003bc -> 71fbf77)

This is an automated email from the ASF dual-hosted git repository.

matthieu pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.


    from c5003bc  Checkstyle and Eclipse warnings fixes
     new 130f1d8  JAMES-2773 add glowroot to docker image
     new c474562  JAMES-2773 add glowroot plugins to track IMAP transaction
     new 71fbf77  JAMES-2773 add instrumentation with glowroot documentation

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.adoc                                        | 15 +++++++++++-
 dockerfiles/compilation/java-8/compile.sh          | 27 ++++++++++++++++++++++
 dockerfiles/run/guice/cassandra-ldap/Dockerfile    | 17 +++++++++++---
 .../cassandra-ldap/destination/glowroot/admin.json |  5 ++++
 .../destination/glowroot/plugins/imap.json         | 19 +++++++++++++++
 .../guice/cassandra-ldap/destination/run_james.sh  |  5 ++++
 .../run/guice/cassandra-rabbitmq-ldap/Dockerfile   | 17 +++++++++++---
 .../destination/glowroot/admin.json                |  5 ++++
 .../destination/glowroot/plugins/imap.json         | 19 +++++++++++++++
 .../destination/run_james.sh                       |  5 ++++
 .../run/guice/cassandra-rabbitmq/Dockerfile        | 17 +++++++++++---
 .../destination/glowroot/admin.json                |  5 ++++
 .../destination/glowroot/plugins/imap.json         | 19 +++++++++++++++
 .../cassandra-rabbitmq/destination/run_james.sh    |  5 ++++
 dockerfiles/run/guice/cassandra/Dockerfile         | 17 +++++++++++---
 .../cassandra/destination/glowroot/admin.json      |  5 ++++
 .../destination/glowroot/plugins/imap.json         | 19 +++++++++++++++
 .../run/guice/cassandra/destination/run_james.sh   |  5 ++++
 dockerfiles/run/guice/jpa-smtp/Dockerfile          | 18 ++++++++++++---
 .../guice/jpa-smtp/destination/glowroot/admin.json |  5 ++++
 .../destination/glowroot/plugins/imap.json         | 19 +++++++++++++++
 .../run/guice/jpa-smtp/destination/run_james.sh    |  5 ++++
 dockerfiles/run/guice/jpa/Dockerfile               | 18 ++++++++++++---
 .../run/guice/jpa/destination/glowroot/admin.json  |  5 ++++
 .../jpa/destination/glowroot/plugins/imap.json     | 19 +++++++++++++++
 dockerfiles/run/guice/jpa/destination/run_james.sh |  5 ++++
 dockerfiles/run/guice/memory/Dockerfile            | 17 +++++++++++---
 .../guice/memory/destination/glowroot/admin.json   |  5 ++++
 .../memory/destination/glowroot/plugins/imap.json  | 19 +++++++++++++++
 .../run/guice/memory/destination/run_james.sh      |  5 ++++
 dockerfiles/run/spring/Dockerfile                  | 16 +++++++++++--
 dockerfiles/run/spring/destination/admin.json      |  5 ++++
 .../run/spring/destination/glowroot/admin.json     |  5 ++++
 .../spring/destination/glowroot/plugins/imap.json  | 19 +++++++++++++++
 dockerfiles/run/spring/destination/run_james.sh    |  5 ++++
 35 files changed, 392 insertions(+), 24 deletions(-)
 create mode 100644 dockerfiles/run/guice/cassandra-ldap/destination/glowroot/admin.json
 create mode 100644 dockerfiles/run/guice/cassandra-ldap/destination/glowroot/plugins/imap.json
 create mode 100755 dockerfiles/run/guice/cassandra-ldap/destination/run_james.sh
 create mode 100644 dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/admin.json
 create mode 100644 dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/plugins/imap.json
 create mode 100755 dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/run_james.sh
 create mode 100644 dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json
 create mode 100644 dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/imap.json
 create mode 100755 dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
 create mode 100644 dockerfiles/run/guice/cassandra/destination/glowroot/admin.json
 create mode 100644 dockerfiles/run/guice/cassandra/destination/glowroot/plugins/imap.json
 create mode 100755 dockerfiles/run/guice/cassandra/destination/run_james.sh
 create mode 100644 dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json
 create mode 100644 dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/imap.json
 create mode 100755 dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
 create mode 100644 dockerfiles/run/guice/jpa/destination/glowroot/admin.json
 create mode 100644 dockerfiles/run/guice/jpa/destination/glowroot/plugins/imap.json
 create mode 100755 dockerfiles/run/guice/jpa/destination/run_james.sh
 create mode 100644 dockerfiles/run/guice/memory/destination/glowroot/admin.json
 create mode 100644 dockerfiles/run/guice/memory/destination/glowroot/plugins/imap.json
 create mode 100755 dockerfiles/run/guice/memory/destination/run_james.sh
 create mode 100644 dockerfiles/run/spring/destination/admin.json
 create mode 100644 dockerfiles/run/spring/destination/glowroot/admin.json
 create mode 100644 dockerfiles/run/spring/destination/glowroot/plugins/imap.json
 create mode 100755 dockerfiles/run/spring/destination/run_james.sh


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 01/03: JAMES-2773 add glowroot to docker image

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 130f1d822ece4aa585c416d598907f6220480ab1
Author: Rémi Kowalski <rk...@linagora.com>
AuthorDate: Tue May 14 11:58:01 2019 +0200

    JAMES-2773 add glowroot to docker image
---
 dockerfiles/compilation/java-8/compile.sh          | 27 ++++++++++++++++++++++
 dockerfiles/run/guice/cassandra-ldap/Dockerfile    | 17 +++++++++++---
 .../cassandra-ldap/destination/glowroot/admin.json |  5 ++++
 .../guice/cassandra-ldap/destination/run_james.sh  |  5 ++++
 .../run/guice/cassandra-rabbitmq-ldap/Dockerfile   | 17 +++++++++++---
 .../destination/glowroot/admin.json                |  5 ++++
 .../destination/run_james.sh                       |  5 ++++
 .../run/guice/cassandra-rabbitmq/Dockerfile        | 17 +++++++++++---
 .../destination/glowroot/admin.json                |  5 ++++
 .../cassandra-rabbitmq/destination/run_james.sh    |  5 ++++
 dockerfiles/run/guice/cassandra/Dockerfile         | 17 +++++++++++---
 .../cassandra/destination/glowroot/admin.json      |  5 ++++
 .../run/guice/cassandra/destination/run_james.sh   |  5 ++++
 dockerfiles/run/guice/jpa-smtp/Dockerfile          | 18 ++++++++++++---
 .../guice/jpa-smtp/destination/glowroot/admin.json |  5 ++++
 .../run/guice/jpa-smtp/destination/run_james.sh    |  5 ++++
 dockerfiles/run/guice/jpa/Dockerfile               | 18 ++++++++++++---
 .../run/guice/jpa/destination/glowroot/admin.json  |  5 ++++
 dockerfiles/run/guice/jpa/destination/run_james.sh |  5 ++++
 dockerfiles/run/guice/memory/Dockerfile            | 17 +++++++++++---
 .../guice/memory/destination/glowroot/admin.json   |  5 ++++
 .../run/guice/memory/destination/run_james.sh      |  5 ++++
 dockerfiles/run/spring/Dockerfile                  | 16 +++++++++++--
 dockerfiles/run/spring/destination/admin.json      |  5 ++++
 .../run/spring/destination/glowroot/admin.json     |  5 ++++
 dockerfiles/run/spring/destination/run_james.sh    |  5 ++++
 26 files changed, 226 insertions(+), 23 deletions(-)

diff --git a/dockerfiles/compilation/java-8/compile.sh b/dockerfiles/compilation/java-8/compile.sh
index fff263f..c30f77d 100755
--- a/dockerfiles/compilation/java-8/compile.sh
+++ b/dockerfiles/compilation/java-8/compile.sh
@@ -12,6 +12,12 @@ printUsage() {
    exit 1
 }
 
+GLOW_ROOT_URL=https://github.com/glowroot/glowroot/releases/download/v0.13.4/glowroot-0.13.4-dist.zip
+GLOW_ROOT_DIR=glowroot
+GLOW_ROOT_ZIP=glowroot.zip
+GLOW_ROOT_JAR=${GLOW_ROOT_DIR}/glowroot.jar
+GLOW_ROOT_LIB=${GLOW_ROOT_DIR}/lib
+
 ORIGIN=/origin
 CASSANDRA_DESTINATION=/cassandra/destination
 CASSANDRA_RABBITMQ_DESTINATION=/cassandra-rabbitmq/destination
@@ -59,6 +65,9 @@ else
    mvn package ${MVN_ADDITIONAL_ARG_LINE}
 fi
 
+# download glowroot jar
+wget  -O $GLOW_ROOT_ZIP $GLOW_ROOT_URL
+unzip $GLOW_ROOT_ZIP
 # Retrieve result
 
 if [ $? -eq 0 ]; then
@@ -68,6 +77,8 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/cassandra-rabbitmq-ldap-guice/target/james-server-cassandra-rabbitmq-ldap-guice.lib $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
+      mkdir -p ${CASSANDRA_RABBITMQ_LDAP_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_RABBITMQ_LDAP_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$CASSANDRA_RABBITMQ_DESTINATION" ]; then
@@ -76,6 +87,8 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/cassandra-rabbitmq-guice/target/james-server-cassandra-rabbitmq-guice.lib $CASSANDRA_RABBITMQ_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $CASSANDRA_RABBITMQ_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $CASSANDRA_RABBITMQ_DESTINATION || true
+      mkdir -p ${CASSANDRA_RABBITMQ_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_RABBITMQ_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$CASSANDRA_DESTINATION" ]; then
@@ -87,6 +100,8 @@ if [ $? -eq 0 ]; then
 
       cp server/container/guice/cassandra-ldap-guice/target/james-server-cassandra-ldap-guice.jar $CASSANDRA_DESTINATION || true
       cp -r server/container/guice/cassandra-ldap-guice/target/james-server-cassandra-ldap-guice.lib $CASSANDRA_DESTINATION || true
+      mkdir -p ${CASSANDRA_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$JPA_DESTINATION" ]; then
@@ -95,6 +110,8 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/jpa-guice/target/james-server-jpa-guice.lib $JPA_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $JPA_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $JPA_DESTINATION || true
+      mkdir -p ${JPA_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${JPA_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$JPA_SMTP_DESTINATION" ]; then
@@ -103,6 +120,8 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/jpa-smpt/target/james-server-jpa-smtp-guice.lib $JPA_SMTP_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $JPA_SMTP_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $JPA_SMTP_DESTINATION || true
+      mkdir -p ${JPA_SMTP_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${JPA_SMTP_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$MEMORY_DESTINATION" ]; then
@@ -111,11 +130,15 @@ if [ $? -eq 0 ]; then
       cp -r server/container/guice/memory-guice/target/james-server-memory-guice.lib $MEMORY_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $MEMORY_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $MEMORY_DESTINATION || true
+      mkdir -p ${MEMORY_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${MEMORY_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$SPRING_DESTINATION" ]; then
       echo "Copying SPRING jars"
       cp server/app/target/james-server-app-*-app.zip $SPRING_DESTINATION
+      mkdir -p ${SPRING_DESTINATION}/glowroot
+      cp -r ${GLOW_ROOT_DIR}/* ${SPRING_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$SWAGGER_DESTINATION" ]; then
@@ -124,3 +147,7 @@ if [ $? -eq 0 ]; then
       cp server/protocols/webadmin/webadmin-swagger/target/webadmin-swagger.json $SWAGGER_DESTINATION || true
    fi
 fi
+
+# delete temporary glowroot files
+rm $GLOW_ROOT_ZIP
+rm -rf $GLOW_ROOT_DIR
diff --git a/dockerfiles/run/guice/cassandra-ldap/Dockerfile b/dockerfiles/run/guice/cassandra-ldap/Dockerfile
index b06597b..dd5db36 100644
--- a/dockerfiles/run/guice/cassandra-ldap/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-ldap/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-cassandra-ldap-guice.lib /root/james-server-cassand
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/admin.json b/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/run_james.sh b/dockerfiles/run/guice/cassandra-ldap/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
index e7e9692..24f06c4 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-cassandra-rabbitmq-ldap-guice.lib /root/james-serve
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/admin.json b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/run_james.sh b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
index f9f2919..922e0e3 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-cassandra-rabbitmq-guice.lib /root/james-server-cas
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json b/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh b/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra/Dockerfile b/dockerfiles/run/guice/cassandra/Dockerfile
index c17430e..43f3c69 100644
--- a/dockerfiles/run/guice/cassandra/Dockerfile
+++ b/dockerfiles/run/guice/cassandra/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-cassandra-guice.lib /root/james-server-cassandra-gu
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/admin.json b/dockerfiles/run/guice/cassandra/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra/destination/run_james.sh b/dockerfiles/run/guice/cassandra/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa-smtp/Dockerfile b/dockerfiles/run/guice/jpa-smtp/Dockerfile
index 0335a81..2eb86ff 100644
--- a/dockerfiles/run/guice/jpa-smtp/Dockerfile
+++ b/dockerfiles/run/guice/jpa-smtp/Dockerfile
@@ -12,7 +12,7 @@ FROM openjdk:8u181-jre
 # 587  SMTP with authentication and startTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 143 465 587 8000
+EXPOSE 25 143 465 587 4000 8000
 
 WORKDIR /root
 
@@ -22,8 +22,20 @@ ADD destination/james-server-jpa-smtp-guice.lib /root/james-server-jpa-smtp-guic
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
+VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -classpath '/root/james-server-jpa-smtp-guice.jar:/root/james-server-jpa-smtp-guice.lib/*' -javaagent:/root/james-server-jpa-smtp-guice.lib/openjpa-3.0.0.jar -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json b/dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh b/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
new file mode 100755
index 0000000..dc72c7d
--- /dev/null
+++ b/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -classpath '/root/james-server-jpa-smtp-guice.jar:/root/james-server-jpa-smtp-guice.lib/*' -javaagent:/root/james-server-jpa-smtp-guice.lib/openjpa-3.0.0.jar $GLOWROOT_OPTIONS -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa/Dockerfile b/dockerfiles/run/guice/jpa/Dockerfile
index 8f641cf..07e386f 100644
--- a/dockerfiles/run/guice/jpa/Dockerfile
+++ b/dockerfiles/run/guice/jpa/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,8 +24,20 @@ ADD destination/james-server-jpa-guice.lib /root/james-server-jpa-guice.lib
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
+VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -classpath '/root/james-server.jar:/root/james-server-jpa-guice.lib/*' -javaagent:/root/james-server-jpa-guice.lib/openjpa-3.0.0.jar -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/admin.json b/dockerfiles/run/guice/jpa/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/jpa/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa/destination/run_james.sh b/dockerfiles/run/guice/jpa/destination/run_james.sh
new file mode 100755
index 0000000..7503c8b
--- /dev/null
+++ b/dockerfiles/run/guice/jpa/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -classpath '/root/james-server.jar:/root/james-server-jpa-guice.lib/*' -javaagent:/root/james-server-jpa-guice.lib/openjpa-3.0.0.jar $GLOWROOT_OPTIONS -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
diff --git a/dockerfiles/run/guice/memory/Dockerfile b/dockerfiles/run/guice/memory/Dockerfile
index e969bf8..93e3bd1 100644
--- a/dockerfiles/run/guice/memory/Dockerfile
+++ b/dockerfiles/run/guice/memory/Dockerfile
@@ -14,7 +14,7 @@ FROM openjdk:8u181-jre
 # 993  IMAP with socketTLS enabled
 # 8000 Web Admin interface (unsecured: expose at your own risks)
 
-EXPOSE 25 110 143 465 587 993 8000
+EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
 
@@ -24,9 +24,20 @@ ADD destination/james-server-memory-guice.lib /root/james-server-memory-guice.li
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
 
 VOLUME /logs
 VOLUME /root/conf
+VOLUME /root/glowroot/plugins
+VOLUME /root/glowroot/data
 
-ENV JVM_OPTIONS=""
-ENTRYPOINT java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS -jar james-server.jar
+ENV PATH "$PATH:/root/glowroot/lib" \
+    JVM_OPTIONS="" \
+    GLOWROOT_ACTIVATED="false"
+
+ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/memory/destination/glowroot/admin.json b/dockerfiles/run/guice/memory/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/guice/memory/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/memory/destination/run_james.sh b/dockerfiles/run/guice/memory/destination/run_james.sh
new file mode 100755
index 0000000..02f2bf6
--- /dev/null
+++ b/dockerfiles/run/guice/memory/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
+fi
+java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
diff --git a/dockerfiles/run/spring/Dockerfile b/dockerfiles/run/spring/Dockerfile
index 49b5f0e..ff94ea4 100644
--- a/dockerfiles/run/spring/Dockerfile
+++ b/dockerfiles/run/spring/Dockerfile
@@ -13,13 +13,23 @@ FROM openjdk:8u181-jre
 # 587 SMTP with authentication and startTLS enabled
 # 993 IMAP with socketTLS enabled
 
-EXPOSE 25 110 143 465 587 993
+EXPOSE 25 110 143 465 587 993 4000
 
 WORKDIR /root
 
 # Get data we need to run James : build results and configuration
 ADD destination/james-server-app-3.4.0-SNAPSHOT-app.zip /root/james-server-app-3.4.0-SNAPSHOT-app.zip
 ADD destination/conf /root/conf
+ADD destination/glowroot/plugins /root/glowroot/plugins
+ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
+ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
+ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
+ADD destination/glowroot/admin.json /root/glowroot/admin.json
+ADD destination/run_james.sh /root/run_james.sh
+
+VOLUME /logs
+VOLUME /root/conf
+VOLUME /root/glowroot/plugins
 
 # Unzip build result
 RUN unzip james-server-app-3.4.0-SNAPSHOT-app.zip
@@ -31,5 +41,7 @@ RUN rm -r james-server-app-3.4.0-SNAPSHOT/conf/*
 RUN cp -r conf/* james-server-app-3.4.0-SNAPSHOT/conf
 RUN cp wrapper.conf james-server-app-3.4.0-SNAPSHOT/conf
 
+ENV PATH "$PATH:/root/glowroot/lib"
+
 WORKDIR /root/james-server-app-3.4.0-SNAPSHOT/bin
-ENTRYPOINT ["./wrapper-linux-x86-64","../conf/wrapper.conf", "wrapper.syslog.ident=james", "wrapper.pidfile=../var/james.pid", "wrapper.daemonize=FALSE"]
+ENTRYPOINT /root/run_james.sh
\ No newline at end of file
diff --git a/dockerfiles/run/spring/destination/admin.json b/dockerfiles/run/spring/destination/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/spring/destination/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/spring/destination/glowroot/admin.json b/dockerfiles/run/spring/destination/glowroot/admin.json
new file mode 100644
index 0000000..c75c59d
--- /dev/null
+++ b/dockerfiles/run/spring/destination/glowroot/admin.json
@@ -0,0 +1,5 @@
+{
+  "web": {
+    "bindAddress": "0.0.0.0"
+  }
+}
\ No newline at end of file
diff --git a/dockerfiles/run/spring/destination/run_james.sh b/dockerfiles/run/spring/destination/run_james.sh
new file mode 100755
index 0000000..6697c5b
--- /dev/null
+++ b/dockerfiles/run/spring/destination/run_james.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
+    GLOWROOT_OPTIONS=wrapper.java.additional.15=-javaagent:/root/glowroot/glowroot.jar
+fi
+./wrapper-linux-x86-64 ../conf/wrapper.conf wrapper.syslog.ident=james wrapper.pidfile=../var/james.pid wrapper.daemonize=FALSE $GLOWROOT_OPTIONS


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 02/03: JAMES-2773 add glowroot plugins to track IMAP transaction

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit c474562f235f539a04983c812fb85997f880269b
Author: Rémi Kowalski <rk...@linagora.com>
AuthorDate: Wed May 15 11:54:46 2019 +0200

    JAMES-2773 add glowroot plugins to track IMAP transaction
---
 .../destination/glowroot/plugins/imap.json            | 19 +++++++++++++++++++
 .../destination/glowroot/plugins/imap.json            | 19 +++++++++++++++++++
 .../destination/glowroot/plugins/imap.json            | 19 +++++++++++++++++++
 .../cassandra/destination/glowroot/plugins/imap.json  | 19 +++++++++++++++++++
 .../jpa-smtp/destination/glowroot/plugins/imap.json   | 19 +++++++++++++++++++
 .../guice/jpa/destination/glowroot/plugins/imap.json  | 19 +++++++++++++++++++
 .../memory/destination/glowroot/plugins/imap.json     | 19 +++++++++++++++++++
 .../run/spring/destination/glowroot/plugins/imap.json | 19 +++++++++++++++++++
 8 files changed, 152 insertions(+)

diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/plugins/imap.json b/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/plugins/imap.json b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/imap.json b/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/imap.json b/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/imap.json b/dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/plugins/imap.json b/dockerfiles/run/guice/jpa/destination/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/dockerfiles/run/guice/jpa/destination/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/memory/destination/glowroot/plugins/imap.json b/dockerfiles/run/guice/memory/destination/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/dockerfiles/run/guice/memory/destination/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/dockerfiles/run/spring/destination/glowroot/plugins/imap.json b/dockerfiles/run/spring/destination/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/dockerfiles/run/spring/destination/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 03/03: JAMES-2773 add instrumentation with glowroot documentation

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 71fbf775d00fbc5fec6a6a61921cfdbbdadbb335
Author: Rémi Kowalski <rk...@linagora.com>
AuthorDate: Tue Jun 4 13:12:41 2019 +0200

    JAMES-2773 add instrumentation with glowroot documentation
---
 README.adoc | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/README.adoc b/README.adoc
index e8f0810..c26712d 100644
--- a/README.adoc
+++ b/README.adoc
@@ -262,9 +262,22 @@ If you want to pass additional options to the underlying java command, you can c
 
     --env JVM_OPTIONS="-Xms256m -Xmx2048m"
 
-
 To have log file accessible on a volume, add *-v  $PWD/logs:/logs* option to the above command line, where *$PWD/logs* is your local directory to put files in.
 
+==== Instrumentation
+You can use Glowroot to instrumentalize James. The provided guice docker files allow a simple way to do it.
+In order to activate Glowroot you need to run the container with the environment variable _GLOWROOT_ACTIVATED_ set to _true_
+and to expose the glowroot instrumentation ui port.
+
+    --env GLOWROOT_ACTIVATED=true -p "4000:4000"
+
+By default, the Glowroot UI is accessible from every machines in the network as defined in the _destination/admin.json_.
+Which you could configure before building the image, if you want to restrict its accessibility to localhost for example.
+See the https://github.com/glowroot/glowroot/wiki/Agent-Installation-(with-Embedded-Collector)#user-content-optional-post-installation-steps[Glowroot post installation steps]  for more details.
+
+Or by mapping the 4000 port to the IP of the desired network interface, for example `-p 127.0.0.1:4000:4000`.
+
+
 ==== Handling attachment indexing
 
 You can handle attachment text extraction before indexing in ElasticSearch. This makes attachments searchable. To enable this:


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org