Merge branch 'develop-erik' into 'master'

Develop erik

See merge request erik/prometheus-app!1
This commit is contained in:
Erik 2020-11-11 20:45:41 +00:00
commit 62db1770bd
10 changed files with 72 additions and 73 deletions

9
CHANGELOG Normal file
View file

@ -0,0 +1,9 @@
[0.1.0]
* Initial version
[0.2.0]
* Fix app title
[0.3.0]
* Fix first run command

View file

@ -1,13 +1,27 @@
{
"version": "0.1.0",
"id": "eriktad.prometheus.cloudronapp",
"version": "0.3.0",
"id": "io.prometheus.cloudronapp",
"title": "Prometheus Server",
"author": "Erik Tadevosyan",
"healthCheckPath": "/healthcheck",
"httpPort": 8000,
"description": "file://DESCRIPTION.md",
"tagline": "From metrics to insight",
"healthCheckPath": "/",
"httpPort": 9090,
"icon": "logo.png",
"addons": {
"localstorage": {},
"ldap": {}
"localstorage": {}
},
"manifestVersion": 2
}
"manifestVersion": 2,
"website": "https://prometheus.io/",
"contactEmail": "support@cloudron.io",
"tags": [ "metrics", "analytics", "graphite", "collect", "graphs" ],
"changelog": "file://CHANGELOG",
"documentationUrl": "https://docs.cloudron.io/apps/prometheus-server/",
"minBoxVersion": "5.5.0",
"forumUrl": "https://forum.cloudron.io/category/112/prometheus",
"mediaLinks": [
"https://screenshots.cloudron.io/io.prometheus.cloudronapp/1.png",
"https://screenshots.cloudron.io/io.prometheus.cloudronapp/2.png",
"https://screenshots.cloudron.io/io.prometheus.cloudronapp/3.png"
]
}

19
DESCRIPTION.md Normal file
View file

@ -0,0 +1,19 @@
This app packages Prometheus <upstream>2.22.0</upstream>
Prometheus, a Cloud Native Computing Foundation project, is a systems and service monitoring system.
It collects metrics from configured targets at given intervals, evaluates rule expressions, displays
the results, and can trigger alerts when specified conditions are observed.
## Features
The features that distinguish Prometheus from other metrics and monitoring systems are:
* A multi-dimensional data model (time series defined by metric name and set of key/value dimensions)
* PromQL, a powerful and flexible query language to leverage this dimensionality
* No dependency on distributed storage; single server nodes are autonomous
* An HTTP pull model for time series collection
* Pushing time series is supported via an intermediary gateway for batch jobs
* Targets are discovered via service discovery or static configuration
* Multiple modes of graphing and dashboarding support
* Support for hierarchical and horizontal federation

View file

@ -1,31 +1,12 @@
FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4
EXPOSE 8000
RUN mkdir -p /app/code
WORKDIR /app/code
RUN mkdir -p /app/data/runtime /app/data/config && \
chown -R cloudron:cloudron /app/data/runtime /app/data/config
WORKDIR /app/data
# configure apache
RUN rm /etc/apache2/sites-enabled/*
RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf
RUN a2disconf other-vhosts-access-log
ADD apache/prometheus.conf /etc/apache2/sites-enabled/prometheus.conf
RUN echo "Listen 8000" > /etc/apache2/ports.conf
RUN a2enmod ldap authnz_ldap proxy proxy_http rewrite
ARG VERSION=2.22.0
# install Prometheus
RUN mkdir -p /usr/local/bin/prometheus && \
cd /usr/local/bin && \
wget -c https://github.com/prometheus/prometheus/releases/download/v2.22.0/prometheus-2.22.0.linux-amd64.tar.gz && \
tar xvfz prometheus-*.tar.gz && \
rm -rf prometheus-*.tar.gz && \
mv prometheus-*/* prometheus && \
rm -rf prometheus-* && \
chown -R cloudron:cloudron prometheus
RUN sudo -u cloudron cp -n /usr/local/bin/prometheus/prometheus.yml /app/data/config/prometheus.yml
RUN curl -L https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-${VERSION}.linux-amd64.tar.gz | tar zxvf - --strip-components 1
COPY start.sh /app/pkg/

9
LICENSE Normal file
View file

@ -0,0 +1,9 @@
MIT License (MIT)
Copyright (c) 2016 Cloudron UG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,36 +0,0 @@
<VirtualHost *:8000>
DocumentRoot /usr/local/bin/prometheus
ErrorLog "/dev/stderr"
CustomLog "/dev/stdout" combined
<Location />
AllowOverride None
Order deny,allow
Deny from All
AuthType Basic
AuthBasicProvider ldap
AuthName "Use your Cloudron Account to login"
AuthLDAPURL ${CLOUDRON_LDAP_URL}/${CLOUDRON_LDAP_USERS_BASE_DN}?username?sub?(objectclass=user)
AuthLDAPBindDN "${CLOUDRON_LDAP_BIND_DN}"
AuthLDAPBindPassword "{CLOUDRON_LDAP_BIND_PASSWORD}"
Require valid-user
Satisfy any
ProxyPreserveHost On
ProxyErrorOverride Off
ProxyPass http://127.0.0.1:9090/
</Location>
<Location /healthcheck>
Order allow,deny
Allow from all
Satisfy Any
ErrorDocument 200 "ok"
RewriteEngine On
RewriteRule "/healthcheck" - [R=200]
</Location>
</VirtualHost>

BIN
screenshots/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
screenshots/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
screenshots/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

15
start.sh Normal file → Executable file
View file

@ -2,11 +2,14 @@
set -eu
echo "=> Starting apache"
APACHE_CONFDIR="" source /etc/apache2/envvars
rm -f "${APACHE_PID_FILE}"
/usr/sbin/apache2 -DFOREGROUND &
mkdir -p /app/data/runtime /app/data/config
if [[ ! -f /app/data/config/prometheus.yml ]]; then
echo "=> Creating config file on first run"
sudo -u cloudron cp -n /app/code/prometheus.yml /app/data/config/prometheus.yml
fi
chown -R cloudron:cloudron /app/data
echo "=> Starting Prometheus"
cd /usr/local/bin/prometheus
exec /usr/local/bin/gosu cloudron:cloudron ./prometheus --config.file=/app/data/config/prometheus.yml --storage.tsdb.path=/app/data/runtime
exec /usr/local/bin/gosu cloudron:cloudron /app/code/prometheus --config.file=/app/data/config/prometheus.yml --storage.tsdb.path=/app/data/runtime