| Crates.io | miffy |
| lib.rs | miffy |
| version | 1.0.1 |
| created_at | 2025-04-01 13:53:21.116667+00 |
| updated_at | 2025-05-19 14:47:52.107733+00 |
| description | A shadow-testing proxy: Send requests to a "reference" implementation, send the request to a "candidate" implementation, always respond with the "reference" implementation and log/publish both responses if they are not equal. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1614896 |
| size | 132,306 |
My diffy.
A shadow-testing proxy: Send requests to a "reference" implementation, send the request to a "candidate" implementation, always respond with the "reference" implementation and log/publish both responses if they are not equal.
Required tools:
Native libraries (required for rdakafka)
libssl-devlibsasl2-devconfig.sample.toml to config.tomlcargo run --example demo. This will start two servers listening to
localhost:3000 (the
reference) and localhost:3001 (the candidate) with one endpoint: /api/{value}.docker-compose up -dcargo run.curl http://localhost:8080/api/3curl http://localhost:8080kcat -b localhost:9092 -e -t miffyMiffy looks for a file config.toml in it's working-directory, but you can point to a specific file
via MIFFY_CONFIG-env-var.
config.sample.toml to config.toml.config.default.toml for an explanation of different values and defaults.MIFFY_.Miffy uses rdkafka internally and allows to set all
its properties, in
config.toml section
[kafka].
Since those values typically need to be set via environment variable (e.g. password for kafka,
sasl.password), they
may be set/overriden via KAFKA_SASL_PASSWORD etc.
Miffy provides a separate management-port (default: 9000).
Currently, only a health-endpoint /healthz is available.
Sometimes services need to know if they take part in shadow-testing and also which role they play. E.g. "candidates" could still run in some dry-run mode where they not execute any side effects etc.
Miffy therefore always sends a header name X-Shadow-Test-Role:
candidate — the service is the candidate for the current requestreference — the service is the reference for the current requestupstream — there is no experiment configured for the current request/route, so the service is just used as upstreamApart from that, miffy does not touch/change/add/remove any headers.
To estimate the rough overhead added by miffy, there are just recipes to run wrk.
ulimit -n 8182cargo run --example demo --releasedocker-compose up -dulimit -n 8182RUST_LOG=warn cargo run --release.just benchLicensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.