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

Use http prefix path correctly in promtail #4832

Merged
merged 2 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Main

* [4828](https://github.com/grafana/loki/pull/4282) **chaudum**: Set correct `Content-Type` header in query response
* [4832](https://github.com/grafana/loki/pull/4832) **taisho6339**: Use http prefix path correctly in Promtail
* [4828](https://github.com/grafana/loki/pull/4828) **chaudum**: Set correct `Content-Type` header in query response
* [4794](https://github.com/grafana/loki/pull/4794) **taisho6339**: Aggregate inotify watcher to file target manager
* [4663](https://github.com/grafana/loki/pull/4663) **taisho6339**: Add SASL&mTLS authentication support for Kafka in Promtail
* [4745](https://github.com/grafana/loki/pull/4745) **taisho6339**: Expose Kafka message key in labels
Expand Down
4 changes: 2 additions & 2 deletions clients/pkg/promtail/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func New(cfg Config, log log.Logger, tms *targets.TargetManagers, promtailCfg st
if err != nil {
return nil, errors.Wrapf(err, "parse external URL %q", cfg.ExternalURL)
}
cfg.PathPrefix = externalURL.Path
externalURL.Path += cfg.PathPrefix

healthCheckTargetFlag := true
if cfg.HealthCheckTarget != nil {
Expand All @@ -99,7 +99,7 @@ func New(cfg Config, log log.Logger, tms *targets.TargetManagers, promtailCfg st

serv.HTTP.Path("/").Handler(http.RedirectHandler(path.Join(serv.externalURL.Path, "/targets"), 303))
serv.HTTP.Path("/ready").Handler(http.HandlerFunc(serv.ready))
serv.HTTP.PathPrefix("/static/").Handler(http.FileServer(ui.Assets))
serv.HTTP.PathPrefix("/static/").Handler(http.StripPrefix(externalURL.Path, http.FileServer(ui.Assets)))
serv.HTTP.Path("/service-discovery").Handler(http.HandlerFunc(serv.serviceDiscovery))
serv.HTTP.Path("/targets").Handler(http.HandlerFunc(serv.targets))
serv.HTTP.Path("/config").Handler(http.HandlerFunc(serv.config))
Expand Down