Skip to content

Labels in /etc/sensu/agent.yml not reflected in Sensu UI #5059

@amitbasuri

Description

@amitbasuri

Expected Behavior

Labels defined in the /etc/sensu/agent.yml should appear in the Sensu UI for the respective agent.

Current Behavior

The Sensu UI does not display the labels defined in the agent.yml file. When the Sensu agent is started with the --label flag, labels appear in the UI, but not when they're configured directly in the agent.yml.

Possible Solution

A potential cause might be the Sensu UI not reloading or recognizing updates made to the agent.yml configuration file.

Steps to Reproduce (for bugs)

  1. Configure labels in /etc/sensu/agent.yml.
  2. Restart sensu-agent using systemctl.
  3. Observe that labels do not appear in the Sensu UI.
  4. Stop the agent and restart with the --labels flag, noting that labels now appear in the UI.

Context

This issue is causing difficulties in dynamically managing labels through configuration management tools like Ansible. My objective is to manage agent configuration solely through Ansible without needing additional flags at startup.

Your Environment

My Setup

sudo cat  /etc/sensu/agent.yml
---
#
# Managed by Ansible - do NOT edit this file manually!
#

##
# Sensu agent configuration
##
backend-url:
- ws://<sensu-backend>:8081

keepalive-interval: 5
keepalive-timeout: 10
labels:
    node_tag: mix-node-0
name: my-agent

Ansible

- name: Install, configure and run Sensu agents
  hosts: agents
  become: true
  tasks:
    - name: Install agent
      include_role:
        name: sensu.sensu_go.agent
      vars:
        agent_config:
          name: my-agent
          keepalive-interval: 5
          keepalive-timeout: 10
          labels:
            node_tag: "{{ node_tag }}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions