For a broader overview please visit the navigation page .
Available from v1.32.0 For a configuration tailored to your metrics, try dynamic presets with AI Copilot.
How to install and run vmanomaly #
vmanomaly is part of VictoriaMetrics Enterprise
. See
licensing
for startup requirements and contact us
for evaluation and support.
The following options are available:
Anomaly detection models can be kept
Available from v1.13.0
on host filesystem after fit stage (instead of default in-memory option); This will drastically reduce RAM for larger configurations. Similar optimization
Available from v1.16.0
can be applied to data read from VictoriaMetrics TSDB. See instructions of how to enable it
here
.
Command-line arguments #
The vmanomaly service supports a set of command-line arguments to configure its behavior, including options for licensing, logging levels, and more.
vmanomaly supports
Available from v1.18.5
running on config directories, see the config positional arg description in help message below.
Single-dashed command-line argument
Available from v1.23.3
format can be used, e.g. -loggerLevel in addition to --loggerLevel. This aligns better with other VictoriaMetrics ecosystem components. Mixing the two styles is also supported, e.g. -watch --loggerLevel INFO.
usage: vmanomaly.py [-h] [--eula] [--license STRING] [--licenseFile PATH]
[--license.forceOffline]
[--loggerLevel {WARNING,ERROR,DEBUG,INFO,FATAL}] [--watch]
[-configCheckInterval DURATION] [--dryRun]
[--outputSpec PATH]
config [config ...]
VictoriaMetrics Anomaly Detection Service
positional arguments:
config YAML config file(s) or directories containing YAML
files. Multiple files will recursively merge each
other values so multiple configs can be combined. If a
directory is provided, all `.yaml` files inside will
be merged, without recursion. Default: vmanomaly.yaml
is expected in the current directory.
options:
-h Show this help message and exit
--eula Accept the ESA https://victoriametrics.com/legal/esa/
to run vmanomaly. No license verification is
performed.
--license STRING Deprecated. A non-empty value implies ESA acceptance.
Use -eula instead; the key is not verified.
--licenseFile PATH Deprecated. A non-empty path implies ESA acceptance.
Use -eula instead; the file is not read.
--license.forceOffline
Deprecated compatibility flag; has no effect. License
verification is no longer performed.
--loggerLevel {WARNING,ERROR,DEBUG,INFO,FATAL}
Minimum level to log. Possible values: {'WARNING',
'ERROR', 'DEBUG', 'INFO', 'FATAL'}.
--watch Watch config files for changes and trigger hot
reloads. Watches the specified config file or
directory for modifications, deletions, or additions.
Upon detecting changes, triggers config reload. If new
config validation fails, continues with previous valid
config and state.
-configCheckInterval DURATION
Interval for checking watched config files for content
changes. Default: 30s.
--dryRun Validate only: parse + merge all YAML(s) and run
schema checks, then exit. Does not require a license
or ESA acceptance to run. Does not expose metrics, or
launch vmanomaly service(s).
--outputSpec PATH Target location of .yaml output spec.
Health-check mode: --healthcheck [--config PATH] [--url URL] [--timeout
SECONDS]. Put --healthcheck (or -healthcheck) first; use --healthcheck --help
for probe options.
Available from v1.29.5
When --watch is enabled, config changes are detected by fixed-interval content polling instead of filesystem event delivery. The polling frequency is controlled by -configCheckInterval (default: 30s). The same option can also be passed as --configCheckInterval, --config.check.interval, --config-check-interval, --config_check_interval, or in key-value form such as configCheckInterval=30s.
For the separate --healthcheck mode and its options, see
container health checks
.
You can specify these options when running vmanomaly to fine-tune logging levels or handle licensing configurations, as per your requirements.
Container health checks #
Available from v1.32.0
Standard and DHI container images include a lightweight --healthcheck command. Put it first; it checks the running service without starting another instance or loading models. Exit code 0 means the endpoint returned HTTP 200; failures return 1. This is a liveness check, not a check of datasource connectivity, model readiness or detection quality.
# Check the default local listener on port 8490.
docker exec <container> /vmanomaly/.venv/bin/python -m src.vmanomaly --healthcheck
# Follow the server address, port, path prefix and TLS settings in mounted config.
docker exec <container> /vmanomaly/.venv/bin/python -m src.vmanomaly --healthcheck --config /config/vmanomaly.yaml
Probe options are separate from the service arguments above:
| Option | Environment default | Purpose |
|---|---|---|
--config PATH | VMANOMALY_HEALTHCHECK_CONFIG | Read the server settings from a config file or directory. Repeat the flag in service merge order for multiple paths; the environment variable accepts one path. |
--url URL | VMANOMALY_HEALTHCHECK_URL | Explicit HTTP(S) endpoint, overriding config discovery. |
--timeout SECONDS | VMANOMALY_HEALTHCHECK_TIMEOUT | Socket timeout; defaults to 3 seconds. |
CLI options take precedence over their environment defaults. With neither URL nor config supplied, the probe uses loopback port 8490 and /health. The image checks every 30s, with a 5s command timeout, 60s startup allowance and 3 retries. Docker Compose inherits these defaults; override its healthcheck timing for slower startup. Kubernetes uses its own configured probes rather than the image’s Docker health check.
For a custom listener or TLS configuration , point the inherited probe at the same mounted configuration as the service:
# Inside a Docker Compose service; the file must already be mounted.
environment:
VMANOMALY_HEALTHCHECK_CONFIG: /config/vmanomaly.yaml
Config-based HTTPS probes check local liveness without verifying the server certificate or hostname. With mTLS, they present the configured server certificate, which must also be accepted for client authentication by mtls_ca_file. An explicit HTTPS --url uses certificate and hostname verification and does not load client credentials from --config.
Licensing #
vmanomaly is a VictoriaMetrics Enterprise
component. See the
permitted Enterprise use cases
: evaluation in non-production environments, or production use with a valid Enterprise contract or permission from VictoriaMetrics. Contact us
for licensing and support.
Available from v1.33.0
Pass -eula, --eula or --eula=true to accept the Enterprise Software Agreement (ESA)
at startup. Existing non-empty -license, -licenseFile and VM_LICENSE_FILE settings remain compatible and imply acceptance. --dryRun does not require acceptance. Versions before
v1.33.0
still require a valid license key; see
migration guidance
when upgrading.
Docker #
If you encounter Docker Hub pull limits
, use the Quay.io mirror
: docker pull quay.io/victoriametrics/vmanomaly:v1.33.0.
On some linux/arm64 environments running through virtualization on Apple M4/M5 hosts, vmanomaly may exit with SIGILL (exit code 132) before startup. This is caused by the virtualized host advertising an SVE2 capability that traps when used by OpenSSL 4.x; it does not affect all ARM64 systems.
On affected hosts, add -e OPENSSL_armcap=0 to docker run, or add - OPENSSL_armcap=0 under the service’s Docker Compose environment, matching the list syntax used below. This disables ARM cryptographic acceleration, so apply it only as a temporary workaround on affected hosts.
Experimental hardened image #
Available from v1.30.6
An experimental Docker Hardened Images
-based variant is available on Docker Hub and Quay for linux/amd64 and linux/arm64:
victoriametrics/vmanomaly:v1.33.0-dhi
victoriametrics/vmanomaly:v1.33.0-enterprise-dhi
quay.io/victoriametrics/vmanomaly:v1.33.0-dhi
quay.io/victoriametrics/vmanomaly:v1.33.0-enterprise-dhi
These are aliases of the same application image and have the same license requirements. The -enterprise-dhi ordering supports Helm’s image.variant: dhi when enterprise mode is enabled, image.tag is empty, and the chart appVersion matches the desired release. With an older chart, set image.tag: v1.33.0-enterprise-dhi explicitly. Standard v1.33.0, v1.33.0-enterprise and latest tags retain their existing base image.
The hardened image runs as a non-root user and contains no runtime shell or package manager. Ensure mounted configuration files are readable and state directories are writable by the container user; shell-based entrypoint overrides and docker exec ... sh are unavailable.
The hardened image defaults process-local time to UTC. Configure schedulers.<alias>.tz for scheduling and reader/query tz for model calendar features; both default to UTC.
Run with Docker #
Below are the steps to get vmanomaly up and running inside a Docker container:
- Pull Docker image:
docker pull victoriametrics/vmanomaly:v1.33.0
Create and modify your
config.yamlfile. See the example .Start the container with your configuration and
-eulato accept the ESA :
docker run -it \
-v ./config.yaml:/config.yaml \
-p 8490:8490 \
victoriametrics/vmanomaly:v1.33.0 \
/config.yaml \
-eula \
--loggerLevel=INFO \
--watch
Use the below configuration if settings.restore_state is True (vmanomaly runs in stateful mode) or on-disk mode is preferred over in-memory.
docker run -it \
-v ./config.yaml:/config.yaml \
-v vmanomaly_data:/tmp/vmanomaly \
-e VMANOMALY_DATA_DUMPS_DIR=/tmp/vmanomaly/data \
-e VMANOMALY_MODEL_DUMPS_DIR=/tmp/vmanomaly/models \
-p 8490:8490 \
victoriametrics/vmanomaly:v1.33.0 \
/config.yaml \
-eula \
--loggerLevel=INFO \
--watch
# docker-compose.yml file
services:
# ...
vmanomaly:
container_name: vmanomaly
image: victoriametrics/vmanomaly:v1.33.0
# ...
restart: always
volumes:
- ./config.yaml:/config.yaml
# Enable if settings.restore_state is True
# - vmanomaly_data:/tmp/vmanomaly
environment:
# Enable if on-disk mode over in-memory is preferred
# Required, if settings.restore_state is True
- VMANOMALY_MODEL_DUMPS_DIR=/tmp/vmanomaly/models
- VMANOMALY_DATA_DUMPS_DIR=/tmp/vmanomaly/data
ports:
- "8490:8490"
command:
- "/config.yaml"
- "-eula"
- "--loggerLevel=INFO"
- "--watch"
volumes:
# ...
# Enable if on-disk mode over in-memory is preferred
# Required, if settings.restore_state is True
vmanomaly_data: {}
For a complete docker-compose example please refer to our alerting guide , chapter docker-compose
See also:
Kubernetes with Helm charts #
vmanomaly is part of VictoriaMetrics Enterprise
. See
licensing
for startup requirements and contact us
for evaluation and support.
If you encounter Docker Hub pull limits
, set the image repository to quay.io/victoriametrics/vmanomaly.
You can run vmanomaly in Kubernetes environment
with these Helm charts
.
VM Operator #
When upgrading to v1.33.0 with an Operator version that still requires spec.license, retain the existing spec.license.key or keyRef and add spec.extraArgs.eula: "true". A referenced Secret must still exist for Kubernetes to mount it. EULA-only validation and typed Prophet holiday configuration are tracked in Operator #2836
.
If you are using
VM Operator
to manage your Kubernetes cluster, vmanomaly can be deployed using the following
custom resource guide
.
How to configure vmanomaly #
Need help choosing a model and its initial settings? Use Choose a model for your metrics for worked examples and copyable recipes, then return here to complete the deployment.
To run vmanomaly, use YAML files or directories containing YAML files. The configuration files support shallow merge, allowing splitting the configuration into multiple files for better organization.
If you are using directories, all .yaml files inside will be shallow merged, without deeper recursion. If you want to merge multiple YAML files, you can specify them as separate arguments, e.g.
vmanomaly config1.yaml config2.yaml ./config_dir/
Before deploying, check the correctness of your configuration validate config file(s) with --dryRun
command-line
flag for chosen deployment method (Docker, Kubernetes, etc.). This will parse and merge all YAML files, run schema checks, log errors and warnings (if found) and then exit without starting the service or requiring a license.
Available from v1.27.0
it can be also used to check for migration compatibility issues when upgrading to a newer version of vmanomaly. See
Migration
section for more details.
Example #
Here is an example of a config file that runs the online
Temporal Envelope
model on a CPU metric. The scheduler runs inference every five minutes and uses the fit only for initial bootstrap; between fits the model updates causally from each inference batch. The initial fit uses four weeks of data. The model produces anomaly_score, yhat, yhat_lower, and yhat_upper
series
for debugging, and its hour-of-day and day-of-week profiles follow the query timezone and daylight-saving-time changes.
settings:
# https://docs.victoriametrics.com/anomaly-detection/components/settings/
n_workers: 2 # number of workers to run workload in parallel, set to 0 or negative number to use all available CPU cores
native_threads_per_worker: 0 # automatically divide container-aware CPU capacity across workers
anomaly_score_outside_data_range: 5.0 # default anomaly score for anomalies outside expected data range
restore_state: true # restore state from previous run, available since v1.24.0
# https://docs.victoriametrics.com/anomaly-detection/components/settings/#logger-levels
# to override service-global logger levels, use the `logger_levels` section
logger_levels:
# vmanomaly: INFO
# scheduler: INFO
# reader: INFO
# writer: INFO
model.online.temporal_envelope: WARNING
schedulers:
online_5m:
# https://docs.victoriametrics.com/anomaly-detection/components/scheduler/#periodic-scheduler
class: 'periodic'
infer_every: '5m'
scatter_infer_jobs: true
fit_every: '1000d'
fit_window: '4w'
models:
# https://docs.victoriametrics.com/anomaly-detection/components/models/#temporal-envelope
temporal_envelope_model:
class: 'temporal_envelope'
queries: ['cpu_user']
schedulers: ['online_5m']
provide_series: ['anomaly_score', 'yhat', 'yhat_lower', 'yhat_upper'] # for debugging
seasonalities: ['hod_smooth', 'dow_smooth']
alpha: 0.005 # trend reactivity; try 0.0025-0.02
loss_reactivity: 5 # try 1-5; lower values reduce the influence of spikes
iqr_threshold: 2 # try 1-4 to adjust data-driven interval width
min_n_samples_seen: 16
reader:
class: 'vm' # use VictoriaMetrics as a data source
# https://docs.victoriametrics.com/anomaly-detection/components/reader/#vm-reader
datasource_url: "https://play.victoriametrics.com/" # [YOUR_DATASOURCE_URL]
tenant_id: '0:0'
sampling_period: "5m"
tz: 'UTC' # set the IANA timezone that defines local calendar patterns, e.g. 'America/New_York'
workers: 0 # automatically choose bounded datasource concurrency
series_processing_batch_size: 8 # number of time series to process together while preparing data for fit or infer stages
queries:
# define your queries with MetricsQL - https://docs.victoriametrics.com/victoriametrics/metricsql/
cpu_user:
expr: 'sum(rate(node_cpu_seconds_total{mode=~"user"}[10m])) by (container)'
data_range: [0, 'inf'] # query-level business policy from v1.30.2
detection_direction: 'above_expected' # query-level from v1.30.2; only spikes are anomalous
max_points_per_query: 15000 # to deal with longer queries hitting search.maxPointsPerTimeseries
# other queries ...
writer:
class: 'vm' # use VictoriaMetrics as a data destination
# https://docs.victoriametrics.com/anomaly-detection/components/writer/#vm-writer
datasource_url: "http://victoriametrics:8428/" # [YOUR_DATASOURCE_URL]
# optional tenant ID
# tenant_id: "0:0"
UI #
Available from v1.31.0
For comparable hosts or replicas, try the
peer-group model
: retain entity labels in the query and use groupby for the population, such as service. The UI provides a dedicated peer investigation panel. You can also
tune a model
using marked anomalies or an expected anomaly rate. For deployment planning, start with the
sizing APIs
, then validate their estimates under representative load.
Available from v1.26.0
vmanomaly’s built-in web UI supports prototyping and interactive generation of vmanomaly and vmalert configuration files. See the
UI documentation
for instructions and examples. For optional AI-assisted workflows, use the
UI Copilot
, connect the
vmanomaly MCP server
, or follow the published
agent skills
.

Public playgrounds with pre-configured vmanomaly instances and VictoriaMetrics/VictoriaLogs/VictoriaTraces datasources are available for interactive experimenting without the need to set up your own instance or getting an enterprise license. You can find them in the
UI documentation
or access them directly via the links - metrics
, logs
, traces
- or embedded versions in the collapsible blocks.
Playground on VictoriaMetrics Datasource
Playground on VictoriaLogs Datasource
Playground on VictoriaTraces Datasource
Recommended steps #
For optimal service behavior, consider the following tweaks when configuring vmanomaly:
Set
settings.n_workersAvailable from v1.23.0 arg > 1 to utilize more of available CPU cores for parallel workload processing. This can significantly improve performance, especially on larger datasets with a lot ofreader.queriesand longerscheduler.fit_windowintervals. Setting it to zero or negative number will enable using all available CPU cores.Set up on-disk mode Available from v1.13.0 to reduce RAM usage, especially for larger datasets. This mode allows
vmanomalyto keep models and the data on the host filesystem after thefitstage, rather than in memory.Set up state restoration Available from v1.24.0 to resume from the last known state for long-term stability. This is controlled by the
settings.restore_stateboolean arg .Set up configuration hot reload Available from v1.25.0 to apply configuration-file changes automatically. Enable it with the
--watchCLI argument to update the service without an explicit restart.
Schedulers:
- Configure the inference frequency in the scheduler section of the configuration file.
- Ensure that
infer_everyaligns with your minimum required alerting frequency.- For example, if receiving alerts every 15 minutes is sufficient (when
anomaly_score > 1), setinfer_everyto matchreader.sampling_periodor override it per query viareader.queries.query_xxx.stepfor an optimal setup.
- For example, if receiving alerts every 15 minutes is sufficient (when
- Set
scheduler.scatter_infer_jobsAvailable from v1.29.7 arg totrueto allow for equal distribution of inference jobs acrossinfer_everyintervals, which can further enhance parallel processing efficiency and reduce resource contention whenreader.queriescontains a large number of queries.
Reader:
- Setup the datasource to read data from in the
reader
section. Include tenant ID if using a
cluster version of VictoriaMetrics
(
multitenantvalue Available from v1.16.2 can be also used here). - Define queries for input data using
MetricsQL
under
reader.queriessection. Note, it’s possible to override reader-level arguments at query level for increased flexibility, e.g. specifying per-query timezone or sampling period . - For longer
fit_windowintervals in scheduler, consider splitting queries into smaller time ranges to avoid excessive memory usage, timeouts and hitting server-side constraints, so they can be queried separately and reconstructed onvmanomalyside. Please refer to this example for more details. - Set
reader.series_processing_batch_sizeAvailable from v1.29.7 arg to a reasonable value (4-16, default is 8) to balance between memory usage and processing speed when preparing data for fit or infer stages.
If applicable - consider
VLogsReader
Available from v1.26.0
to perform anomaly detection on log-derived metrics. This is particularly useful for scenarios where log data needs to be analyzed for unusual patterns or behaviors, such as error rates or request latencies.
Writer:
- Specify where and how to store anomaly detection metrics in the writer section.
- Include tenant ID if using a cluster version of VictoriaMetrics for writing the results.
- Adding
forlabel tometric_formatargument is recommended for smoother visual experience in the anomaly score dashboard . Please refer tometric_formatargument description here .
Models:
- Configure built-in models hyperparameters according to your needs in the models section. Where possible, incorporate domain knowledge for optimal results.
- (Optional) Develop or integrate your
custom models
with
vmanomaly. - Adding
ytoprovide_seriesargument values is recommended for smoother visual experience in the anomaly score dashboard . Also, othervmanomalyoutput series can be specified inprovide_series, such asyhat,yhat_lower,yhat_upper, etc. This will allow you to visualize the expected values and their confidence intervals in the dashboard.Only univariate models support the generation of such output. Other models, such as multivariate or custom , may not support this feature.
Visualization:
- Set up anomaly score dashboard to visualize the results of anomaly detection.
- Set up
self-monitoring dashboard
to monitor the health of
vmanomalyservice and its components.
Logging:
- Tune logging levels in the
settings.logger_levelssection to control the verbosity of logs. This can help in debugging and monitoring the service behavior, as well as in disabling excessive logging for production environments.
Check also #
Please refer to the following links for a deeper understanding of Anomaly Detection and vmanomaly: