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

Add proxy address information to the metrics #3081

Merged
merged 4 commits into from
Mar 7, 2024
Merged

Add proxy address information to the metrics #3081

merged 4 commits into from
Mar 7, 2024

Conversation

violetagg
Copy link
Member

Related to #3060

@violetagg violetagg added the type/enhancement A general enhancement label Mar 6, 2024
@violetagg violetagg requested a review from a team March 6, 2024 15:47
Copy link
Contributor

@pderop pderop left a comment

Choose a reason for hiding this comment

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

Apart from a few comments from javadocs, it looks okay to me.

@pderop
Copy link
Contributor

pderop commented Mar 6, 2024

I missed your last commit from df0415c, I'm rechecking ...

@pderop
Copy link
Contributor

pderop commented Mar 6, 2024

Violeta, can you please clarify the following:

Prior to the last commit (df0415c), the AbstractChannelMetricsHandler.channelRegistered method was like this:

	@Override
	public void channelRegistered(ChannelHandlerContext ctx) {
		if (!onServer) {
			ProxyHandler proxyHandler = ctx.pipeline().get(ProxyHandler.class);
			if (proxyHandler != null) {
				proxyAddress = proxyHandler.proxyAddress();
			}
                         ...

So, after the last commit, the method is now like this:

	@Override
	public void channelRegistered(ChannelHandlerContext ctx) {
		if (!onServer) {
			ChannelHandler proxyHandler = ctx.pipeline().get(NettyPipeline.ProxyHandler);
			if (proxyHandler != null) {
				proxyAddress = ((ProxyHandler) proxyHandler).proxyAddress();
			}
                 ...

Can you please tell the reason for the last commit?
Are there any cases where the ProxyHandler cannot be found using the ProxyHandler.class, like it was done prior to the last commit ?

@violetagg
Copy link
Member Author

Violeta, can you please clarify the following:

Prior to the last commit (df0415c), the AbstractChannelMetricsHandler.channelRegistered method was like this:

	@Override
	public void channelRegistered(ChannelHandlerContext ctx) {
		if (!onServer) {
			ProxyHandler proxyHandler = ctx.pipeline().get(ProxyHandler.class);
			if (proxyHandler != null) {
				proxyAddress = proxyHandler.proxyAddress();
			}
                         ...

So, after the last commit, the method is now like this:

	@Override
	public void channelRegistered(ChannelHandlerContext ctx) {
		if (!onServer) {
			ChannelHandler proxyHandler = ctx.pipeline().get(NettyPipeline.ProxyHandler);
			if (proxyHandler != null) {
				proxyAddress = ((ProxyHandler) proxyHandler).proxyAddress();
			}
                 ...

Can you please tell the reason for the last commit? Are there any cases where the ProxyHandler cannot be found using the ProxyHandler.class, like it was done prior to the last commit ?

I decided that it will be better to search for the ProxyHandler added by Reactor Netty and not just for some ProxyHandler in the pipeline.

@violetagg
Copy link
Member Author

@pderop Thanks for the review!

@violetagg violetagg added this to the 1.1.17 milestone Mar 7, 2024
@violetagg violetagg merged commit 1401280 into main Mar 7, 2024
14 checks passed
@violetagg violetagg deleted the issue-3060 branch March 7, 2024 08:52
violetagg added a commit that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants