Skip to content
New issue

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

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

Already on GitHub? # to your account

Issue with ha_cluster_pacemaker_config_last_change and timezone #187

Open
rudexi opened this issue Mar 16, 2021 · 1 comment
Open

Issue with ha_cluster_pacemaker_config_last_change and timezone #187

rudexi opened this issue Mar 16, 2021 · 1 comment

Comments

@rudexi
Copy link

rudexi commented Mar 16, 2021

Software used:

  • CentOS 8.2
  • ha_cluster_exporter 1.2.1
  • pacemaker 2.0.3-5

I'm experiencing issues with the ha_cluster_pacemaker_config_last_change metric.
It does report the time in Unix time format, but it takes the time as if it was GMT, while crm_mon reports it without any timestamp markup, resulting in the error.
This error is very noticeable for time zones in advance from GMT, since the reported time is in the future.

Here is more data to illustrate the issue:

$ date
Tue Mar 16 09:01:17 JST 2021

$ curl -s localhost:9664/metrics|grep ^ha_cluster_pacemaker_config_last_change
ha_cluster_pacemaker_config_last_change 1.615884919e+09

$ date -d @1615884919
Tue Mar 16 17:55:19 JST 2021

$ sudo crm_mon -X --inactive|grep last_change
    <last_change time="Tue Mar 16 08:55:19 2021" user="root" client="crm_attribute" origin="host01"/>

$ date -d 'Tue Mar 16 08:55:19 2021'
Tue Mar 16 08:55:19 JST 2021

$ date -d 'Tue Mar 16 08:55:19 2021 GMT'
Tue Mar 16 17:55:19 JST 2021

Several possibilities for fixing this:

  • Modify ClusterLabs/pacemaker to make them include a parsable timezone information
  • Fix the resulting Time object by attaching the timezone of the running system (since the time reported is relative the the system timezone)
@stefanotorresi
Copy link
Member

I wasn't aware that crm_mon would report the time as local, I assumed it was UTC, my bad!
It totally makes sense to convert it to UTC when we collect it in the exporter.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants