Skip to content

Commit

Permalink
Merge pull request #3 from mailgun/maxim/develop
Browse files Browse the repository at this point in the history
PIP-2673: Fix service URL logging to avoid schema mismatch with v2.6.x
  • Loading branch information
horkhe authored Oct 18, 2023
2 parents ac2cd7a + 75826c8 commit b5822ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/server/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ func (m *Manager) getLoadBalancerServiceHandler(ctx context.Context, serviceName

proxy := buildSingleHostProxy(target, passHostHeader, time.Duration(flushInterval), roundTripper, m.bufferPool)

proxy = accesslog.NewFieldHandler(proxy, accesslog.ServiceURL, target.String(), nil)
// FIXME: Traefik v2.6.x that is currently in prod defines ServiceURL
// field as object where as the v3.x.x. branch converted it to string.
// to allow both versions coexist in production ServiceURL is renamed
// to ServiceURLRaw.
proxy = accesslog.NewFieldHandler(proxy, "ServiceURLRaw", target.String(), nil)
proxy = accesslog.NewFieldHandler(proxy, accesslog.ServiceAddr, target.Host, nil)
proxy = accesslog.NewFieldHandler(proxy, accesslog.ServiceName, serviceName, nil)

Expand Down

0 comments on commit b5822ad

Please sign in to comment.