Compare commits

...

2 Commits

Author SHA1 Message Date
9d10a69b0d chore: update go and alpine docker image version
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
2025-04-03 11:12:32 +02:00
8b6e75ae77 feat: use sentry tags instead of context for better observability
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
2025-03-19 15:04:55 +01:00
2 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
FROM reg.cadoles.com/proxy_cache/library/golang:1.23 AS BUILD
FROM reg.cadoles.com/proxy_cache/library/golang:1.24.2 AS build
RUN apt-get update \
&& apt-get install -y make
@ -33,7 +33,7 @@ RUN /src/dist/bouncer_linux_amd64_v1/bouncer -c '' config dump > /src/dist/bounc
&& yq -i '.bootstrap.lockTimeout = "30s"' /src/dist/bouncer_linux_amd64_v1/config.yml \
&& yq -i '.integrations.kubernetes.lockTimeout = "30s"' /src/dist/bouncer_linux_amd64_v1/config.yml
FROM reg.cadoles.com/proxy_cache/library/alpine:3.20 AS RUNTIME
FROM reg.cadoles.com/proxy_cache/library/alpine:3.21 AS runtime
RUN apk add --no-cache ca-certificates dumb-init
@ -41,10 +41,10 @@ ENTRYPOINT ["/usr/bin/dumb-init", "--"]
RUN mkdir -p /usr/local/bin /usr/share/bouncer/bin /etc/bouncer
COPY --from=BUILD /src/dist/bouncer_linux_amd64_v1/bouncer /usr/share/bouncer/bin/bouncer
COPY --from=BUILD /src/layers /usr/share/bouncer/layers
COPY --from=BUILD /src/templates /usr/share/bouncer/templates
COPY --from=BUILD /src/dist/bouncer_linux_amd64_v1/config.yml /etc/bouncer/config.yml
COPY --from=build /src/dist/bouncer_linux_amd64_v1/bouncer /usr/share/bouncer/bin/bouncer
COPY --from=build /src/layers /usr/share/bouncer/layers
COPY --from=build /src/templates /usr/share/bouncer/templates
COPY --from=build /src/dist/bouncer_linux_amd64_v1/config.yml /etc/bouncer/config.yml
RUN ln -s /usr/share/bouncer/bin/bouncer /usr/local/bin/bouncer

View File

@ -80,9 +80,10 @@ func (d *Director) rewriteRequest(r *http.Request) (*http.Request, error) {
r = r.WithContext(proxyCtx)
if sentryScope, _ := SentryScope(ctx); sentryScope != nil {
sentryScope.SetContext("bouncer", sentry.Context{
"proxy_name": p.Name,
"proxy_target": r.URL.String(),
sentryScope.SetTags(map[string]string{
"bouncer.proxy.name": string(p.Name),
"bouncer.proxy.target.url": r.URL.String(),
"bouncer.proxy.target.host": r.URL.Host,
})
}