Skip to content

Commit

Permalink
Promtail: Fix examples how to build it (#8898)
Browse files Browse the repository at this point in the history
The build flags have to be provided before the package paths.

Otherwise the `build` command fails with this error:
> malformed import path "--tags=promtail_journal_enabled": leading dash

See `go help build`:
> usage: go build [-o output] [build flags] [packages]
  • Loading branch information
darxriggs authored Mar 27, 2023
1 parent cba3102 commit 4c4c7e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ With Journal support on Ubuntu, run with the following commands:

```bash
$ sudo apt install -y libsystemd-dev
$ go build ./clients/cmd/promtail --tags=promtail_journal_enabled
$ go build --tags=promtail_journal_enabled ./clients/cmd/promtail
```

With Journal support on CentOS, run with the following commands:

```bash
$ sudo yum install -y systemd-devel
$ go build ./clients/cmd/promtail --tags=promtail_journal_enabled
$ go build --tags=promtail_journal_enabled ./clients/cmd/promtail
```

Otherwise, to build Promtail without Journal support, run `go build`
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/upgrading/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The go build tag `promtail_journal_enabled` should be passed to include Journal
If you need Journal support you will need to run go build with tag `promtail_journal_enabled`:

```shell
go build ./clients/cmd/promtail --tags=promtail_journal_enabled
go build --tags=promtail_journal_enabled ./clients/cmd/promtail
```
Introducing this tag aims to relieve Linux/CentOS users with CGO enabled from installing libsystemd-dev/systemd-devel libraries if they don't need Journal support.

Expand Down

0 comments on commit 4c4c7e3

Please sign in to comment.