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

trace: adds back call to classify_eos on trailers #483

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

markdingram
Copy link
Contributor

@markdingram markdingram commented Apr 2, 2024

  • was dropped in the http-body 1.0 upgrade

Motivation

We have some tracing middleware that started as a copy of https://github.com/EmbarkStudios/server-framework/blob/main/src/middleware/trace.rs

After upgrading to tower-http 0.5.X one of the tests is failing -

https://github.com/EmbarkStudios/server-framework/blob/1bae7fe7a417443b365d2452007adfe46910037b/src/middleware/trace.rs#L205-L215

json atoms at path ".span.otel.status_code" are not equal:
    expected:
        "ERROR"
    actual:
        "OK"

Solution

Adds back call to classify_eos on trailers.

I've proven with this change the downstream tests pass once more. Notably I haven't attempted to write any tests in this repo - there was a historic desire to rewrite this middleware expessed in #365 - I would be amenable to spend some time to upstream some of the tests from https://github.com/EmbarkStudios/server-framework/blob/main/src/middleware/trace.rs if considered worthwhile by the maintainers.

- was dropped in the http-body 1.0 upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant