Skip to content

Added support for HTTP/2 metrics to Netty. #1885

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

Merged
merged 1 commit into from
Jun 11, 2020

Conversation

millems
Copy link
Contributor

@millems millems commented Jun 9, 2020

Updated existing HTTP metrics to specify that they are "concurrency", not "connections". For HTTP/2, we can't calculate the maximum number of connections, and concurrency is more useful to customers anyway.

Fixed the AVAILABLE_CONCURRENCY in Netty to actually be the number of established but idle concurrency, not the difference between max concurrency and leased concurrency.

@millems millems force-pushed the millem/netty-http2-metrics branch from a6fe007 to 804e7bb Compare June 9, 2020 21:31
Updated existing HTTP metrics to specify that they are "concurrency", not "connections". For HTTP/2, we can't calculate the maximum number of connections, and concurrency is more useful to customers anyway.

Fixed the AVAILABLE_CONCURRENCY in Netty to actually be the number of established but idle concurrency, not the difference between max concurrency and leased concurrency.
@millems millems force-pushed the millem/netty-http2-metrics branch from 804e7bb to cf8eccb Compare June 10, 2020 00:19
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

84.0% 84.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.
Read more here

*/
public static final SdkMetric<Integer> MAX_CONNECTIONS = metric("MaxConnections", Integer.class);
public static final SdkMetric<Integer> MAX_CONCURRENCY = metric("MaxConcurrency", Integer.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like for h2 operations, all metrics here are for streams, should we add metrics for connections?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely confident that it's particularly useful to do so, but it wouldn't be difficult. Maybe we do it if we find it's needed? I'm worried about confusing people if we expose both.

Copy link
Contributor

@zoewangg zoewangg Jun 11, 2020

Choose a reason for hiding this comment

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

I think leasedConnection and availableConnection will provide helpful insights when we troubleshoot async issues. For example, in the past, we spent a lot of time searching logs and found out the streams are not balanced allocated across all connections. It'd save us time if we have such metrics available. That would require us to map connection metric with stream metric though.

* The idle channel state for a specific channel. This should only be accessed from the {@link #executor}.
*/
private static final AttributeKey<ChannelIdleState> CHANNEL_STATE =
AttributeKey.newInstance("IdleConnectionCountingChannelPool.CHANNEL_STATE");
Copy link
Contributor

Choose a reason for hiding this comment

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

should we namespace the key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant prefixing it with sdk namespace so it doesn't conflict with other keys. It seems we are using NettyUtils.getOrCreateAttributeKey now introduced in #1887

@millems millems merged commit 9032023 into sdk-metrics-development-2 Jun 11, 2020
aws-sdk-java-automation pushed a commit that referenced this pull request Jan 4, 2022
…76c5829c3

Pull request: release <- staging/9c3d9fb0-6453-4ef9-bb51-b1a76c5829c3
@millems millems deleted the millem/netty-http2-metrics branch October 19, 2022 19:37
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.

3 participants