influxdata / influxdata/influxdb

Unable to retrieve metrics when using set function

Open
#23,025 8 comments 0 reactions 1 assignee Claimed by @nathanielc View on GitHub
area/flux
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.

1. Using telegraf enable the vSphere metrics input plugin and output the data to a InfluxDB database
2. Use the below query to try and retrieve the CPU metrics
from(bucket: "telegraf")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "vsphere_host_cpu")
|> filter(fn: (r) => r["_field"] == "usage_average")
|> filter(fn: (r) => contains(value: r["vcenter"], set: ["vCenter.name"]))
|> filter(fn: (r) => contains(value: r["dcname"], set: ["datacenter.Name"] ))
|> filter(fn: (r) => contains(value: r["clustername"], set: ["clustername"]))
|> filter(fn: (r) => contains(value: r["esxhostname"], set: ["esxi_host1","esxi_host_2"]))
|> keep(columns: ["_time","_field","_value"])
|> aggregateWindow(every: 20s, fn: last, createEmpty: false)
|> yield(name: "last")

__Expected behavior:__
CPU utilization reported for all vmware esxi hosts

__Actual behavior:__
Error is displayed:
` runtime error @7:6-7:78: filter: failed to evaluate filter function: keyword argument "set" should be of an array of type invalid, but got an array of type [string]`

__Environment info:__

* System info: Run `uname -srm` and copy the output here
Kubernetes v1.21.6
* InfluxDB version: Run `influxd version` and copy the output here
Image v2.1.1
* Other relevant environment details: Container runtime, disk info, etc

__Logs:__
` runtime error @7:6-7:78: filter: failed to evaluate filter function: keyword argument "set" should be of an array of type invalid, but got an array of type [string]`

This was working fine before in the earlier v2.0.4 versions. clustername only contains a single tag called "CLUSTER01"

![brave_2021-12-28_10-59-07](https://user-images.githubusercontent.com/8303616/147584241-e3defddd-5ccb-46f4-8f34-88b55281999e.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.