33
loading...
This website collects cookies to deliver better user experience
avn service create --plan startup-4 \
--service-type influxdb \
--cloud google-europe-west3 \
demo-influx
-t influxdb
) named demo-influx
on Google's cloud region europe-west3
with a startup-4
plan. To review InfluxDB plans and associated cost, you can check the pricing page.-t grafana
) and the instance name (demo-grafana
):avn service create --plan startup-4 \
--service-type grafana \
--cloud google-europe-west3 \
demo-grafana
avn service integration-create \
-t datasource \
-s demo-grafana \
-d demo-influx
demo-grafana
instance pointing to demo-influx
. You're now ready to receive the metrics.brew install telegraf
demo-influx
instance. Get InfluxDB's service URI with the following command:avn service get demo-influx --format '{service_uri}'
https+influxdb://avnadmin:<PASSWORD>@<HOSTNAME>:<PORT>/defaultdb
. Note down the <HOSTNAME>
, <PORT>
and <PASSWORD>
parameters.telegraf.conf
with the following content:[global_tags]
[agent]
interval = "10s"
hostname = "Francesco.Mac"
[inputs.cpu]
totalcpu = true
[outputs.influxdb]
url = "https://<HOST>:<PORT>"
database = "defaultdb"
username = "avnadmin"
password = "<PASSWORD>"
precision = "10s"
skip_database_creation = true
totalcpu
stats.[outputs.influxdb]
plugin sends the collected metrics to the influxDB
endpoint defined in the url
parameter.skip_database_creation = true
, since the defaultdb
database already exists in the instance.telegraf -config telegraf.conf
demo-influx
instance. We could query it via InfluxQL, but especially for time-series metrics, a line graph is usually much better for showing the current status and recent trend. Creating such visualisation in Grafana is achievable in few steps, with the first one being... understanding how to connect to Grafana itself.avn service get demo-grafana --format '{service_uri_params}'
avnadmin
user.{
"host": "<HOSTNAME>",
"password": "<PASSWORD>",
"port": "<PORT>",
"user": "avnadmin"
}
https://<HOSTNAME>:<PORT>
and use the avnadmin
user and related <PASSWORD>
to log in.cpu
metric group in the FROM
area. The metric we want to plot is the usage_user
which we can select in the field()
section. The settings should look like the belowusage_user
graph. The result should be similar to the following image, which is showing CPU usage consistently staying between 10% and 30% on my Mac.10s
as refresh interval.