Skip to content

Commit d263cfe

Browse files
authored
Merge pull request #93 from troncommons/develop
feat(doc): add alloy to readme
2 parents 711a691 + c01694c commit d263cfe

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

metric_monitor/REMOTE_WRITE_WITH_THANOS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,20 @@ remote_write:
127127
- The `--storage.tsdb.max-block-duration=30m` flag defines the maximum duration for generating TSDB blocks locally. With this setting, Prometheus will create new TSDB blocks at intervals no longer than 30 minutes, ensuring regular data persistence and efficient storage management.
128128
- Other storage flags can be found in the [official documentation](https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects). For a quick start, you could use the default values.
129129

130+
#### Alternative way to set up Prometheus and Node Exporter
131+
Grafana Alloy provides a unified solution that consolidates the functionalities of Prometheus and Node Exporter into a single service. As an all-in-one monitoring agent, it not only handles metrics collection and exportation but also includes built-in log aggregation capabilities, eliminating the need for separate monitoring components.
132+
##### Alloy configuration file
133+
Please refer to the [prometheus-loki.alloy](./conf/prometheus-loki.alloy) for the Alloy configuration file. You will need to update certain values to match your environment, such as `prometheus.scrape.targets`, `discovery.relabel`.
134+
135+
136+
Note: If you don’t require the Loki feature, you can remove the last two configuration sections that begin with loki.
137+
138+
##### Start Alloy
139+
Use the `.docker-compose/docker-compose-alloy.yml` and the following command to start Alloy.
140+
```sh
141+
docker-compose -f ./docker-compose/docker-compose-alloy.yml up -d
142+
```
143+
130144
### Step 2: Set up Thanos Receive
131145
The [Thanos Receive](https://thanos.io/tip/components/receive.md/#receiver) service implements the Prometheus Remote Write API. It builds on top of the existing Prometheus TSDB and retains its usefulness while extending its functionality with long-term-storage, horizontal scalability, and downsampling. Prometheus instances are configured to continuously write metrics to it. Thanos Receive exposes the StoreAPI so that Thanos Queriers can query received metrics in real-time.
132146

tools/trond/cmd/snapshot/download.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package snapshot
33
import (
44
"errors"
55
"fmt"
6-
"github.com/tronprotocol/tron-docker/config"
76
"log"
87
"os"
98
"strings"
109

10+
"github.com/tronprotocol/tron-docker/config"
11+
1112
"github.com/MakeNowJust/heredoc/v2"
1213
"github.com/spf13/cobra"
1314
"github.com/tronprotocol/tron-docker/utils"
@@ -120,12 +121,12 @@ func download(domain string, backup string, nType string) {
120121

121122
if folderYes, _ := utils.PathExists(networkDst); !folderYes {
122123
fmt.Println("Creating directory:", networkDst)
123-
if err := utils.CreateDir(networkDst, true); err != nil {
124+
if err = utils.CreateDir(networkDst, true); err != nil {
124125
fmt.Println(" - Error creating directory:", err)
125126
return
126127
}
127128
} else if databaseYes, _ := utils.PathExists(databaseDst); databaseYes {
128-
fmt.Println(fmt.Sprintf("Notice: there already exist database data %s, please delete it if you want to download again.", databaseDst))
129+
fmt.Printf("Notice: there already exist database data %s, please delete it if you want to download again.\n", databaseDst)
129130
return
130131
}
131132

@@ -135,15 +136,15 @@ func download(domain string, backup string, nType string) {
135136
return
136137
}
137138

138-
if err := utils.ExtractTgzWithStatus(downloadSnapshot, "./"); err != nil {
139+
if err = utils.ExtractTgzWithStatus(downloadSnapshot, "./"); err != nil {
139140
fmt.Println("Error:", err)
140141
return
141142
}
142143

143144
/* At least according to the domain, move extracted database to the correct subtype directory.
144145
The database will be used by `./trond node run-single`, check that part for details
145146
*/
146-
fmt.Println(fmt.Sprintf("Finally move the database to the corresponding network folder %s", databaseDst))
147+
fmt.Printf("Finally move the database to the corresponding network folder %s\n", databaseDst)
147148
srcDatabase := "./output-directory/database"
148149

149150
// Check whether dst directory already exist, if yes, return warning let user decide whether to continue downloading.

0 commit comments

Comments
 (0)