Jira (FACT-2838) Some facts are volatile (changes almost every fact upload)

23 views
Skip to first unread message

Lukas Zapletal (Jira)

unread,
Oct 16, 2020, 4:47:03 AM10/16/20
to puppe...@googlegroups.com
Lukas Zapletal created an issue
 
Facter / Bug FACT-2838
Some facts are volatile (changes almost every fact upload)
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/10/16 1:46 AM
Priority: Normal Normal
Reporter: Lukas Zapletal

Hello,

Some facts are volatile, they change quite often and I doubt about their value in the inventory as Facter should not be used as a "monitoring tool". Most of them can be blocklisted in facter4, which is a great feature, however I've identified few which probably needs an "stable" alternative. I was able to identify the following facts:

```
load_averages:
15m: 0.57
1m: 0.34
5m: 0.47
```

This is straight-up not a good fact for a configuration management inventory. But you probably don't want to break facter so let's just blocklist it.

```
memory:
swap:
available: 33.00 GiB
available_bytes: 35433476096
capacity: 0.00%
used: "0 bytes"
used_bytes: 0
system:
available: 23.70 GiB
available_bytes: 25444986880
capacity: 13.77%
used: 4.31 GiB
used_bytes: 4627849216
```

The same case, the only interesting ones are "totals". These change every fact upload, can be blocklisted too.

Unfortunately, here is one that cannot be blocklisted:

```
system_uptime:
days: 0
hours: 1
seconds: 5058
uptime: "1:24 hours"
```

The correct approach would be to report something like "boot_time" in UTC which can be easily used to calculate uptime for humans. Adding such fact would greatly help.

The last one I was able to identify on my system was:

```
processors:
models:
speed: 1.38 GHz
```

My CPU has variable speed depending on load. Facter reports current speed which is not much useful, I think this might be actually a bug. Usually you want to see number of CPUs, model, cores and clock information to plan deployments accordingly.

So here it is, my analysis showed that two facts (uptime and processor speed) needs to be fixed. To remain backward compatibility these probably needs some alternatives and users could be instructed to blocklist the original ones if they don't want to put too much database stress on their inventory databases. For the record, here is the full blocklist:

 

```

facts :

{ blocklist : [ "load_averages", "identity", "memory.system.capacity", "memory.system.used*", "memory.system.available*", "memory.swap.capacity", "memory.swap.used*", "memory.swap.available*", "system_uptime", "processors.speed", ] }

```{{}}

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Bogdan Irimie (Jira)

unread,
Oct 16, 2020, 8:56:02 AM10/16/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sub-team: ghost
Team: Night's Watch

Bogdan Irimie (Jira)

unread,
Oct 20, 2020, 8:50:04 AM10/20/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Oct 21, 2020, 9:39:03 AM10/21/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Issue Type: Bug Task
Priority: Normal Low

Bogdan Irimie (Jira)

unread,
Oct 21, 2020, 9:40:03 AM10/21/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Oct 21, 2020, 9:46:03 AM10/21/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ready for triage ghost-28.10

Bogdan Irimie (Jira)

unread,
Oct 27, 2020, 9:48:14 AM10/27/20
to puppe...@googlegroups.com
Bogdan Irimie commented on Task FACT-2838
 
Re: Some facts are volatile (changes almost every fact upload)

Lukas Zapletal I think there are 3 different issues here:

  1. `system_uptime` or 'uptime' facts cannot be blocked (bug)
  2. cpu speed should report manufacturer CPU speed not current speed (bug/suggestion)
  3. removal/replacement of some ephemeral facts (suggestion)

 

Did I understand correctly?

Bogdan Irimie (Jira)

unread,
Oct 28, 2020, 8:54:03 AM10/28/20
to puppe...@googlegroups.com

Tested `system_uptime` blocking on macOS 10.15

when no facts are blocked

facter -c facter.conf system_uptime       
{
  days => 7,
  hours => 170,
  seconds => 613197,
  uptime => "7 days"
}

when the block list you provided is used

  blocklist : [  "load_averages", "identity", "memory.system.capacity", "memory.system.used*", "memory.system.available*", "memory.swap.capacity", "memory.swap.used*", "memory.swap.available*", "system_uptime", "processors.speed" ],

 bundle exec facter -c facter.conf system_uptime

nothing is printed because the fact was blocked

Bogdan Irimie (Jira)

unread,
Oct 28, 2020, 9:01:03 AM10/28/20
to puppe...@googlegroups.com

Tested on ubuntu 20.04

with no fact blocked

facter system_uptime
{
  days => 0,
  hours => 3,
  seconds => 14183,
  uptime => "3:56 hours"
}

with system_uptime blocked

facter -c facter.conf system_uptime

Bogdan Irimie (Jira)

unread,
Oct 28, 2020, 10:10:04 AM10/28/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-28.10 , PR - Triage 2

Bogdan Irimie (Jira)

unread,
Nov 4, 2020, 9:11:03 AM11/4/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-28.10, ghost-4.11 , PR - Triage 2

Bogdan Irimie (Jira)

unread,
Nov 18, 2020, 8:50:04 AM11/18/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-28.10, ghost-4.11, ghost-11.11 , ready for triage 2

Bogdan Irimie (Jira)

unread,
Nov 25, 2020, 9:04:04 AM11/25/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-28.10, ghost-4.11, ghost-11.11, ghost 25.11 , ready for triage 2

Bogdan Irimie (Jira)

unread,
Dec 2, 2020, 2:40:04 AM12/2/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-28.10, ghost-4.11, ghost-11.11, ghost 25.11, ghost-2.12 , ready for triage 2

Bogdan Irimie (Jira)

unread,
Jun 30, 2021, 2:31:02 AM6/30/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sub-team: ghost
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Ciprian Badescu (Jira)

unread,
Oct 20, 2021, 4:56:02 AM10/20/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Sprint: ghost-28.10, ghost-4.11, ghost-11.11, ghost 25.11, ghost-2.12 , ready for triage 2

Josh Cooper (Jira)

unread,
Apr 26, 2023, 5:05:03 PM4/26/23
to puppe...@googlegroups.com
Josh Cooper commented on Task FACT-2838
 
Re: Some facts are volatile (changes almost every fact upload)

The one unresolved issue in this ticket is to add a group of volatile facts which is something that is already possible today, so I'm going to close this. If you'd like to contribute a pull request to add a predefined volatile fact group, then please reopen and let us know when you've submitted the PR.

This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages