In this commit, we add a mailbox-read-count metric. This will be
incremented each time a mailbox with an _odd_ stream ID is read from.
We do this because we assume that a full duplex connection is being used
meaning that there will be 2 streams that have a matching ID except for
the last byte. And so to avoid duplicating the data, we only record the
odd streams. We also assume that for every read, there will be a write
and so we only record the reads.
There's a race condition in the h2_bundle.go of go 1.16.10 and later. The
issue https://github.com/golang/go/issues/51799 mentions that this might
be fixed in go 1.19, so we'll need to wait for that.
We make sure we build our docker images with go 1.16.9 to not run into
the issue in the wild.
To avoid running into an issue in the race unit test with the Prometheus
histogram metrics that aren't concurrency safe, we don't register any of
them if Prometheus isn't enabled in the first place.
This shouldn't be an issue in production, since we don't start multiple
instances of Aperture _within the same process_ at the same time.
Set the ping and pong intervals of the websocket proxy to zero in order
to disable them. This is needed since a browser client is unable to
respond to these pings.
With this commit we fix a bug in the hashmail server that didn't return
a read stream properly if it was closed from the client side.
Co-authored-by: Elle Mouton <elle.mouton@gmail.com>
We want aperture to handle some of the incoming requests on its own,
without forwarding/proxying them to a remote backend. Those "local"
services can register themselves and will be given every request for
inspection. If a service decides to handle it locally, the request is
passed to that service and not forwarded.
Our yaml parsing is unaffected, but this change allows us to specify
these groups one param at a time. We do not update services because they
require special grouping, so we leave that as a json parameter.
This commit adds a DynamicPrice member to the Services struct and uses
its values to determine if a GRPCPricer or DefaultPricer should be
initialised. The commit also updates the sample-conf.yaml file with the
new config options.
This commit adds a new pricer package which contains a Pricer interface
and two implementations of the interface. The Pricer interface can be
used to query the price of a certain path. The two implementations are
as follows: a DefaultPricer which returns the same price for all paths
of a service, and a GRPCPricer which queries a backend grpc server for
the price of a given path.
This commit adds the proto definitions along with the generated proto
files for a prices service that can be used to request the price of a
specific path.