Skip to content

Commit

Permalink
Update installation guide, add client description
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Aug 2, 2020
1 parent ce87f54 commit 9fb8b98
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SUM_FILES = build/sha256sum build/md5sum
GO_FLAGS =
GO_BUILD = go build $(GO_FLAGS) -ldflags "-X 'main.version=$(VERSION)'" -o $@ $<

export GO111MODULE=on

.PHONY: all clean docker test version

Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,25 @@ replaceWith = "servers.HOSTNAME.software.pdns"
```
This will ask Grafsy to replace all kinds of metric starting with **pdns** or aggregation prefixes **^(SUM|AVG|MIN|MAX).pdns** to **servers.HOSTNAME.software.pdns** where *HOSTNAME* will be replaced with os.Hostname() output

# Client

The `grafsy-client` binary is implemented for easy metrics sending from generators to a grafsy daemon. You only need to specify the config file, if a not-default one is used.
It sends either metrics from specified files or from STDIN.

```
Usage: ./build/grafsy-client [args] [file1 [fileN...]]
Or: metrics-generator | ./build/grafsy-client [args]
```

# Installation

- Install go https://golang.org/doc/install
- Make a proper structure of directories: `mkdir -p /opt/go/src /opt/go/bin /opt/go/pkg`
- Setup g GOPATH variable: `export GOPATH=/opt/go`
- Clone this project to src: `go get github.com/leoleovich/grafsy`
- Fetch dependencies: `cd /opt/go/github.com/leoleovich/grafsy && go get ./...`
- Compile project: `go install github.com/leoleovich/grafsy/grafsy`
- Copy config file: `mkdir /etc/grafsy && cp /opt/go/src/github.com/leoleovich/grafsy/grafsy.toml /etc/grafsy/`
- Clone this project: `git clohe https://github.com/leoleovich/grafsy.git && cd grafsy`
- Compile project: `make`
- Copy a config file: `mkdir /etc/grafsy && cp grafsy.toml /etc/grafsy/`
- Change your settings, e.g. `carbonAddrs`
- Run it `/opt/go/bin/grafsy`
- Run it `./build/grafsy`
- Send metrics via client `metrics-generator | ./build/grafsy-client`

## Docker

Expand Down

0 comments on commit 9fb8b98

Please sign in to comment.