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

UuidRequestIdConfig Builder #185

Open
matiasrege opened this issue Nov 9, 2021 · 3 comments
Open

UuidRequestIdConfig Builder #185

matiasrege opened this issue Nov 9, 2021 · 3 comments

Comments

@matiasrege
Copy link

We need to be able to set the configuration pack_trace_reason of UuidRequestIdConfig and we didn't find the specific builder.

we try to do this:

HttpConnectionManager.Builder builder = HttpConnectionManager.newBuilder();

builder.setRequestIdExtension(RequestIDExtension.newBuilder()
        .setTypedConfig(Any.pack(TypedStruct.newBuilder()
                .setTypeUrl("type.googleapis.com/envoy.extensions.request_id.uuid.v3.UuidRequestIdConfig")
                .setValue(Struct.newBuilder()
                        .putFields("pack_trace_reason", Value.newBuilder()
                                .setBoolValue(false)
                                .build())
                        .build())
        .build())));

but this create this configuration in envoy:

"request_id_extension": {
	"typed_config": {
	"@type": "type.googleapis.com/udpa.type.v1.TypedStruct",
	"type_url": "type.googleapis.com/envoy.extensions.request_id.uuid.v3.UuidRequestIdConfig",
	"value": {
		"pack_trace_reason": false
		}
	}
}

With this error:

Didn't find a registered implementation for type: 'udpa.type.v1.TypedStruct'

Sorry for the very basic question, but what would be the correct way to configure UuidRequestIdConfig without having a builder?

@sschepens
Copy link
Contributor

Try this:

builder.setRequestIdExtension(RequestIDExtension.newBuilder()
        .setTypedConfig(Any.newBuilder()
                .setTypeUrl("type.googleapis.com/envoy.extensions.request_id.uuid.v3.UuidRequestIdConfig")
                .setValue(Struct.newBuilder()
                        .putFields("pack_trace_reason", Value.newBuilder()
                                .setBoolValue(false)
                                .build())
                        .build()
                        .toByteString())
        .build()));

This is sort of a hack, I think the real issue is that our Protos our outdated.

@slonka
Copy link
Member

slonka commented Nov 11, 2021

I'm working on making the process of protobuf update automatic. I'll have a PR ready probably later today so we're done with those type of issues once and for all 😊

@matiasrege
Copy link
Author

Thanks @slonka!, I builder the jar with #184 and I already have the builder.

We will wait for the new version ;).

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

No branches or pull requests

3 participants