Skip to content

Commit ee9c95e

Browse files
Nele Lea UhlemannNele Lea Uhlemann
authored andcommitted
Adding deployment resources for the guides on the Autometrics doc page including:
- Docker deployment resources for Prometheus and OTel Collector
1 parent cf70ebf commit ee9c95e

File tree

8 files changed

+1703
-0
lines changed

8 files changed

+1703
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ressources for deployment guides
2+
3+
This folder contains deployment resources for the various components of the Autometrics microframework designed for different cloud environments and platforms.
4+
5+
For comprehensive deployment guides, please refer to our [documentation page](https://docs.autometrics.dev/).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM otel/opentelemetry-collector:latest
2+
ADD otel-collector-config.yaml /etc/otelcol/config.yaml
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# OpenTelemetry (OTel) Collector deployment ressources
2+
3+
The detailed guides for the different platforms can be found [here](https://docs.autometrics.dev/deploying-otel-collector)
4+
5+
## Using Docker with OTel Collector for:
6+
- Local setup
7+
- Northflank
8+
- Railway
9+
10+
The OTel Collector provides a [Docker image](https://hub.docker.com/r/prom/prometheus) for easy deployment. To customize it, we use a **Dockerfile** with the image and a **otel-collector-config.yml** file for configuration.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
receivers:
2+
otlp:
3+
protocols:
4+
http:
5+
endpoint: 0.0.0.0:4318
6+
# Example to push metrics towards Prometheus (not recommended by Prometheus).
7+
# Refer to the endpoint you have Prometheus running in your private network.
8+
# Include /api/v1/write to the endpoint
9+
#
10+
exporters:
11+
prometheusremotewrite:
12+
endpoint: http://prometheus:9090/api/v1/write
13+
resource_to_telemetry_conversion:
14+
enabled: true # Convert resource attributes to metric labels
15+
16+
service:
17+
telemetry:
18+
logs:
19+
level: "debug"
20+
pipelines:
21+
metrics:
22+
receivers: [otlp]
23+
exporters: [prometheusremotewrite]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prom/prometheus
2+
3+
USER root
4+
RUN mkdir -p /etc/config
5+
USER nobody
6+
7+
ADD prometheus.yml /etc/prometheus/
8+
ADD autometrics-rules.yml /etc/config/
9+
10+
# Options:
11+
# Enable the remote write endpoint, if you want to push metrics via the Otel-collector
12+
# Change log level if you need to debug
13+
# CMD ["--web.enable-remote-write-receiver", "--log.level=debug"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Prometheus deployment ressources
2+
3+
The detailed guides for the different platforms can be found [here](https://docs.autometrics.dev/deploying-prometheus)
4+
5+
## Using Docker with Prometheus for:
6+
- Local setup
7+
- Northflank
8+
- Railway
9+
10+
Prometheus provides a [Docker image](https://hub.docker.com/r/prom/prometheus) for easy deployment. To customize it, we use a **Dockerfile** with the image and a **prometheus.yml** file for configuration. In our configuration, we refer to our **autometrics-rules.yml**.
11+
12+
### Platform-Specific Networking:
13+
The main difference comes in setting up networking on these platforms. We've detailed the steps in [our guides](https://docs.autometrics.dev/deploying-prometheus), so check them out for specific instructions tailored to each cloud platform.

deployment-guides-ressources/prometheus/autometrics-rules.yml

Lines changed: 1609 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
global:
2+
evaluation_interval: 15s
3+
scrape_interval: 15s
4+
scrape_timeout: 10s
5+
rule_files:
6+
- /etc/config/autometrics-rules.yml
7+
# Prometheus polling metrics from itself
8+
scrape_configs:
9+
- job_name: prometheus
10+
static_configs:
11+
- targets:
12+
- localhost:9090
13+
# Prometheus polling metrics from your application running in the same network
14+
scrape_configs:
15+
- job_name: internal-endpoint2
16+
metrics_path: /metrics
17+
static_configs:
18+
# Within a private network over http.
19+
# For Northflank and Railway you can find the private network reference in the service settings
20+
# It will be something like this "service-name:PORT"
21+
- targets: ['example-service:8000']
22+
# For a real deployment, you would want the scrape interval to be
23+
# longer but for testing, you want the data to show up quickly
24+
scrape_interval: 120s
25+
26+
# Note: if you want to push your metrics towards Prometheus for example with the Otel collecor,
27+
# you don't need to define a scrape endpoint.
28+
# just make sure in the Dockerfile to enable the remote write endpoint

0 commit comments

Comments
 (0)