Skip to content

Don't ignore unit if NRestarts isn't available #1039

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

Merged
merged 2 commits into from
Aug 14, 2018

Conversation

jameshartig
Copy link
Contributor

@jameshartig jameshartig commented Aug 7, 2018

Pulled from #1036. The latest systemd in our CentOS is not new enough to have NRestarts so this effectively means the systemd collector cannot collect any services. Instead of ignoring a service without NRestarts, just log and leave it at 0.

Fixes: #567

@SuperQ @discordianfish

@SuperQ
Copy link
Member

SuperQ commented Aug 7, 2018

This is a duplicate of #1038.

@jameshartig
Copy link
Contributor Author

@SuperQ That was one was NRefused, I did mine for NRestarts. I'll update this to handle both cases

@SuperQ
Copy link
Member

SuperQ commented Aug 7, 2018

@fastest963 Nice, thanks!

}
unit.currentConnections = currentConnectionCount.Value.Value().(uint32)

// NRefused wasn't added until systemd 239
Copy link
Member

Choose a reason for hiding this comment

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

Nit, please end comments with a .

@SuperQ
Copy link
Member

SuperQ commented Aug 7, 2018

Would you mind updating the commit description with a full list of changes?

Also, please update the CHANGELOG with the changes.

@discordianfish
Copy link
Member

Beside @SuperQ's comment, LGTM!

* If NRestarts or NRefused are not available, don't ignore the unit itself
* Don't report systemd metrics (NRestarts/NRefused) that are not available

Signed-off-by: James Hartig <[email protected]>
@jameshartig
Copy link
Contributor Author

Thanks @SuperQ and @discordianfish! I just updated the commit message and changelog. I filed the ignoring units as BUGFIX and the not reporting as CHANGE, let me know if that's sufficient.

@xginn8
Copy link
Contributor

xginn8 commented Aug 8, 2018

@fastest963 ugh, sorry about that. Thank you for fixing!

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

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

LGTM

@discordianfish
Copy link
Member

@fastest963 Great, thanks! Just a final rebase to solve the changelog conflicts and we can merge this.
/cc @SuperQ

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

LGTM

@SuperQ SuperQ merged commit 60c8272 into prometheus:master Aug 14, 2018
@jameshartig jameshartig deleted the nrestarts branch August 16, 2018 20:49
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
…metheus#1039)

* If NRestarts or NRefused are not available, don't ignore the unit itself
* Don't report systemd metrics (NRestarts/NRefused) that are not available

Signed-off-by: James Hartig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants