Skip to content

feat: traffic mirroring api #219

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 2 commits into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: metaprotocol.aeraki.io.v1alpha1
layout: protoc-gen-docs
generator: protoc-gen-docs
number_of_entries: 15
number_of_entries: 16
---
<p>$schema: metaprotocol.aeraki.io.v1alpha1.ApplicationProtocol
$title: Application Protocol
Expand Down Expand Up @@ -154,6 +154,28 @@ <h2 id="MetaRoute">MetaRoute</h2>
beginning of document). Weights associated with the service version
determine the proportion of traffic it receives.</p>

</td>
<td>
No
</td>
</tr>
<tr id="MetaRoute-mirror">
<td><code>mirror</code></td>
<td><code><a href="#Destination">Destination</a></code></td>
<td>
</td>
<td>
No
</td>
</tr>
<tr id="MetaRoute-mirror_percentage">
<td><code>mirrorPercentage</code></td>
<td><code><a href="#Percent">Percent</a></code></td>
<td>
<p>Percentage of the traffic to be mirrored by the <code>mirror</code> field.
If this field is absent, all the traffic (100%) will be mirrored.
Max value is 100.</p>

</td>
<td>
No
Expand Down Expand Up @@ -571,6 +593,32 @@ <h2 id="GlobalRateLimit">GlobalRateLimit</h2>
</tbody>
</table>
</section>
<h2 id="Percent">Percent</h2>
<section>
<p>Percent specifies a percentage in the range of [0.0, 100.0].</p>

<table class="message-fields">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<tr id="Percent-value">
<td><code>value</code></td>
<td><code>double</code></td>
<td>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</section>
<h2 id="LocalRateLimit-TokenBucket">LocalRateLimit.TokenBucket</h2>
<section>
<p>Configures a token bucket which is used for rate limiting.</p>
Expand Down
421 changes: 355 additions & 66 deletions api/metaprotocol/v1alpha1/metaprotocol_metarouter.pb.go

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions api/metaprotocol/v1alpha1/metaprotocol_metarouter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ message MetaRoute {

//MetaFaultInjection fault = 4;

//MetaDestination mirror = 5;
Destination mirror = 5;

// Percentage of the traffic to be mirrored by the `mirror` field.
// If this field is absent, all the traffic (100%) will be mirrored.
// Max value is 100.
// Percent mirror_percentage = 6;
Percent mirror_percentage = 6;

// Specifies a list of key-value pairs that should be mutated for each request. How to interpret the key-value pairs
// depends on the codec implementation
Expand Down Expand Up @@ -295,4 +295,9 @@ message GlobalRateLimit {

// Defines what properties in the requests should be sent to the rate limit service
repeated GlobalRateLimit.Descriptor descriptors = 6 [(google.api.field_behavior) = REQUIRED];
}

// Percent specifies a percentage in the range of [0.0, 100.0].
message Percent {
double value = 1;
}
21 changes: 21 additions & 0 deletions api/metaprotocol/v1alpha1/metaprotocol_metarouter_deepcopy.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions api/metaprotocol/v1alpha1/metaprotocol_metarouter_json.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions crd/kubernetes/customresourcedefinitions.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,32 @@ spec:
attribute is specified, presence of the attribute is checked.
type: object
type: object
mirror:
properties:
host:
description: The name of a service from the service registry.
format: string
type: string
port:
description: Specifies the port on the host that is being
addressed.
properties:
number:
type: integer
type: object
subset:
description: The name of a subset within the service.
format: string
type: string
type: object
mirrorPercentage:
description: Percentage of the traffic to be mirrored by the
`mirror` field.
properties:
value:
format: double
type: number
type: object
name:
description: The name assigned to the route for debugging purposes.
format: string
Expand Down
26 changes: 26 additions & 0 deletions k8s/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,32 @@ spec:
attribute is specified, presence of the attribute is checked.
type: object
type: object
mirror:
properties:
host:
description: The name of a service from the service registry.
format: string
type: string
port:
description: Specifies the port on the host that is being
addressed.
properties:
number:
type: integer
type: object
subset:
description: The name of a subset within the service.
format: string
type: string
type: object
mirrorPercentage:
description: Percentage of the traffic to be mirrored by the
`mirror` field.
properties:
value:
format: double
type: number
type: object
name:
description: The name assigned to the route for debugging purposes.
format: string
Expand Down