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

[internal/rabbitmq] move connection and retry logic into separate pkg #34361

Merged
merged 12 commits into from
Aug 14, 2024

Conversation

frzifus
Copy link
Member

@frzifus frzifus commented Jul 31, 2024

Description:

This PR moves the retry logic from amqp publisher to amqp connection. Connection, client and other utility structures have been moved from exporter/rabbitmqexporter/internal/publisher to internal/rabbitmq.

Link to tracking Issue:

Testing:

Documentation:


cc @swar8080 @atoulme

@frzifus frzifus added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jul 31, 2024
@frzifus frzifus force-pushed the internal_rabbitmq branch 4 times, most recently from cabf4a8 to 730f926 Compare August 1, 2024 02:18
frzifus added 5 commits August 1, 2024 04:31
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
@frzifus frzifus force-pushed the internal_rabbitmq branch from 730f926 to 55d0786 Compare August 1, 2024 02:32
@frzifus frzifus marked this pull request as ready for review August 1, 2024 02:32
@frzifus frzifus requested a review from atoulme as a code owner August 1, 2024 02:32
@frzifus frzifus requested a review from a team August 1, 2024 02:32
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
Copy link
Contributor

@swar8080 swar8080 left a comment

Choose a reason for hiding this comment

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

looks good! just added a couple minor comments

@@ -307,15 +316,20 @@ type mockConnection struct {
mock.Mock
}

func (m *mockConnection) ReconnectIfUnhealthy() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like there's no longer unit test coverage for the actual implementation of this method? might be worth adding a unit test for it in the internal package

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree. I added a test in the internal/rabbitmq pkg.

"time"

amqp "github.com/rabbitmq/amqp091-go"
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/rabbitmq"
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it's worth aliasing this import so its clearer when skimming the code that rabbitmq refers to an otel-contrib package and not the external rabbitmq client library

Copy link
Contributor

Choose a reason for hiding this comment

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

otelrabbitmq?

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it 👍

frzifus added 3 commits August 1, 2024 20:58
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
@frzifus frzifus requested a review from swar8080 August 1, 2024 19:05
Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

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

LGTM. @atoulme, do mind taking a look when you get a chance?

Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

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

LGTM!

@frzifus
Copy link
Member Author

frzifus commented Aug 13, 2024

FTR: just resolved merge conflicts in the go.mod files.

Resolve conflicts in go.mod

Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
@frzifus frzifus force-pushed the internal_rabbitmq branch from 78cc97d to af259d8 Compare August 13, 2024 08:53
internal/rabbitmq/go.mod Outdated Show resolved Hide resolved
@codeboten codeboten merged commit 6f2d3b1 into open-telemetry:main Aug 14, 2024
155 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 14, 2024
@frzifus frzifus deleted the internal_rabbitmq branch August 14, 2024 17:52
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
…open-telemetry#34361)

This PR moves the retry logic from amqp publisher to amqp connection.
Connection, client and other utility structures have been moved from
`exporter/rabbitmqexporter/internal/publisher` to `internal/rabbitmq`.

**Link to tracking Issue:** open-telemetry#34242


----

cc @swar8080 @atoulme

---------

Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/otelcontribcol otelcontribcol command exporter/rabbitmq Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants