Changelog
List of aperture PRs merged since 2.15.0 release. For the full list of changes, see [list of changes][changes]
Revert "Added metrics for Flow Duration" (2635)
refactor rate limiter policy spec (2633)
add priorities to checkresponse (2629)
Fixed job name conflict in background scheduler when multiple policies are deployed (2627)
- Refactor: Updated the `background-scheduler.go` in the control plane
runtime to enhance job tracking. Now, each job is assigned a unique name
derived from the policy hash, improving the visibility and traceability
of individual jobs within the system. This change will not affect the
end-user experience but will significantly aid in system maintenance and
debugging processes.
global token bucket: delay filling when bucket has tokens (2626)
<img width="1399" alt="Screenshot 2023-09-14 at 5 02 48 PM"
src="https://github.com/fluxninja/aperture/assets/18579817/f10009bd-e226-4119-b568-b20f379382f1">
<img width="1400" alt="Screenshot 2023-09-14 at 5 02 34 PM"
src="https://github.com/fluxninja/aperture/assets/18579817/cb46078d-5f83-4725-90dc-9843f55f1cf3">
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Summary by CodeRabbit
- Bug Fix: Improved the functionality of the `GlobalTokenBucket` in the
rate-limiter package. The update introduces a mechanism to control token
generation based on the start fill time, preventing more tokens than the
fill rate in a given time window while using burst capacity.
- Documentation: Updated comments for the `bucket_capacity` field in the
`RateLimiter` component and the "Capacity of the bucket" parameter in
the configuration specification. The new descriptions provide better
clarity on how the capacity allows for bursty traffic and gives the
bucket a chance to empty out before filling starts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Added metrics for Flow Duration (2625)
![image](https://github.com/fluxninja/aperture/assets/34568645/91dddf1c-98f5-41a4-9d3a-4d5e72cf3625)
- New Feature: Added a new `FlowDurationMetricName` for grouping
durations of Check calls, enhancing the granularity of metrics.
- New Feature: Introduced a new panel in Grafana dashboard for
visualizing workload latency using the newly added
`FlowDurationMetricName`.
- Refactor: Updated the `metricsProcessor` struct to handle flow control
metrics separately, improving the efficiency of metrics processing.
- Test: Enhanced the test cases in `processor_test.go` to accommodate
the new flow duration metric, ensuring the robustness of the new
feature.
- Chore: Added a new method `GetFlowDurationSummary` across various
components (like `quotaScheduler`, `Factory`, `Scheduler`) for fetching
flow duration summary based on provided labels.
scheduler: provide remaining/current tokens back in check call (2620)
<img width="1392" alt="Screenshot 2023-09-13 at 10 35 55 PM"
src="https://github.com/fluxninja/aperture/assets/18579817/3c5aef8f-970c-4cc1-904e-8d1007b0eaa4">
<img width="1384" alt="Screenshot 2023-09-13 at 10 35 40 PM"
src="https://github.com/fluxninja/aperture/assets/18579817/f13dade6-63b6-40a9-83da-7b6109c1884d">
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Summary by CodeRabbit
- New Feature: Enhanced the `LimiterDecision` message in protobuf
definitions to include a nested `TokensInfo` message, providing more
detailed information about token consumption.
- Refactor: Updated various functions across multiple files to return
additional values related to token availability and wait time, improving
the granularity of operation details.
- Refactor: Modified the `Decide` function in several structs to return
a pointer to `flowcontrolv1.LimiterDecision`, simplifying the code and
improving consistency.
- Test: Adjusted the duration of stages in the load generator test
script, affecting the target number of virtual users for these stages.
- Chore: Renamed and updated the `updateMetricsAndReturnDecision` method
in the `WFQScheduler` struct to return additional values, enhancing
metrics tracking.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Fixed aperturectl cloud command addition (2619)
- New Feature: Added two new commands to the `aperturectl` CLI tool,
`apply.ApplyCmd` and `delete.DeleteCmd`, enhancing user control over
policy application and resource deletion in the Cloud Controller.
- Documentation: Updated and added comprehensive documentation for the
new commands, including usage examples and options. Renamed `aperturectl
cloud policy` to `aperturectl cloud apply policy` for clarity and
consistency.
- User Impact: These changes provide users with more precise command
options for managing Aperture policies, improving usability and
efficiency of the `aperturectl` tool.
Added cloud sub-command for policy apply and delete (2618)
- Added new `aperturectl cloud` sub-command for policy apply and delete.
We will still keep the older way for a release so that the cloud gets
updated in the mean time.
- Created new proto for the cloud cmd services which will be used in the
cloud
- We will eventually migrate all the cloud controller sub-commands like
`preview` etc to this and have a clear separation between OSS and Cloud
- New Feature: Added `ApplyPolicyCmd` and `DeletePolicyCmd` commands to
the `aperturectl` CLI tool for managing Aperture policies on the Cloud
Controller.
- New Feature: Introduced a terminal user interface (TUI) for selecting
which policies to apply from a directory.
- Refactor: Moved policy-related functionality to a new `utils` package,
improving modularity and maintainability.
- Documentation: Added comprehensive documentation for the new "cloud"
command in the `aperturectl` CLI tool, including usage examples and
options.
- Chore: Updated protocol buffer definitions for communication between
`aperturectl` and the cloud controller.
Make logging in FX apps structured (2616)
Description of change
Checklist
- [x] Tested in playground or other setup
- [ ] Screenshot (Grafana) from playground added to PR for 15+ minute
run
- [ ] Documentation is changed or added
- [ ] Tests and/or benchmarks are included
- [ ] Breaking changes
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Summary by CodeRabbit
"Refactor: Enhanced Logging Mechanism"
- The update introduces a more robust and configurable logging system
using `go.uber.org/zap`.
- This change allows for better tracking of application events, aiding
in debugging and monitoring.
- The new logger is integrated with the FX application via
`fx.WithLogger()`, ensuring consistent logging across all components.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
token bucket: allow 0 capacity buckets (2617)
0 capacity buckets should be allowed, and there is no reason in the code
that this leads to any issues.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Summary by CodeRabbit
- New Feature: Added logging for request deadline and timeout in
`cmd/sdk-validator/validator/flowcontrol.go` to improve debugging
capabilities.
- Refactor: Simplified the logic in
`pkg/rate-limiter/global-token-bucket/global-token-bucket.go` by
removing unnecessary check for bucket capacity, enhancing code
readability and maintainability.
- New Feature: Increased the timeout for requests made by the
`ApertureClient` in `sdks/aperture-js/example/routes/use_aperture.ts`,
improving user experience during network latency.
- Style: Improved code readability in `sdks/aperture-js/sdk/client.ts`
by reformatting import statements and overall code structure.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Revert "Set log timestamp format to include nanoseconds (2614)" (2615)
This reverts commit d6547ee1cd90b4339b95ac5b0e739ce68e7a1bfd.
Unfortunately this breaks log format in LogsExplorer in gcloud.
Set log timestamp format to include nanoseconds (2614)
- Refactor: Updated the global logger instance to use `time.RFC3339Nano`
for more precise timestamp logging.
- Refactor: Enhanced the `zerolog.ErrorStackMarshaler` and
`zerolog.CallerMarshalFunc` functions for improved error tracking and
caller information.
Spec: rename priority label key (2611)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Summary by CodeRabbit
- Refactor: Renamed `priorities_label_key` to `priority_label_key` in
the `Scheduler` message definition and updated all references in the
codebase.
- Refactor: Simplified the `Decide` function in the `Scheduler` struct
by removing unnecessary variables and updating label checks.
- Refactor: Improved code readability in `client.ts` by reformatting
imports, using destructuring and shorthand syntax, and extracting
callback functions.
- Change: Updated the default value of `timeoutMilliseconds` parameter
in the constructor from 200 to 0 in `client.ts`.
- Refactor: Simplified request object creation and gRPC parameters in
`client.ts`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Use buf's central proto and grpc packages instead of copying them over in sdk (2607)
Description of change
Checklist
- [ ] Tested in playground or other setup
- [ ] Screenshot (Grafana) from playground added to PR for 15+ minute
run
- [ ] Documentation is changed or added
- [ ] Tests and/or benchmarks are included
- [ ] Breaking changes
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Summary by CodeRabbit
**Release Notes:**
- **Refactor**: Updated the build process and SDK generation in
`api/Makefile`. Now supports Java, JavaScript, and Python SDKs.
- **New Feature**: Introduced new packages and updated existing ones in
`cmd/sdk-validator/main.go` to enhance functionality and improve code
organization.
- **Refactor**: Updated import paths and data structures in
`sdks/aperture-go/sdk/client.go`, `sdks/aperture-go/sdk/flow.go`,
`sdks/aperture-go/sdk/httpflow.go`,
`sdks/aperture-go/sdk/middleware/grpc.go`,
`sdks/aperture-go/sdk/middleware/utils.go` for better compatibility with
new package paths.
- **Style**: Improved readability of function signatures in
`cmd/sdk-validator/validator/common.go`.
- **Chore**: Renamed "middlewares" package to "middleware" in
`sdks/aperture-go/sdk/middleware/http.go` for consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
aperturectl: Fail early on unsupported commands with Cloud Controller (2606)
Make default GRPC server name not empty (2589)
Description of change
Having the name of default GRPC Server empty messed up the fx tags. As
we use `group:<server_name>` tags, fx read this as no group tag at all
as it was empty. Trying to bring up another GRPC server with a name
resulted in an error that groups can't be optional.
This is breaking change for someone using this as a library. It won't
affect anyone else.
Checklist
- [ ] Tested in playground or other setup
- [ ] Screenshot (Grafana) from playground added to PR for 15+ minute
run
- [x] Breaking changes (only for library users)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
Summary by CodeRabbit
- Refactor: Introduced new struct types to bundle and annotate
parameters for various functions across multiple packages. This change
improves code modularity, readability, and maintainability.
- Refactor: Updated the `ServerModule` and `GMuxServerModule` functions
in `pkg/net/grpc/server.go` to improve configurability and consistency.
- Chore: Removed unnecessary imports and reorganized code in
`cmd/aperture-agent/agent/otel-component.go` and
`test/aperture_suite_test.go`.
These changes do not introduce any new features or bug fixes, but they
significantly enhance the code quality and maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Hardik Shingala <34568645+hdkshingalausers.noreply.github.com>
Co-authored-by: Hardik Shingala <hardik.shingalafluxninja.com>
[changes]: https://github.com/fluxninja/aperture/compare/releases/aperture-controller/v2.15.0...releases/aperture-controller/v2.16.0