Spaces:
Sleeping
Sleeping
Commit ·
e57873f
0
Parent(s):
prometheus server
Browse files- Dockerfile +20 -0
- prometheus.yml.template +8 -0
Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM prom/prometheus:v2.45.0
|
| 2 |
+
USER root
|
| 3 |
+
|
| 4 |
+
# Install envsubst
|
| 5 |
+
RUN apt-get update && apt-get install -y gettext-base && rm -rf /var/lib/apt/lists/*
|
| 6 |
+
|
| 7 |
+
# Fix permissions for HF (User 1000)
|
| 8 |
+
RUN mkdir -p /prometheus && chown -R 1000:1000 /prometheus
|
| 9 |
+
USER 1000
|
| 10 |
+
|
| 11 |
+
# Copy the template from the monitoring folder
|
| 12 |
+
COPY prometheus.yml.template /etc/prometheus/prometheus.yml.template
|
| 13 |
+
|
| 14 |
+
# Inject HF_TOKEN into the config and start Prometheus
|
| 15 |
+
# Note: We listen on 7860 because that's what HF expects for the UI
|
| 16 |
+
CMD ["/bin/sh", "-c", "\
|
| 17 |
+
envsubst < /etc/prometheus/prometheus.yml.template > /etc/prometheus/prometheus.yml && \
|
| 18 |
+
/bin/prometheus --config.file=/etc/prometheus/prometheus.yml \
|
| 19 |
+
--storage.tsdb.path=/prometheus \
|
| 20 |
+
--web.listen-address=:7860"]
|
prometheus.yml.template
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
scrape_configs:
|
| 2 |
+
- job_name: 'entity-labeler'
|
| 3 |
+
metrics_path: '/metrics'
|
| 4 |
+
scheme: 'https'
|
| 5 |
+
static_configs:
|
| 6 |
+
- targets: ['kadarakos-labeled.hf.space']
|
| 7 |
+
authorization:
|
| 8 |
+
credentials: '${HF_TOKEN}'
|