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

feat: propagate newrelic tx info by using fiber.Ctx and little refact… #768

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

Abdulsametileri
Copy link
Contributor

In order to create segments we need to pass created new relic transaction using fiber.Ctx to the chain.

@github-actions github-actions bot added the ✏️ Feature New feature or request label Sep 13, 2023
@ReneWerner87
Copy link
Member

@mstrYoda can you review

@mstrYoda
Copy link
Member

It seems ok to me 👍 I talked with the author, he will add a benchmark test to see if allocation count increased or not 👍

@Abdulsametileri
Copy link
Contributor Author

Here the benchmark results

go test -bench='.' -benchtime='3s' -benchmem                                                                    ✔  9s10:30:52 
goos: darwin
goarch: arm64
pkg: github.com/gofiber/contrib/fibernewrelic
BenchmarkNew-10           297830             10180 ns/op            7770 B/op         45 allocs/op
BenchmarkOld-10           362887              9865 ns/op            7695 B/op         45 allocs/op
PASS
ok      github.com/gofiber/contrib/fibernewrelic        10.122s

allocation is OK!

ns/op increased because we added newrelic transaction c.SetUserContext(newrelic.NewContext(c.UserContext(), txn))

@mstrYoda mstrYoda merged commit e6b6de0 into gofiber:main Sep 13, 2023
11 checks passed
@mstrYoda
Copy link
Member

Thank you for your contribution @Abdulsametileri 🙏

@Abdulsametileri
Copy link
Contributor Author

Hello @ReneWerner87, is it possible to create a new release for the fibernewrelic package? 🤔

@ReneWerner87
Copy link
Member

https://github.com/gofiber/contrib/releases/tag/fibernewrelic%2Fv1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants