Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Apr 15, 2024
1 parent 299a525 commit 72324c2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,15 @@ $ wget https://github.com/grafana/alloy/releases/download/v1.0.0/alloy-linux-amd
$ unzip alloy-linux-amd64.zip
$ mv alloy-linux-amd64 alloy

$ export PROMETHEUS_URL=http://X.X.X.X:9090/api/v1/write
$ export PROMETHEUS_USERNAME=admin
$ export PROMETHEUS_PASSWORD=password
$ export REMOTE_LOKI_WRITE_URL=http://X.X.X.X:3100/loki/api/v1/push
$ export REMOTE_PROMETHEUS_WRITE_URL=http://X.X.X.X:9090/api/v1/write
$ export REMOTE_PROMETHEUS_USERNAME=admin
$ export REMOTE_PROMETHEUS_PASSWORD=password

$ ./alloy run config.alloy
```


### Deploying Badger

[Badger](https://github.com/Uptimedog/Badger) is a microservice that can be used for testing the LGTM stack. To deploy badger, do the following

```zsh
$
```


### Raspberry PI

To run the complete LGTM stack on RPI and expose it to outside world, You can use ngrok
Expand Down
41 changes: 29 additions & 12 deletions config.alloy
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
logging {
level = "debug"
format = "json"
// Remote Loki Server
loki.write "remote_loki" {
endpoint {
url = env("REMOTE_LOKI_WRITE_URL")
}
}

prometheus.remote_write "default" {
// Remote Prometheus Server
prometheus.remote_write "remote_prometheus" {
endpoint {
url = env("PROMETHEUS_URL")
url = env("REMOTE_PROMETHEUS_WRITE_URL")

basic_auth {
username = env("PROMETHEUS_USERNAME")
password = env("PROMETHEUS_PASSWORD")
username = env("REMOTE_PROMETHEUS_USERNAME")
password = env("REMOTE_PROMETHEUS_PASSWORD")
}
}
}

prometheus.scrape "agent" {
targets = [{
__address__ = "127.0.0.1:12345",
}]
// Send Agent Logs to Loki
logging {
level = "info"
write_to = [loki.write.remote_loki.receiver]
}

// Collect metrics from the local running Alloy instance and forward to
// Prometheus.
prometheus.exporter.self "home_rpi_alloy" {}
prometheus.scrape "home_rpi_alloy" {
targets = prometheus.exporter.self.home_rpi_alloy.targets

forward_to = [prometheus.remote_write.remote_prometheus.receiver]
}

forward_to = [prometheus.remote_write.default.receiver]
loki.source.file "badger_logs" {
targets = [
{__path__ = "/var/logs/badger.log", "color" = "pink", "service_name" = "badger", "component" = "backend"},
]
forward_to = [loki.write.remote_loki.receiver]
}

0 comments on commit 72324c2

Please sign in to comment.