Skip to content

Commit

Permalink
Use http prefix path correctly in promtail (#4832)
Browse files Browse the repository at this point in the history
* Use http prefix path correctly in promtail

* Update changelog entry
  • Loading branch information
taisho6339 authored Nov 29, 2021
1 parent 82c9164 commit d7c3595
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit d7c3595

Please sign in to comment.