Skip to content

Commit

Permalink
finishing up loki-canary move into loki repo
Browse files Browse the repository at this point in the history
  • Loading branch information
slim-bean committed Jul 17, 2019
1 parent 75ef8c5 commit e6f431a
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 2,594 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ cmd/promtail/promtail
cmd/loki/loki-debug
cmd/promtail/promtail-debug
cmd/docker-driver/docker-driver
cmd/loki-canary/loki-canary
/loki
/promtail
/logcli
/loki-canary
dlv
rootfs/
rootfs/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Once you have promtail, Loki, and Grafana running, continue with [our usage docs
- [Promtail](./docs/promtail.md) is an agent which can tail your log files and push them to Loki.
- [Docker Logging Driver](./cmd/docker-driver/README.md) is a docker plugin to send logs directly to Loki from Docker containers.
- [Logcli](./docs/logcli.md) on how to query your logs without Grafana.
- [Loki Canary](./docs/canary/README.md) for monitoring your Loki installation for missing logs.
- [Troubleshooting](./docs/troubleshooting.md) for help around frequent error messages.
- [Usage](./docs/usage.md) for how to set up a Loki datasource in Grafana and query your logs.

Expand Down
2 changes: 1 addition & 1 deletion cmd/loki-canary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.9
RUN apk add --update --no-cache ca-certificates
ADD loki-canary /usr/bin
ENTRYPOINT [ "/bin/loki-canary" ]
ENTRYPOINT [ "/usr/bin/loki-canary" ]
6 changes: 3 additions & 3 deletions cmd/loki-canary/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/grafana/loki-canary/pkg/canary/comparator"
"github.com/grafana/loki-canary/pkg/canary/reader"
"github.com/grafana/loki-canary/pkg/canary/writer"
"github.com/grafana/loki/pkg/canary/comparator"
"github.com/grafana/loki/pkg/canary/reader"
"github.com/grafana/loki/pkg/canary/writer"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/canary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In the background, loki-canary also runs a timer which iterates through all the

To run the image, you can do something simple like:

`kubectl run loki-canary --generator=run-pod/v1 --image=grafana/loki-canary:latest --restart=Never --image-pull-policy=Never --labels=name=loki-canary`
`kubectl run loki-canary --generator=run-pod/v1 --image=grafana/loki-canary:latest --restart=Never --image-pull-policy=Never --labels=name=loki-canary -- -addr=loki:3100`

Or you can do something more complex like deploy it as a daemonset, there is a ksonnet setup for this in the `production` folder, you can import it using jsonnet-bundler:

Expand Down
4 changes: 2 additions & 2 deletions pkg/canary/comparator/comparator.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/grafana/loki-canary/pkg/canary/reader"
"github.com/grafana/loki/pkg/canary/reader"
)

const (
Expand Down Expand Up @@ -125,7 +125,7 @@ func (c *Comparator) entryReceived(ts time.Time) {
outOfOrderEntries.Inc()
_, _ = fmt.Fprintf(c.w, ErrOutOfOrderEntry, e, c.entries[:i])
}
responseLatency.Observe(time.Now().Sub(ts).Seconds())
responseLatency.Observe(time.Since(ts).Seconds())
// Put this element in the acknowledged entries list so we can use it to check for duplicates
c.ackdEntries = append(c.ackdEntries, c.entries[i])
// Do not increment output index, effectively causing this element to be dropped
Expand Down
Loading

0 comments on commit e6f431a

Please sign in to comment.