You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,6 +184,7 @@ The following table lists the supported annotations for Kubernetes `Deployments`
184
184
|`osiris.dm.gg/enabled`| Enable the zeroscaler component to scrape and analyze metrics from the deployment's or statefulSet's pods and scale the deployment/statefulSet to zero when idle. Allowed values: `y`, `yes`, `true`, `on`, `1`. |_no value_ (= disabled) |
185
185
|`osiris.dm.gg/minReplicas`| The minimum number of replicas to set on the deployment/statefulSet when Osiris will scale up. If you set `2`, Osiris will scale the deployment/statefulSet from `0` to `2` replicas directly. Osiris won't collect metrics from deployments/statefulSets which have more than `minReplicas` replicas - to avoid useless collections of metrics. |`1`|
186
186
|`osiris.dm.gg/metricsCheckInterval`| The interval in which Osiris would repeatedly track the pod http request metrics. The value is the number of seconds of the interval. Note that this value override the global value defined by the `zeroscaler.metricsCheckInterval` Helm value. |_value of the `zeroscaler.metricsCheckInterval` Helm value_|
187
+
|`osiris.dm.gg/metricsCollector`| Configure the collection of metrics for a pod. The value is a JSON object with at least a `type` string, and an optional `implementation` object. See the *Metrics Scraping* section for more. |`{ "type": "osiris" }`|
187
188
188
189
#### Pod Annotations
189
190
@@ -210,6 +211,40 @@ The following table lists the supported annotations for Kubernetes `Services` an
210
211
211
212
Note that you might see an `osiris.dm.gg/selector` annotation - this is for internal use only, and you shouldn't try to set/update or delete it.
212
213
214
+
#### Metrics Scraping Configuration
215
+
216
+
Scraping the metrics from the pods is done automatically using Osiris provided sidecar container by default. But if you don't want to use the auto-injected sidecar container, you can also configure a custom metrics scraper, using the `osiris.dm.gg/metricsCollector` annotation on your deployment/statefulset.
217
+
218
+
The following scrapers are supported:
219
+
220
+
**osiris**
221
+
222
+
This is the default scraper, which doesn't need any configuration.
223
+
224
+
**prometheus**
225
+
226
+
The prometheus scraper retrieves metrics about the request count from your own prometheus endpoint. To use it, your application need to expose an endpoint with metrics in the prometheus format.
227
+
You can then set the following annotation:
228
+
229
+
```
230
+
annotations:
231
+
osiris.dm.gg/metricsCollector: |
232
+
{
233
+
"type": "prometheus",
234
+
"implementation": {
235
+
"port": 8080,
236
+
"path": "/metrics",
237
+
"requestCountMetricName": "requests"
238
+
}
239
+
}
240
+
```
241
+
242
+
The schema of the prometheus implementation configuration is:
243
+
- a mandatory `port` integer
244
+
- an optional `path` string - default to `/metrics` if not set
245
+
- a mandatory `requestCountMetricName` string, for the name of the metric that expose the number of requests
246
+
- an optional `requestCountMetricLabels` object, for all labels that should match the metric for request count
0 commit comments