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 feature tracking for cbor protocol #2821

Merged
merged 2 commits into from
Oct 8, 2024
Merged

add feature tracking for cbor protocol #2821

merged 2 commits into from
Oct 8, 2024

Conversation

lucix-aws
Copy link
Contributor

Add feature metrics tracking for CBOR clients. Not actually used by any service right now, but you can see the codegen results in the cbor protocol test.

@lucix-aws lucix-aws requested a review from a team as a code owner October 4, 2024 19:07
).compose());
}

private static final class Feature {
Copy link
Contributor

Choose a reason for hiding this comment

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

While this is named Feature it's really only for CBOR metrics due to the getAddMiddleware(). We should either make the CBOR metrics extend from this or rename this

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 about the getAddMiddleware constrains it to CBOR? The feature ID variant is passed in.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, my point is that the class name is generic but the functionality is not, so we should either make it generic or name it accordingly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The functionality of Feature is generic though - it's just that CBOR is the only thing using it. You could add any other static feature to the FEATURES list in the future.

e.g.

    private static final List<Feature> FEATURES = List.of(
           new Feature("ProtocolRPCV2CBOR", (model, service) -> service.hasTrait(Rpcv2CborTrait.class)),
           new Feature("ProtocolSparrowhawk", (model, service) -> etc())
    );

Copy link
Contributor

Choose a reason for hiding this comment

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

OK I'm dumb, I kept reading the functionality of getAddMiddleware as specific to CBOR since the code always calls the same middleware, but this is exactly what we want since this middleware is generic

Copy link
Contributor

@Madrigal Madrigal left a comment

Choose a reason for hiding this comment

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

We're missing a changelog (should we add automation to check this?)

@lucix-aws
Copy link
Contributor Author

We're missing a changelog (should we add automation to check this?)

I left a changelog out because it doesn't actually have any effect on released source. A changelog at the root module here would have just meant a new root module => service module churn because everything has to update to pull it in.

@Madrigal
Copy link
Contributor

Madrigal commented Oct 7, 2024

Only comment that we'll discuss

I left a changelog out because it doesn't actually have any effect on released source. A changelog at the root module here would have just meant a new root module => service module churn because everything has to update to pull it in.

I don't think our automation can handle a no changelog change IIRC

@lucix-aws lucix-aws merged commit 5a4e5bb into main Oct 8, 2024
12 checks passed
@lucix-aws lucix-aws deleted the feat-useragentcbor branch October 8, 2024 15:44
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.

2 participants