8000 Preserve source for Traefik status codes by jwestbury · Pull Request #20545 · DataDog/integrations-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Preserve source for Traefik status codes #20545

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jwestbury
Copy link
@jwestbury jwestbury commented Jun 18, 2025

What does this PR do?

This PR enables preserveSource for both OriginStatus and DownstreamStatus in Traefik logs. It preserves the remapping behavior which was already present, while increasing fidelity between these two non-identical fields.

An alternative approach that I would be happy with would be remapping only DownstreamStatus to http.status_code (as this is what is returned to callers), and remap OriginStatus to http.origin_status_code or similar (I'm unsure if there are any existing conventions for this specific piece of data).

Motivation

The Traefik log fields OriginStatus and DownstreamStatus are currently both merged into http.status_code, and the source fields are dropped.

However, origin and downstream status do not represent the same data, and merging them into each other like this reduces the fidelity of log data. In particular, it makes it impossible to disambiguate the source of an error - e.g., I cannot tell whether Traefik's target returned a 503, or whether Traefik failed to connect to the target in the first place.

I should note that this is currently causing production pain for us by making it difficult to create useful metrics tracking Traefik's health; and there is no available metric in Traefik which otherwise disambiguates this data.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

The Traefik log fields `OriginStatus` and `DownstreamStatus` are currently both merged into `http.status_code`, and the source fields are dropped.

However, origin and downstream status do not represent the same data, and merging them into each other like this reduces the fidelity of log data. In particular, it makes it impossible to disambiguate the source of an error - e.g., I cannot tell whether Traefik's target returned a 503, or whether Traefik failed to connect to the target in the first place.

I should note that this is currently causing production pain for us by making it difficult to create useful metrics tracking Traefik's health; and there is no available metric in Traefik which otherwise disambiguates this data.

This change would keep the remapping for compatibility, but would preserve the source fields to ensure sufficient fidelity is preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0