2024-02-20 15:20:57 +01:00
---
sort: 1
weight: 1
title: VictoriaMetrics Anomaly Detection Quick Start
menu:
docs:
parent: "anomaly-detection"
weight: 1
title: Quick Start
aliases:
- /anomaly-detection/QuickStart.html
---
# VictoriaMetrics Anomaly Detection Quick Start
2024-02-20 16:19:18 +01:00
For service introduction visit [README ](/anomaly-detection/ ) page
and [Overview ](/anomaly-detection/overview.html ) of how `vmanomaly` works.
2024-02-20 15:20:57 +01:00
2024-04-01 15:41:55 +02:00
## How to install and run vmanomaly
2024-02-20 15:20:57 +01:00
2024-04-01 15:41:55 +02:00
> To run `vmanomaly`, you need to have VictoriaMetrics Enterprise license. You can get a trial license key [**here**](https://victoriametrics.com/products/enterprise/trial/).
2024-02-20 15:20:57 +01:00
The following options are available:
2024-04-01 15:41:55 +02:00
- [To run Docker image ](#docker )
- [To run in Kubernetes with Helm charts ](#kubernetes-with-helm-charts )
2024-02-20 15:20:57 +01:00
### Docker
2024-04-01 15:41:55 +02:00
> To run `vmanomaly`, you need to have VictoriaMetrics Enterprise license. You can get a trial license key [**here**](https://victoriametrics.com/products/enterprise/trial/).
2024-02-20 15:20:57 +01:00
Below are the steps to get `vmanomaly` up and running inside a Docker container:
1. Pull Docker image:
```sh
docker pull victoriametrics/vmanomaly:latest
```
2. (Optional step) tag the `vmanomaly` Docker image:
```sh
docker image tag victoriametrics/vmanomaly:latest vmanomaly
```
3. Start the `vmanomaly` Docker container with a *license file* , use the command below.
**Make sure to replace `YOUR_LICENSE_FILE_PATH` , and `YOUR_CONFIG_FILE_PATH` with your specific details**:
```sh
export YOUR_LICENSE_FILE_PATH=path/to/license/file
export YOUR_CONFIG_FILE_PATH=path/to/config/file
docker run -it -v $YOUR_LICENSE_FILE_PATH:/license \
-v $YOUR_CONFIG_FILE_PATH:/config.yml \
vmanomaly /config.yml \
--license-file=/license
```
See also:
2024-02-20 16:19:18 +01:00
- You can verify licence online and offline. See the details [here ](/anomaly-detection/overview/#licensing ).
2024-02-20 15:20:57 +01:00
- [How to configure `vmanomaly` ](#how-to-configure-vmanomaly )
### Kubernetes with Helm charts
2024-04-01 15:41:55 +02:00
> To run `vmanomaly`, you need to have VictoriaMetrics Enterprise license. You can get a trial license key [**here**](https://victoriametrics.com/products/enterprise/trial/).
2024-02-20 15:20:57 +01:00
You can run `vmanomaly` in Kubernetes environment
with [these Helm charts ](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-anomaly/README.md ).
## How to configure vmanomaly
To run `vmanomaly` you need to set up configuration file in `yaml` format.
Here is an example of config file that will run [Facebook Prophet ](https://facebook.github.io/prophet/ ) model, that will be retrained every 2 hours on 14 days of previous data. It will generate inference (including `anomaly_score` metric) every 1 minute.
```yaml
scheduler:
infer_every: "1m"
fit_every: "2h"
fit_window: "14d"
models:
prophet_model:
class: "model.prophet.ProphetModel"
args:
interval_width: 0.98
reader:
datasource_url: "http://victoriametrics:8428/" # [YOUR_DATASOURCE_URL]
sampling_period: "1m"
queries:
# define your queries with MetricsQL - https://docs.victoriametrics.com/metricsql/
cache: "sum(rate(vm_cache_entries))"
writer:
datasource_url: "http://victoriametrics:8428/" # [YOUR_DATASOURCE_URL]
```
Next steps:
2024-02-20 16:19:18 +01:00
- Define how often to run and make inferences in the [scheduler ](/anomaly-detection/components/scheduler/ ) section of a config file.
- Setup the datasource to read data from in the [reader ](/anomaly-detection/components/reader/ ) section.
- Specify where and how to store anomaly detection metrics in the [writer ](/anomaly-detection/components/writer/ ) section.
- Configure built-in models parameters according to your needs in the [models ](/anomaly-detection/components/models/ ) section.
- Integrate your [custom models ](/anomaly-detection/components/models/#custom-model-guide ) with `vmanomaly` .
- Define queries for input data using [MetricsQL ](https://docs.victoriametrics.com/metricsql/ ).
2024-02-20 15:20:57 +01:00
## Check also
Here are other materials that you might find useful:
2024-02-20 16:19:18 +01:00
- [Guide: Anomaly Detection and Alerting Setup ](/anomaly-detection/guides/guide-vmanomaly-vmalert/ )
- [FAQ ](/anomaly-detection/faq/ )
- [Changelog ](/anomaly-detection/changelog/ )
2024-02-20 15:20:57 +01:00
- [Anomaly Detection Blog ](https://victoriametrics.com/blog/tags/anomaly-detection/ )