mirror of https://github.com/grafana/loki
Adding Promtail and Heroku blogpost files to `examples/` (#7347)
parent
b1d4efab12
commit
cd919f70eb
@ -0,0 +1,10 @@ |
||||
from grafana/promtail:main-c9ef062 |
||||
|
||||
# Copy the config.yml file we created in the step above, inside the container itself. This simplifies the |
||||
# configuration of the Promtail instance. |
||||
COPY config.yml /etc/promtail/config.yml |
||||
|
||||
# This three flags indicates promtail where the configurations is located, to interpolate the configuration |
||||
# file with environment variables (this is to avoid hardcoding values such as API Keys), and lastly, to print |
||||
# the whole configuration file to STDERR when starting the container (this is helpful for debugging). |
||||
CMD ["-config.file=/etc/promtail/config.yml", "-config.expand-env=true", "-print-config-stderr"] |
@ -0,0 +1,4 @@ |
||||
# Promtail configuration for sending Heroku logs to Loki |
||||
|
||||
This directory contains configuration to use with the [Promtail and Heroku blogpost](https://grafana.com/blog/2022/09/19/how-to-easily-configure-grafana-loki-and-promtail-to-receive-logs-from-heroku/). |
||||
|
@ -0,0 +1,38 @@ |
||||
server: |
||||
http_listen_port: 9080 |
||||
grpc_listen_port: 0 |
||||
log_level: "info" |
||||
|
||||
positions: |
||||
filename: /tmp/positions.yaml |
||||
|
||||
# This bit indicates what Loki instance to write the logs to. We’ll inject the |
||||
# details and credentials through environment variables |
||||
clients: |
||||
- url: https://${LOKI_TENANT_ID}:${LOKI_TOKEN}@${LOKI_HOST}/loki/api/v1/push |
||||
|
||||
scrape_configs: |
||||
# Job name, that will be injected in each log line |
||||
- job_name: ${JOB_NAME} |
||||
|
||||
# Apply relabel to keep Heroku internal labels |
||||
relabel_configs: |
||||
- source_labels: ["__heroku_drain_host"] |
||||
target_label: "host" |
||||
- source_labels: ["__heroku_drain_app"] |
||||
target_label: "app" |
||||
- source_labels: ["__heroku_drain_proc"] |
||||
target_label: "proc" |
||||
|
||||
# Main heroku target configuration |
||||
heroku_drain: |
||||
server: |
||||
http_listen_address: 0.0.0.0 |
||||
# $PORT is a special environment variable that Heroku fills with |
||||
# port that’s accessible from outside the container. We indicate promtail |
||||
# to listen for Heroku logs in it. |
||||
http_listen_port: ${PORT} |
||||
log_level: info |
||||
# Tag each log entry with our job name |
||||
labels: |
||||
job: ${JOB_NAME} |
@ -0,0 +1,4 @@ |
||||
# Heroku application configuration. It indicates heroku what to deploy |
||||
build: |
||||
docker: |
||||
web: Dockerfile |
Loading…
Reference in new issue