Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of [CC-7434] Skip collecting data directory metrics in dev mode into release/1.18.x #20529

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #20521 to be assessed for backporting due to the inclusion of the label backport/1.18.

The below text is copied from the body of the original PR.


Description

Fixes an issue where in dev mode, the data directory is not set, so this metrics collection would always fail and logs errors.

2024-02-07T14:15:06.466-0600 [ERROR] agent.host_stats: failed to collect dataDir disk stats: error="failed to collect disk usage stats: no such file or directory"
2024-02-07T14:15:16.468-0600 [ERROR] agent.host_stats: failed to collect dataDir disk stats: error="failed to collect disk usage stats: no such file or directory"
2024-02-07T14:15:26.468-0600 [ERROR] agent.host_stats: failed to collect dataDir disk stats: error="failed to collect disk usage stats: no such file or directory"

Testing & Reproduction steps

Checked that metrics were skipped in dev mode:

  1. Started consul in dev mode (consul agent -dev)
  2. Inspected the logs to ensure this error was no longer outputted

Checked that metrics were collected otherwise:

  1. Started Consul in server mode and not dev mode (consul agent -server)
  2. Fetched the agent metrics (/v1/agent/metrics) and checked that there were data directory metrics:
...
        {
            "Name": "consul.mkam-host.host.disk.available",
            "Value": 135710160000,
            "Labels": {
                "path": ".mkam/data-dir"
            }
        },
        {
            "Name": "consul.mkam-host.host.disk.inodes_percent",
            "Value": 0.44313493,
            "Labels": {
                "path": ".mkam/data-dir"
            }
        },
...

Links

https://hashicorp.atlassian.net/browse/CC-7434

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@github-actions github-actions bot added the theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics label Feb 7, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved Consul Bot automated PR

@mkam mkam merged commit 044185e into release/1.18.x Feb 7, 2024
88 checks passed
@mkam mkam deleted the backport/mkam/CC-7434/host-metrics-dev/entirely-vocal-piglet branch February 7, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants