Hi Thanks for the reply.
- Below is the telegraf configuration file for data gathered and flushed by telegraf.
[global_tags]
dc = "ap-south-1" # will tag all metrics with dc=us-east-1
host = "$HOSTNAME"
[agent]
interval = "1m"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "30s"
flush_jitter = "0s"
precision = ""
logfile = "/var/log/telegraf/telegraf.log"
hostname = ""
omit_hostname = false
###############################################################################
# OUTPUT PLUGINS #
###############################################################################
[[outputs.influxdb]]
urls = ["http://xxx:8086"] # required
database = "stage-db-xxx" # required
retention_policy = ""
write_consistency = "any"
timeout = "5s"
content_encoding = "gzip"
###############################################################################
# INPUT PLUGINS #
###############################################################################
[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = false
[[inputs.disk]]
mount_points = ["/","/data"]
fielddrop=["used","inodes_used"]
ignore_fs = ["tmpfs", "devtmpfs", "devfs"]
[[inputs.mem]]
fielddrop=["active","buffered","cached","free","inactive","used","used_percent"]
[[inputs.processes]]
# no configuration
[[inputs.swap]]
fielddrop=["free","total"]
[[inputs.system]]
fielddrop=["n_users","uptime_format"]
[[inputs.net_response]]
protocol = "tcp"
address = ":22"
timeout = "5s"
read_timeout = "5s"
[[inputs.net_response]]
protocol = "tcp"
address = ":80"
timeout = "5s"
read_timeout = "5s"
[[inputs.net_response]]
protocol = "tcp"
address = ":3306"
timeout = "5s"
read_timeout = "5s"
[[inputs.mysql]]
servers = ["telegraf:xyz/?tls=false"]
gather_slave_status = true
- General metrics we are collecting like CPU, MEM etc.
- I don’t think so, can you please help me with what do you mean by CQ’s.
- Can you share with me the query to get this retention policy, So that I can share with you the O/P.
Note: for last 15min the influx query O/P is
ubuntu@ip-xxx:~$ curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=xxx-master-prod" --data-urlencode "q=SELECT \"used_percent\" FROM \"disk\" WHERE \"host\"='ip-xxxxap-south-1.compute.internal' AND time >= now() -15m GROUP BY \"path\""
{
"results": [
{
"statement_id": 0,
"series": [
{
"name": "disk",
"tags": {
"path": "/"
},
"columns": [
"time",
"used_percent"
],
"values": [
[
"2022-07-12T13:37:28Z",
82.03197951483892
],
[
"2022-07-12T13:37:28Z",
82.03197951483892
],
[
"2022-07-12T13:38:29Z",
82.03255640368774
],
[
"2022-07-12T13:38:29Z",
82.03255640368774
],
[
"2022-07-12T13:39:27Z",
82.03955860352
],
[
"2022-07-12T13:39:27Z",
82.03955860352
],
[
"2022-07-12T13:40:28Z",
82.0397335055665
],
[
"2022-07-12T13:40:28Z",
82.0397335055665
],
[
"2022-07-12T13:41:20Z",
82.03991740463185
],
[
"2022-07-12T13:41:20Z",
82.03991740463185
]
]
}
]
}
]
}
And for last 5min influx query O/P is:
ubuntu@ip-xxx:~$ curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=xxx-master-prod" --data-urlencode "q=SELECT \"used_percent\" FROM \"disk\" WHERE \"host\"='ip-xxxap-south-1.compute.internal' AND time >= now() -5m GROUP BY \"path\""
{
"results": [
{
"statement_id": 0
}
]
}
** Have observed that the last 15min query o/p contains the data of last 4-5min as well.