-
Notifications
You must be signed in to change notification settings - Fork 90
Examples: a place to stash practical use cases #637
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
Conversation
This captures something I used and for which I had to dig a bit in the codebase to get it set up. Stashing it here may help others and lower the bar for consumption. I anticipate there may be more examples like this that we could add over time. So ideally this PR will be assessed both on structure of the initiative (/examples) and contents (MULTIPLE_ENDPOINTS.md) Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
examples/MULTIPLE_ENDPOINTS.md
Outdated
|
||
## Configuring the CLI | ||
|
||
Below is a CLI examples which will consume the traffic profile created above, and send it to multiple endpoints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example - shouldn't be plural here
examples/MULTIPLE_ENDPOINTS.md
Outdated
|
||
## Description | ||
|
||
Below is an example which will send requests to two endpoints `127.0.0.1:80` and `127.0.0.2:80`, while alternating over two request headers, which contain different paths and hosts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend making explicit references to what features are being illustrated here. Examples of features being illustrated: multi-target, request source, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, importantly this isn't using request source generally, it's using the file based request source specifically
examples/MULTIPLE_ENDPOINTS.md
Outdated
|
||
Below is an example which will send requests to two endpoints `127.0.0.1:80` and `127.0.0.2:80`, while alternating over two request headers, which contain different paths and hosts. | ||
|
||
## Define a traffic profile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm mistaken you've created this term traffic profile here, and it is not used elsewhere. The way you've structured this makes it look like traffic profile is a broader nighthawk term in a way that I think is misleading.
Could we instead discuss it like:
Place a file called traffic-profile.yaml
in your current working directory. This will act as your configuration for the file-based request source.
@dubious90 thanks for the review, you raise some good points. Also, looking at this again, I wonder if it would be better to move |
This change sounds good to me. |
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
I addressed feedback in e83f615, added a little more polish & moved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, sorry for my delay on this. For some reason, I thought I had already replied to this.
This looks good modulo one typo
This example illustrates the following features: | ||
|
||
- [Request Source](https://github.com/envoyproxy/nighthawk/blob/261abb62c40afbdebb317f320fe67f1a1da1838f/api/request_source/request_source_plugin.proto#L15) (specifically the file-based implementation). | ||
- [Multi-targetting](https://github.com/envoyproxy/nighthawk/blob/261abb62c40afbdebb317f320fe67f1a1da1838f/api/client/options.proto#L84) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp: targeting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amended in baf7a5e
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
This captures something I used and for which I had to dig a bit in
the codebase to get it set up. Stashing it here may help others and
lower the bar for consumption.
I anticipate there may be more examples like this that we could
add over time. So ideally this PR will be assessed both on structure
of the initiative (/examples) and contents (MULTIPLE_ENDPOINTS.md)
Signed-off-by: Otto van der Schaaf ovanders@redhat.com