-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Targets: Add Heroku HTTPS drain target #6448
Targets: Add Heroku HTTPS drain target #6448
Conversation
Happy to add docs, don't know in which specific section to do so |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @thepalbi, thanks for the contribution!
The docs can be added in these sections:
https://grafana.com/docs/loki/latest/clients/promtail/configuration/#scrape_configs and https://grafana.com/docs/loki/latest/clients/promtail/scraping/
which is defined here docs/sources/clients/promtail/configuration.md
and docs/sources/clients/promtail/scraping.md
respectively.
I've added a couple nits but overall this looks solid.
I think we'll need to get the terminology consistent here as well, for clarity. We're referring to "heroku", "heroku target", "heroku drain" in a few places... it'd be great if we could standardise on "heroku drain", or whatever @KMiller-Grafana would suggest.
Co-authored-by: Danny Kopping <dannykopping@gmail.com>
Co-authored-by: Danny Kopping <dannykopping@gmail.com>
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0.4%
+ loki 0% |
Completely agree, I'll do a cleanup pass making the naming consistent with "heroku drain" since it's the de-facto naming for this mechanism for moving heroku logs In some places I'll compose the naming like: Also, modifying internal labels produced by the target to: lb.Set("__heroku_drain_host", message.Hostname)
lb.Set("__heroku_drain_app", message.Application)
lb.Set("__heroku_drain_proc", message.Process)
lb.Set("__heroku_drain_log_id", message.ID) to keep those names consistent with the target. |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
Thanks for the changes @thepalbi! This is almost ready for approval; can you please address the last couple comments? I'll then re-review |
@dannykopping sure thing Danny! Should I address the documentation in a follow up PR? |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0.3%
+ querier 0%
+ querier/queryrange 0.1%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
|
@dannykopping added docs in this PR as discussed! |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
- querier/queryrange -0.1%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the code 👍 great work @thepalbi!
@KMiller-Grafana will review the docs, and then we can merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made lots of small suggestions to improve the capitalization and grammar. Thanks for the thorough documentation.
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
@KMiller-Grafana just applied all your suggestions, and removed something that I copied erroneously form Promtail's GCP docs |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs look good to me. Thank you for the changes.
What this PR does / why we need it:
Heroku streams logs from all its service layers (systems, builds, application) to a common component called LogPlex, from which they can be consumed. In the Heroku platform itself, the ways for consuming logs are either via CLI, which offers basic filtering and tail capabilities; or in their web UI.
Apart from both of these, LogPlex has a concept of drains, which are destinations where logs can be streamed to, and shipped, consumed, etc. Between these, once exposes a mechanism for shipping to a HTTPS destination. This is called HTTPS Drain.
This PR adds a new promtail target that exposes an HTTP server (in the form of a drain as described above), that can be used to receive logs from Heroku.
The target allows the following configurations:
This target exposes some of the received "label" as "internal labels" to be re-labeled by the user using the scrape config (much like the syslog target does), and dropped if not used. These are:
__logplex_host
: hostname of the log producer__logplex_app
: application name of the log producer__logplex_proc
: process id of the log producer__logplex_log_id
: log identifierOn the other hand, Heroku offers best-effort delivery guarantees. That said, this target implementation does not offer no other guarantees. In case that some delivery from Heroku to promtail fails, this will be dropped and eventually Heroku will notify this receiver that some log entries were dropped.
Which issue(s) this PR fixes:
n/a
Special notes for your reviewer:
Since Heroku ships their metrics through HTTP, in a syslog formatted message with octet framing (just like promtail's syslog target expects) this new target is very similar to both the loki-push and syslog targets.
Also, in the Heroku HTTPS drain docs, a mention is made that the syslog format that Heroku uses is not RFC-compliant. Because of that, an utils Go lib that the same company has publicly available is used for parsing each entry.
Checklist
CHANGELOG.md
.docs/sources/upgrading/_index.md