Grafana, influxdb query problem

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

I’m not asking about grafana config file. Have you install telegraf? If yes then just provide me the config file . I think you have made some changes in it .

No sorry. I am only working with grafana and influx db.

Try clicking the button which can be seen just below ‘Add Query’. It will be in the shape of pencil and when you hover it, it says “Toggle Text Edit Mode”. Click on that button and you will have a text field to enter your query. Try giving ‘Select * from <table_name>’ query. Also try changing the format to ‘Table’ in ‘FORMAT AS’ option.

1 Like

Sometime the data doesn’t show in Time series change the format as table from your panel view.

This answer helped me in resolving my issue, thanks a lot :slight_smile:

I had the same issue, my problem was the data’s EPOCH time stamp was wrong due to the source host generating the data not set up on NTP properly. Once I fixed that data flooded. I see in the screen shot above that the epoch time stamp looks right for the date it was being posted. Would still check to make sure time is configured properly on source host, influxdb, and grafana.