-
Notifications
You must be signed in to change notification settings - Fork 50
Proposal: proxy-less mode #48
Description
This is a proposal for a new feature, so we can get an agreement before starting coding ;-)
The idea is to allow multiple implementations of the "metrics collector", with the default one still being the osiris auto-injected proxy, and with at least a new one: a prometheus-based metrics collector.
This new collector would collect metrics from an already existing prometheus endpoint exposed by the pod. It would need the following input:
- port exposed by the pod on which the prometheus endpoint is available
- path on which the prometheus metrics data is exposed. default to
/metrics - metrics names to collect. To be compliant with the current (and default) metrics collector, we would need 2 metrics: 1 for the opened connections, and another one for the closed connections.
This new feature will bring the following benefits:
- complete control over how a request is counted, ie no need to use the
ignoredPaths, and if needed requests can be ignored based on different input: user-agent, source IP, ... - allow the use of another tool that inject a transparent proxy as a sidecar container, like a service mesh.
- avoid the "cost" of the proxy, and the possible issues that could come from using it (Failed requests with Osiris proxy #45 for example...)
I was thinking about adding a new annotation on the deployments: osiris.deislabs.io/metricsCollector, using a JSON value - similar to what datadog is doing with https://docs.datadoghq.com/getting_started/integrations/prometheus/?tab=kubernetes :
metadata:
annotations:
osiris.deislabs.io/metricsCollector: |
{
"type": "prometheus",
"implementation": {
"port": "8080",
"path": "/metrics",
"metrics": {
"openedConnections": "http_req_new",
"closedConnections": "http_req_closed"
}
}
}
this JSON would have the following schema:
type: name of the collector implementation. default toosirisimplementation: a RawJSON that each implementation can use as they see fit.
we could also imagine moving theosiris.deislabs.io/metricsCheckIntervalannotation to acheckIntervalfield here - to avoid too many annotations.
what do you think ?