mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
docs: update statistic per tenant, add use cases section (#5892)
* docs: update statistic per tenant, add use cases section Signed-off-by: Artem Navoiev <tenmozes@gmail.com> * prettify Signed-off-by: Artem Navoiev <tenmozes@gmail.com> * Update docs/PerTenantStatistic.md --------- Signed-off-by: Artem Navoiev <tenmozes@gmail.com> Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
This commit is contained in:
parent
c6221c9046
commit
3328b09ae8
1 changed files with 40 additions and 18 deletions
|
@ -7,34 +7,29 @@ menu:
|
|||
parent: 'victoriametrics'
|
||||
weight: 31
|
||||
aliases:
|
||||
- /PerTenantStatistic.html
|
||||
- /PerTenantStatistic.html
|
||||
---
|
||||
|
||||
# VictoriaMetrics Cluster Per Tenant Statistic
|
||||
|
||||
***The per-tenant statistic is a part of [enterprise package](https://docs.victoriametrics.com/enterprise.html). It is available for download and evaluation at [releases page](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest). You need to request a [free trial license](https://victoriametrics.com/products/enterprise/trial/) for evaluation.***
|
||||
|
||||
<img alt="cluster-per-tenant-stat" src="PerTenantStatistic-stats.webp">
|
||||
|
||||
***The per-tenant statistic is a part of [enterprise package](https://docs.victoriametrics.com/enterprise.html). It is available for download and evaluation at [releases page](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest).
|
||||
To get the license key you can request a [free trial license](https://victoriametrics.com/products/enterprise/trial/).***
|
||||
|
||||
VictoriaMetrics cluster for enterprise provides various metrics and statistics usage per tenant:
|
||||
|
||||
- `vminsert`
|
||||
- `vm_tenant_inserted_rows_total` - total number of inserted rows. Find out which tenant
|
||||
puts the most of the pressure on the storage.
|
||||
`vminsert`:
|
||||
* `vm_tenant_inserted_rows_total` - total number of inserted rows. Find out which tenant puts the most of the pressure on the storage.
|
||||
|
||||
- `vmselect`
|
||||
- `vm_tenant_select_requests_duration_ms_total` - query latency.
|
||||
Helps to identify tenants with the heaviest queries.
|
||||
- `vm_tenant_select_requests_total` - total number of requests.
|
||||
Discover which tenant sends the most of the queries and how it changes with time.
|
||||
`vmselect`:
|
||||
* `vm_tenant_select_requests_duration_ms_total` - query latency. Helps to identify tenants with the heaviest queries.
|
||||
* `vm_tenant_select_requests_total` - total number of requests. Discover which tenant sends the most of the queries and how it changes with time.
|
||||
|
||||
- `vmstorage`
|
||||
- `vm_tenant_active_timeseries` - number of active time series.
|
||||
This metric correlates with memory usage, so can be used to find the most expensive
|
||||
tenant in terms of memory.
|
||||
- `vm_tenant_used_tenant_bytes` - disk space usage. Helps to track disk space usage
|
||||
per tenant.
|
||||
- `vm_tenant_timeseries_created_total` - number of new time series created. Helps to track
|
||||
`vmstorage`:
|
||||
* `vm_tenant_active_timeseries` - number of active time series. This metric correlates with memory usage, so can be used to find the most expensive tenant in terms of memory.
|
||||
* `vm_tenant_used_tenant_bytes` - disk space usage. Helps to track disk space usage per tenant.
|
||||
* `vm_tenant_timeseries_created_total` - number of new time series created. Helps to track
|
||||
the churn rate per tenant, or identify inefficient usage of the system.
|
||||
|
||||
Collect the metrics by any scrape agent you like (`vmagent`, `victoriametrics`, Prometheus, etc) and put into TSDB.
|
||||
|
@ -54,6 +49,33 @@ scrape_configs:
|
|||
## Visualization
|
||||
|
||||
Use [this dashboard](https://grafana.com/grafana/dashboards/16399) for visualizing per-tenant statistics in Grafana.
|
||||
It contains Statistic and Billing sections.
|
||||
|
||||
## Use cases
|
||||
|
||||
### Data distribution between tenants
|
||||
|
||||
Understand the impact of every tenant on VictoriaMetrics. You can visualize the current distribution of tenants and find the outliers. This statistic also helps define tenants that harm the database in emergencies at the exact time.
|
||||
|
||||
### Internal billing
|
||||
|
||||
When you provide VictoriaMetrics as a Platform for different organizations, teams or customers, you can create the billing based on statistics exposed by tenants.
|
||||
|
||||
The metrics cover:
|
||||
|
||||
* ingestion flow(vm_tenant_inserted_rows_total),
|
||||
* reading requests(vm_tenant_select_requests_duration_ms_total and vm_tenant_select_requests_total),
|
||||
* disk space usage(vm_tenant_used_tenant_bytes)
|
||||
* data distribution (vm_tenant_timeseries_created_total and vm_tenant_active_timeseries)
|
||||
* These four buckets provide complete information on the cost of every tenant.
|
||||
|
||||
Using the `/api/v1/query` endpoint, you can collect these metrics in your application to create a separate billing service.
|
||||
|
||||
Example of billing logic:
|
||||
1. Understand the cost of running VictoriaMetrics, calculate the percentage of every tenant and divide the cost between organizations/teams. This way is suitable for internal usage.
|
||||
1. Define the Unit ( for example, 1 unit equals 1k active timeseries, 1k new series over 24h, 1GB of disk space, 1k datapoints per second, etc.) and price per Unit. Collect the data from the `/api/v1/query` endpoint of existent usage and calculate the number of units the tenant uses. This way is suitable when you provide VictoriaMetrics for your customers and inside the organization or teams.
|
||||
|
||||
Check the Billing section of [Grafana Dashboard](#visualization), it contains billing section.
|
||||
|
||||
## Integration with vmgateway
|
||||
|
||||
|
|
Loading…
Reference in a new issue