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

Fasthttp support!! #957

Merged
merged 38 commits into from
Jun 4, 2021
Merged

Fasthttp support!! #957

merged 38 commits into from
Jun 4, 2021

Conversation

savsgio
Copy link

@savsgio savsgio commented Apr 28, 2021

@cla-checker-service
Copy link

cla-checker-service bot commented Apr 28, 2021

💚 CLA has been signed

@apmmachine
Copy link
Contributor

apmmachine commented Apr 28, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: axw commented: jenkins run the tests please

  • Start Time: 2021-06-04T12:15:46.188+0000

  • Duration: 30 min 55 sec

  • Commit: a233546

Test stats 🧪

Test Results
Failed 0
Passed 10738
Skipped 266
Total 11004

Trends 🧪

Image of Build Times

Image of Tests

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening the PR @savsgio! I've taken a first pass, it's looking good. I'd like to simplify the API as much as possible (namely remove the Transaction wrapper type), remove unsafe code, and make sure it works well with the context.Context-based agent APIs.

module/apmfasthttp/transaction.go Outdated Show resolved Hide resolved
module/apmfasthttp/utils.go Outdated Show resolved Hide resolved
module/apmfasthttp/context.go Outdated Show resolved Hide resolved
module/apmfasthttp/types.go Outdated Show resolved Hide resolved
module/apmfasthttp/utils.go Outdated Show resolved Hide resolved
module/apmfasthttp/transaction.go Outdated Show resolved Hide resolved
module/apmfasthttp/utils.go Outdated Show resolved Hide resolved
module/apmfasthttp/server.go Outdated Show resolved Hide resolved
module/apmfasthttp/utils.go Outdated Show resolved Hide resolved
module/apmfasthttp/context.go Outdated Show resolved Hide resolved
Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. Left a few more comments.

As a more general comment: I'd strongly prefer to remove all pooling and optimisations until there is a complete, correct, and well unit tested implementation. Then with benchmarks we can see the impact of adding pooling, and whether it's worth the additional complexity.

module/apmfasthttp/utils.go Outdated Show resolved Hide resolved
module/apmfasthttp/utils.go Outdated Show resolved Hide resolved
module/apmfasthttp/types.go Outdated Show resolved Hide resolved
module/apmfasthttp/transaction.go Outdated Show resolved Hide resolved
@savsgio savsgio requested a review from axw June 1, 2021 09:43
Sergio Andres Virviescas Santana added 2 commits June 1, 2021 17:14
@savsgio
Copy link
Author

savsgio commented Jun 1, 2021

Hi @axw

Could you review it again? Please.

Thanks.

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @savsgio! Almost there, just a few small comments.

If it's not absolutely required, I'd like to unexport the TxCloser type to keep the API surface area minimal. If possible it would be nice to reuse apmhttp.StartTransactionBody; if not possible then no worries, but then we'll need to flip the order of W3C/Elastic traceparent headers.

Apart from those comments, could you please run make scripts/Dockerfile-testing update-licenses fmt

module/apmfasthttp/context.go Outdated Show resolved Hide resolved
module/apmfasthttp/context.go Outdated Show resolved Hide resolved
module/apmfasthttp/closer.go Outdated Show resolved Hide resolved
@savsgio savsgio requested a review from axw June 3, 2021 11:54
@savsgio savsgio requested a review from axw June 4, 2021 08:14
Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for your contribution and for bearing with me! Just need to wait for a green CI run now.

docs/supported-tech.asciidoc Outdated Show resolved Hide resolved
@axw
Copy link
Member

axw commented Jun 4, 2021

jenkins run the tests please

Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
@axw
Copy link
Member

axw commented Jun 4, 2021

jenkins run the tests please

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@savsgio there's some lint issues (check-vanity-imports is maybe a little too strict)
Can you please fix add the vanity import comment to each file? It might be worth running make check and fixing any issues you find, to avoid the lengthy round-trip through CI.

module/apmfasthttp/utils.go Outdated Show resolved Hide resolved
module/apmfasthttp/types.go Outdated Show resolved Hide resolved
module/apmfasthttp/server.go Outdated Show resolved Hide resolved
module/apmfasthttp/recovery.go Outdated Show resolved Hide resolved
module/apmfasthttp/context.go Outdated Show resolved Hide resolved
module/apmfasthttp/consts.go Outdated Show resolved Hide resolved
module/apmfasthttp/closer.go Outdated Show resolved Hide resolved
Sergio Andrés Virviescas Santana and others added 7 commits June 4, 2021 11:05
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
@savsgio
Copy link
Author

savsgio commented Jun 4, 2021

After run make check, theapmredigo is failing:

=== RUN   TestRequestContext
    integration_test.go:124: 
                Error Trace:    integration_test.go:124
                                                        integration_test.go:34
                Error:          Received unexpected error:
                                WRONGPASS invalid username-password pair
                Test:           TestRequestContext
--- FAIL: TestRequestContext (0.03s)
=== RUN   TestPipelineSendReceive
    integration_test.go:124: 
                Error Trace:    integration_test.go:124
                                                        integration_test.go:69
                Error:          Received unexpected error:
                                WRONGPASS invalid username-password pair
                Test:           TestPipelineSendReceive
--- FAIL: TestPipelineSendReceive (0.00s)
=== RUN   TestPipelinedTransaction
    integration_test.go:124: 
                Error Trace:    integration_test.go:124
                                                        integration_test.go:98
                Error:          Received unexpected error:
                                WRONGPASS invalid username-password pair
                Test:           TestPipelinedTransaction
--- FAIL: TestPipelinedTransaction (0.00s)
FAIL
FAIL    go.elastic.co/apm/module/apmredigo      0.262s
FAIL
make: *** [test] Error 1

@axw
Copy link
Member

axw commented Jun 4, 2021

Do you have REDIS_URL set in your environment? that's used by the tests to detect that they're running inside an integration testing environment. Maybe there's a collision with your environment.

Anyway, I think you can ignore those errors.

@axw
Copy link
Member

axw commented Jun 4, 2021

jenkins run the tests please

@savsgio
Copy link
Author

savsgio commented Jun 4, 2021

Do you have REDIS_URL set in your environment? that's used by the tests to detect that they're running inside an integration testing environment. Maybe there's a collision with your environment.

Anyway, I think you can ignore those errors.

haha ok!

@axw
Copy link
Member

axw commented Jun 4, 2021

OK, last one: can you please add a "go1.9" build tag to each of the source files apart from doc.go in apmfasthttp? The agent still supports Go 1.8 generally, but fasthttp doesn't appear to so we'll need to disable it there.

@savsgio
Copy link
Author

savsgio commented Jun 4, 2021

OK, last one: can you please add a "go1.9" build tag to each of the source files apart from doc.go in apmfasthttp? The agent still supports Go 1.8 generally, but fasthttp doesn't appear to so we'll need to disable it there.

The minimum supportted version by fasthttp is go 1.12.

Done!

@axw
Copy link
Member

axw commented Jun 4, 2021

jenkins run the tests please

module/apmfasthttp/doc.go Outdated Show resolved Hide resolved
Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
@axw
Copy link
Member

axw commented Jun 4, 2021

jenkins run the tests please

@axw axw merged commit ef7c39a into elastic:master Jun 4, 2021
@axw
Copy link
Member

axw commented Jun 4, 2021

Thanks again @savsgio! 🎉

@savsgio
Copy link
Author

savsgio commented Jun 4, 2021

Thank you very much! @axw 😉 🎉

stuartnelson3 pushed a commit that referenced this pull request Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants