Update grafana_agent/agent.yaml.example

Bug #1997975 reported by Diego Mascialino
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Alexsander de Souza
MAAS documentation
In Progress
High
Bill Wear

Bug Description

The current example for agent configuration file has deprecated fields.

More information in:
https://grafana.com/docs/agent/latest/upgrade-guide/#deprecation-on-yaml-fields-in-server-block-that-have-flags

We need to update our example, and our guide to set up metrics ( https://maas.io/docs/how-to-set-up-maas-metrics ) with new command.

Example, using:
agent-linux-amd64_0_28_0

root@diego-maas-ss:~# head /opt/agent/agent.yml
server:
  http_listen_address: 0.0.0.0
  http_listen_port: 3100
  grpc_listen_address: 0.0.0.0
  grpc_listen_port: 9095
  log_level: info

metrics:
  wal_directory: ${AGENT_WAL_DIR}
  global:
root@diego-maas-ss:~# HOSTNAME="maas-system-maas" AGENT_WAL_DIR="/var/lib/grafana-agent/wal" AGENT_POS_DIR="/var/lib/grafana-agent/positions" PROMETHEUS_REMOTE_WRITE_URL="http://10.245.136.5:9090/api/v1/write" LOKI_API_URL="http://10.245.136.5:3100/loki/api/v1/push" MAAS_LOGS="/var/snap/maas/common/log/" MAAS_IS_REGION="true" MAAS_IS_RACK="true" MAAS_AZ="default" /opt/agent/agent-linux-amd64 -config.expand-env -config.file=/opt/agent/agent.yml
2022-11-25 13:54:14.895144 I | error loading config file /opt/agent/agent.yml: yaml: unmarshal errors:
  line 2: field http_listen_address not found in type server.config
  line 3: field http_listen_port not found in type server.config
  line 4: field grpc_listen_address not found in type server.config
  line 5: field grpc_listen_port not found in type server.config

Related branches

Revision history for this message
Diego Mascialino (dmascialino) wrote :

new flags are:
- server.http.address
- server.grpc.address

So we have to remove: http_listen_address, http_listen_port, grpc_listen_address and grpc_listen_port fields from config file.

And execute this line:

HOSTNAME="maas-system-maas" AGENT_WAL_DIR="/var/lib/grafana-agent/wal" AGENT_POS_DIR="/var/lib/grafana-agent/positions" PROMETHEUS_REMOTE_WRITE_URL="http://10.245.136.5:9090/api/v1/write" LOKI_API_URL="http://10.245.136.5:3100/loki/api/v1/push" MAAS_LOGS="/var/snap/maas/common/log/" MAAS_IS_REGION="true" MAAS_IS_RACK="true" MAAS_AZ="default"
/opt/agent/agent-linux-amd64 -config.expand-env -config.file=/opt/agent/agent.yml -server.http.address="0.0.0.0:3100" -server.grpc.address="0.0.0.0:9095"

Changed in maas:
status: New → Triaged
importance: Undecided → High
milestone: none → 3.3.0
Bill Wear (billwear)
Changed in maas:
assignee: nobody → Bill Wear (billwear)
assignee: Bill Wear (billwear) → nobody
Changed in maas-offline-docs:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Bill Wear (billwear)
Changed in maas:
assignee: nobody → Alexsander de Souza (alexsander-souza)
Changed in maas:
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: 3.3.0 → 3.3.0-rc1
status: Fix Committed → Fix Released
Bill Wear (billwear)
Changed in maas-doc:
status: Triaged → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.