[Solved] Struggling with Victoria Metrics: Cannot find data

I have a relatively new instance of HA with everything running in docker containers on a Raspberry Pi. The SmartThings integration, for instance, brings over all the ST devices without hitch. The same for the MQTT integration and Zigbee2MQTT devices. I also have a number of devices I’m creating using ESPHome. These too are all visible in HA.

In a previous project, I used InfluxDB2+Grafana to store and visualise data. For this new project I decided to use InfluxDB3+Grafana and looked forward to being able to use SQL. The integration works fine and data/graphs are easily visible in InfluxDB3.

InfluxDB3 has a serious limitation, I’ve discovered, the limit on query time, quote: “InfluxDB 3 Core limits query time ranges to approximately 72 hours (both recent and historical) to ensure query performance.”

So that’s not much good. I have been looking at Victoria-Metrics (VM), single instance, in a docker container both for log-term storage ad for lack of restrictions. Two modifications to get this to work (since containers CANNOT use the add-on route for VM integration):

**configuration.yaml:**
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# New: victoria-metrics using just ONE of the following protocols:
# Each protocol has an associated configuration file
influxdb: !include victoria-metrics.yaml
#influxdb: !include influxdb3.yaml

This method uses the Influxdb protocol using by referencing a separate victoria-metrics configuration:
victoria-metrics.yaml

api_version: 1
host: 192.168.1.50
port: 8428
ssl: false
verify_ssl: false
max_retries: 3
measurement_attr: entity_id
tags_attributes:
  - friendly_name
  - unit_of_measurement
ignore_attributes:
  # note: nothing ignored, for now
  #- icon
  #- etc.......
include:
  domains:
    - sensor
    - binary_sensor
    - light
    - switch
    - cover
    - climate
    - input_boolean
    - input_select
    - number
    - lock
    - weather
exclude:
  entity_globs:
    # note: nothing excluded, for now
    #- sensor.clock*
    #- etc

I opened everything wide so as not to exclude anything that might be transferred so that I could see if everything is being brought across; filtering can be done later.
It looks(?) as though all the data is being transferred to VM, but I am unable to visualise anything by way of values. Maybe the configuration is correct or maybe it’s lacking (I haven’t used VM’s vmagent which acts like Prometheus because I’m using an InfluxDB protocol that pushes data rather than scrapes). Or maybe I am hopeless at PromQL type queries.
I tried the test in the (VictoriaMetrics: Long-Term Storage of Home Assistant Data) integration shown here:
group by(__name__) ({__name__!=""})
“> You should see a list of metrics names, including, for example, weather.forecast_home_temperature.”
I get an error:


I mean, the query seems fine: get the names where the name is not null.
Here’s the result of a query in Influxdb for a known entity (ESPhome temperature sensor value:

Yep, that seems perfectly OK.
Here’s my attempt to do the same in VM:

Most of the entities are there but not “value” and I am unable to see any measurements whatever I do.
If anyone has VM working successfully with HA (using containers, or otherwise) I’d be grateful for some help with this.

I completely removed the containers, the image and the permanent storage volumes using a slightly modified value for the latter.

Spinning-up victoria-metrics and restarting HA (with tge same configuration given above) seems to have solved the issue.

All the entities are there as is the associated data (values).

I am happy that all data is being transferred. My next task is to apply filters to prevent a mass of unwanted data being transferred from HA to VM. After that I shall see if I can visualise the wanted data in Grafana.