Grafana, influxdb query problem

Hi,
Can aynbody tell me what I need to do to see data on Grafana dashboard…
I’m using influxdb and node red to store values from sensors.
Using cli influx commands I see values stored in database.
example

select count(*) from kc_temp
name: kc_temp
time count_value


0 11515

or

SELECT * FROM “kc_temp” limit 5
name: kc_temp
time value


1580046175568791639 18.00
1580046194152744473 18.00
1580046215556226509 18.00
1580046224216724661 18.00
1580046240434540744 18.00

I watched several tutorials on youtube, but I don’t know where is the problem.
Dataset is OK, by pressing SAVE & Test everything is OK.

Can anyone help, how should I fill Query to work with my example ???

Hi,

Can you show your InfluxDB database configuration in Grafana.

Are you sure your Grafana server is allow to access to your InfluxDB server ?

Regards,

I’m not 100% sure…grafana said that is ok…is there any CLI command to test it ?

image

Try this

1 Like

hi…
it’s working finally…many THX

I am also getting similar error. But unable to resolve it using above mentioned configuration.
Please view the my below attached configurations.

Can anyone pleasegrafana-query help, how should I fill Query to work with my example ???

hi,
did you edited influxdb.conf ??? if not try to follow Youtube video where guys shows how to do it…
Try to check if your tables have numeric values, if is number stored as string it will not show … This is my 1 day experience with Grafana.

Hi, thanks for the comment. I am able to get the data if I manually fill the query. But the query section does not automatically show me the available options of fields and measurements.

Try to restant grafana. I also face toi this issue.

Hi, restart the server multiple times but error still persists.

Share error log file

Hi, thanks for the comment. There is no error logged, please see my above comments, I am unable to view my measurements and fields on the selection of the database, in the query panel.

Go to your InfluxDB database and show de fieldType of your data

show field keys from cpu
name: cpu
fieldKey         fieldType
--------         ---------
usage_guest      float
usage_guest_nice float
usage_idle       float
usage_iowait     float
usage_irq        float
usage_nice       float
usage_softirq    float

Your InfluDB server and Grafana server are in the same server ?

yes both are locally hosted on my machine
influx-keys

Share your config file of telegraf

use the command below and post the result

Can you please share will be the config file how did you get other metrics in your telegaf config file.

Like by default these metrics are stored.

[[inputs.win_perf_counters]]
[[inputs.win_perf_counters.object]]
# Processor usage, alternative to native, reports on a per core.
ObjectName = “Processor”
Instances = [""]
Counters = [
“% Idle Time”,
“% Interrupt Time”,
“% Privileged Time”,
“% User Time”,
“% Processor Time”,
“% DPC Time”,
]
Measurement = “win_cpu”
# Set to true to include _Total instance when querying for all (
).
IncludeTotal=true

[[inputs.win_perf_counters.object]]
# Disk times and queues
ObjectName = “LogicalDisk”
Instances = [""]
Counters = [
“% Idle Time”,
“% Disk Time”,
“% Disk Read Time”,
“% Disk Write Time”,
“% Free Space”,
“Current Disk Queue Length”,
“Free Megabytes”,
]
Measurement = “win_disk”
# Set to true to include _Total instance when querying for all (
).
#IncludeTotal=false

[[inputs.win_perf_counters.object]]
ObjectName = “PhysicalDisk”
Instances = ["*"]
Counters = [
“Disk Read Bytes/sec”,
“Disk Write Bytes/sec”,
“Current Disk Queue Length”,
“Disk Reads/sec”,
“Disk Writes/sec”,
“% Disk Time”,
“% Disk Read Time”,
“% Disk Write Time”,
]
Measurement = “win_diskio”

[[inputs.win_perf_counters.object]]
ObjectName = “Network Interface”
Instances = ["*"]
Counters = [
“Bytes Received/sec”,
“Bytes Sent/sec”,
“Packets Received/sec”,
“Packets Sent/sec”,
“Packets Received Discarded”,
“Packets Outbound Discarded”,
“Packets Received Errors”,
“Packets Outbound Errors”,
]
Measurement = “win_net”

[[inputs.win_perf_counters.object]]
ObjectName = “System”
Counters = [
“Context Switches/sec”,
“System Calls/sec”,
“Processor Queue Length”,
“System Up Time”,
]
Instances = ["------"]
Measurement = “win_system”
# Set to true to include _Total instance when querying for all (*).
#IncludeTotal=false

[[inputs.win_perf_counters.object]]
# Example query where the Instance portion must be removed to get data back,
# such as from the Memory object.
ObjectName = “Memory”
Counters = [
“Available Bytes”,
“Cache Faults/sec”,
“Demand Zero Faults/sec”,
“Page Faults/sec”,
“Pages/sec”,
“Transition Faults/sec”,
“Pool Nonpaged Bytes”,
“Pool Paged Bytes”,
“Standby Cache Reserve Bytes”,
“Standby Cache Normal Priority Bytes”,
“Standby Cache Core Bytes”,
]
# Use 6 x - to remove the Instance bit from the query.
Instances = ["------"]
Measurement = “win_mem”
# Set to true to include _Total instance when querying for all (*).
#IncludeTotal=false

[[inputs.win_perf_counters.object]]
# Example query where the Instance portion must be removed to get data back,
# such as from the Paging File object.
ObjectName = “Paging File”
Counters = [
“% Usage”,
]
Instances = ["_Total"]
Measurement = “win_swap”

I am using windows environment. I’ll try to find equivalent commands.

@aalishrana Hi Ali Aslam can you please share your config file as i shared mine i want to see how did you add others metrics

Hi, I can’t find the configuration file you shared above. Can you please specify the path ?
Secondly, I only changed these two configuration files on path

  1. grafana\conf\custom.ini
  2. grafana\conf\provisioning\datasources\sample.yaml