Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda-Promtail #2282

Merged
merged 7 commits into from
Jul 29, 2020
Merged

Lambda-Promtail #2282

merged 7 commits into from
Jul 29, 2020

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Jul 1, 2020

What

This PR specs out lambda-promtail, an AWS lambda adapter for pushing logs to loki via an intermediary set of promtails.

Why

We've had many requests for a workflow that supports ephemeral jobs like those of AWS Lambda.

Balancing Labels & Ordering

Generally the problem here is reduced to cardinality problems vs ordering in distributed systems. Basically, how do we group logs from the same "job" but different invocations in the same log stream? This depends on an as-of-yet unimplemented addition to promtail which would expose the Push API but defer timestamping of logs to the promtail level rather than at the client (whatever is pushing to promtail). This would allow us to put a bank of promtails in front for scalability/HA reasons, each applying timestamps as they receive logs via the Push API. To avoid out-of-order issues, each promtail will still need to add their own differentiating label value to incoming streams, making the worst-case scenario multiply the stream count by the number of promtails. However, this is still controllable and a significant improvement over creating a stream at the invocation level (essentially labeling by uuid).

/cc @slim-bean

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2020

Codecov Report

Merging #2282 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2282   +/-   ##
=======================================
  Coverage   62.79%   62.79%           
=======================================
  Files         162      162           
  Lines       13952    13952           
=======================================
  Hits         8761     8761           
- Misses       4508     4509    +1     
+ Partials      683      682    -1     
Impacted Files Coverage Δ
pkg/querier/queryrange/downstreamer.go 95.87% <0.00%> (-2.07%) ⬇️
pkg/promtail/targets/file/tailer.go 78.40% <0.00%> (+2.27%) ⬆️

@owen-d owen-d force-pushed the lambda-promtail branch from 30b306b to 1068102 Compare July 9, 2020 14:48
@owen-d owen-d marked this pull request as ready for review July 13, 2020 18:08
@owen-d owen-d force-pushed the lambda-promtail branch from c223a16 to 7e84fb0 Compare July 16, 2020 17:00
.gitignore Outdated
@@ -23,3 +23,4 @@ dlv
rootfs/
dist
coverage.txt
.aws-sam
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: newline

docs/README.md Outdated
@@ -39,8 +39,9 @@ simplifies the operation and significantly lowers the cost of Loki.
5. [Troubleshooting](clients/promtail/troubleshooting.md)
2. [Docker Driver](clients/docker-driver/README.md)
1. [Configuration](clients/docker-driver/configuration.md)
4. [Fluent Bit](../cmd/fluent-bit/README.md)
3. [Fluentd](clients/fluentd/README.md)
3. [Fluent Bit](../cmd/fluent-bit/README.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to merge master back in. some of those has changed.

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

good work Owen !

docs/clients/lambda-promtail/README.md Outdated Show resolved Hide resolved
docs/clients/lambda-promtail/README.md Outdated Show resolved Hide resolved
tools/lambda-promtail/lambda-promtail/main.go Show resolved Hide resolved
tools/lambda-promtail/template.yaml Show resolved Hide resolved
@owen-d owen-d force-pushed the lambda-promtail branch from 7e84fb0 to 0a3ce49 Compare July 29, 2020 13:48
@owen-d owen-d merged commit 2a596a7 into grafana:master Jul 29, 2020
cyriltovena pushed a commit to cyriltovena/loki that referenced this pull request Jun 11, 2021
Signed-off-by: Bryan Boreham <bryan@weave.works>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants