This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect JVM metrics from the Vamp API info command using httpbeat: - https://github.com/christiangalsterer/httpbeat
- Loading branch information
Showing
16 changed files
with
2,451 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,75 @@ | ||
FROM java:openjdk-8-jre-alpine | ||
FROM magneticio/java:openjdk-8-jre-alpine | ||
|
||
# https://github.com/peterbourgon/runsvinit | ||
ENV RUNSVINIT_URL=https://github.com/peterbourgon/runsvinit/releases/download/v2.0.0/runsvinit-linux-amd64.tgz | ||
|
||
ENV METRICBEAT_VER=5.2.1 | ||
ENV METRICBEAT_URL=https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-${METRICBEAT_VER}-linux-x86_64.tar.gz | ||
|
||
ENV HTTPBEAT_VER=4.0.0 | ||
ENV HTTPBEAT_URL=https://github.com/christiangalsterer/httpbeat/releases/download/${HTTPBEAT_VER}/httpbeat-${HTTPBEAT_VER}-linux-x86_64.tar.gz | ||
|
||
RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \ | ||
ALPINE_GLIBC_PACKAGE_VERSION="2.23-r3" && \ | ||
ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \ | ||
ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \ | ||
ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \ | ||
apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \ | ||
wget \ | ||
"https://raw.githubusercontent.com/andyshinn/alpine-pkg-glibc/master/sgerrand.rsa.pub" \ | ||
-O "/etc/apk/keys/sgerrand.rsa.pub" && \ | ||
wget \ | ||
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ | ||
apk add --no-cache \ | ||
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ | ||
\ | ||
rm "/etc/apk/keys/sgerrand.rsa.pub" && \ | ||
/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 C.UTF-8 || true && \ | ||
echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \ | ||
\ | ||
apk del glibc-i18n && \ | ||
\ | ||
rm "/root/.wget-hsts" && \ | ||
apk del .build-dependencies && \ | ||
rm \ | ||
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ | ||
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" | ||
|
||
ENV LANG=C.UTF-8 | ||
|
||
RUN set -xe \ | ||
&& apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
runit \ | ||
&& curl --location --silent --show-error $RUNSVINIT_URL --output - | tar zxf - -C /sbin \ | ||
&& chown 0:0 /sbin/runsvinit \ | ||
&& chmod 0775 /sbin/runsvinit \ | ||
\ | ||
&& mkdir -p /usr/local/metricbeat/ \ | ||
&& curl --location --silent --show-error $METRICBEAT_URL --output - | tar zxf - -C /tmp \ | ||
&& mv /tmp/metricbeat-${METRICBEAT_VER}-linux-x86_64/metricbeat /usr/local/metricbeat/ \ | ||
&& rm -rf /tmp/metricbeat-${METRICBEAT_VER}-linux-x86_64 \ | ||
\ | ||
&& mkdir -p /usr/local/httpbeat/ \ | ||
&& curl --location --silent --show-error $HTTPBEAT_URL --output - | tar zxf - -C /tmp \ | ||
&& mv /tmp/httpbeat-5.2.1-SNAPSHOT-linux-x86_64/httpbeat /usr/local/httpbeat/ \ | ||
&& rm -rf /tmp/httpbeat-5.2.1-SNAPSHOT-linux-x86_64 | ||
|
||
RUN mkdir -p /usr/local/vamp/conf | ||
ADD vamp-artifacts /usr/local/vamp/artifacts | ||
ADD vamp-ui /usr/local/vamp/ui | ||
ADD vamp /usr/local/vamp/bin | ||
ADD logback.xml /usr/local/vamp/ | ||
ADD vamp.sh /usr/local/vamp/vamp | ||
RUN chmod +x /usr/local/vamp/vamp | ||
ADD files/ / | ||
|
||
ENV VAMP_REST_API_UI_DIRECTORY /usr/local/vamp/ui | ||
ENV VAMP_REST_API_UI_INDEX /usr/local/vamp/ui/index.html | ||
|
||
VOLUME /usr/local/vamp/conf | ||
|
||
CMD ["/usr/local/vamp/vamp"] | ||
CMD ["/sbin/runsvinit"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Alpine 3.5 version of java:openjdk-8-jre-alpine | ||
# From: https://github.com/docker-library/openjdk/blob/9a0822673dffd3e5ba66f18a8547aa60faed6d08/8-jre/alpine/Dockerfile | ||
|
||
FROM alpine:3.5 | ||
|
||
# A few problems with compiling Java from source: | ||
# 1. Oracle. Licensing prevents us from redistributing the official JDK. | ||
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets | ||
# really hairy. | ||
|
||
# Default to UTF-8 file.encoding | ||
ENV LANG C.UTF-8 | ||
|
||
# add a simple script that can auto-detect the appropriate JAVA_HOME value | ||
# based on whether the JDK or only the JRE is installed | ||
RUN { \ | ||
echo '#!/bin/sh'; \ | ||
echo 'set -e'; \ | ||
echo; \ | ||
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ | ||
} > /usr/local/bin/docker-java-home \ | ||
&& chmod +x /usr/local/bin/docker-java-home | ||
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk/jre | ||
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin | ||
|
||
ENV JAVA_VERSION 8u111 | ||
ENV JAVA_ALPINE_VERSION 8.121.13-r0 | ||
|
||
RUN set -x \ | ||
&& apk add --no-cache \ | ||
openjdk8-jre="$JAVA_ALPINE_VERSION" \ | ||
&& [ "$JAVA_HOME" = "$(docker-java-home)" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
all: build | ||
|
||
build: | ||
docker build --tag magneticio/java:openjdk-8-jre-alpine . | ||
|
||
clean: | ||
docker rmi magneticio/java:openjdk-8-jre-alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /bin/bash | ||
handle() { echo "httpbeat/run: got signal"; exit; } | ||
trap handle SIGINT | ||
|
||
if [[ -z $VAMP_ELASTICSEARCH_URL ]] ; then | ||
sv stop httpbeat | ||
exit | ||
fi | ||
|
||
[[ -e /usr/local/httpbeat/httpbeat.yml ]] || exit 1 | ||
|
||
exec 2>&1 | ||
exec /usr/local/httpbeat/httpbeat -c /usr/local/httpbeat/httpbeat.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /bin/bash | ||
handle() { echo "metricbeat/run: got signal"; exit; } | ||
trap handle SIGINT | ||
|
||
if [[ -z $VAMP_ELASTICSEARCH_URL ]] ; then | ||
sv stop metricbeat | ||
exit | ||
fi | ||
|
||
[[ -e /usr/local/metricbeat/metricbeat.yml ]] || exit 1 | ||
|
||
exec 2>&1 | ||
exec /usr/local/metricbeat/metricbeat -c /usr/local/metricbeat/metricbeat.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /bin/bash | ||
handle() { echo "vamp/run: got signal"; exit; } | ||
trap handle SIGINT | ||
|
||
exec 2>&1 | ||
exec /usr/local/vamp/vamp |
143 changes: 143 additions & 0 deletions
143
vamp/files/usr/local/httpbeat/httpbeat.template-es2x.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
{ | ||
"mappings": { | ||
"_default_": { | ||
"_all": { | ||
"norms": { | ||
"enabled": false | ||
} | ||
}, | ||
"_meta": { | ||
"version": "5.2.1" | ||
}, | ||
"dynamic_templates": [ | ||
{ | ||
"strings_as_keyword": { | ||
"mapping": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"match_mapping_type": "string" | ||
} | ||
} | ||
], | ||
"properties": { | ||
"@timestamp": { | ||
"type": "date" | ||
}, | ||
"beat": { | ||
"properties": { | ||
"hostname": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"name": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"version": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"meta": { | ||
"properties": { | ||
"cloud": { | ||
"properties": { | ||
"availability_zone": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"instance_id": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"machine_type": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"project_id": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"provider": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"region": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"request": { | ||
"properties": { | ||
"body": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"headers": { | ||
"properties": {}, | ||
"type": "nested" | ||
}, | ||
"method": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"url": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"response": { | ||
"properties": { | ||
"body": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"code": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
}, | ||
"headers": { | ||
"properties": {}, | ||
"type": "nested" | ||
}, | ||
"jsonBody": { | ||
"properties": {}, | ||
"type": "nested" | ||
} | ||
} | ||
}, | ||
"tags": { | ||
"ignore_above": 1024, | ||
"index": "not_analyzed", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"order": 0, | ||
"settings": { | ||
"index.refresh_interval": "5s" | ||
}, | ||
"template": "httpbeat-*" | ||
} |
Oops, something went wrong.