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

Support sending metadata in grpc task #1405

Closed
kalantar opened this issue Feb 20, 2023 · 3 comments
Closed

Support sending metadata in grpc task #1405

kalantar opened this issue Feb 20, 2023 · 3 comments

Comments

@kalantar
Copy link
Member

Is your feature request related to a problem? Please describe.
In addition to the message, (meta)data can be passed to a grpc endpoint via headers in the request. In grpcurl, this is expressed using the -H option.

Iter8's grpc task should also support sending metadata as well.

Describe the solution you'd like
The grpc task is implemented using ghz. It supports the following options:

 -m, --metadata=                Request metadata as stringified JSON.
 -M, --metadata-file=           File path for call metadata JSON file. Examples: /home/user/metadata.json or ./metadata.json.
@sriumcp
Copy link
Member

sriumcp commented Feb 20, 2023

Currently, there are two ways to do this in the gRPC task.

  1. Use a metadataURL. For instance, the URL can respond with the JSON metadata. This is already documented in the task description.
  2. The task description also says that any field in the Config struct of ghz can be used as input to the task. This means, today, we can do ...
--set grpc.metadata.x=y --set grpc.metadata.a=b

which would lead to the following metadata being passed:

{
"a": "b",
"x": "y"
}

Perhaps the documentation is not clear and must be improved in some way? If so, how?

@sriumcp
Copy link
Member

sriumcp commented Feb 20, 2023

Incidentally, I just noticed the following docs bug ...

In the usage example, the parameters host and call correspond to the Call and Host fields respectively in the Config struct.

They should be the other way around.

@kalantar
Copy link
Member Author

I was just rereading the doc and was about to close this issue :). Let's ask that the required change be made as part of PR iter8-tools/docs#64

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

2 participants