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

Add metrics reporting #53

Merged
merged 3 commits into from
Oct 2, 2020
Merged

Conversation

syndicut
Copy link
Contributor

@syndicut syndicut commented Oct 1, 2020

I added metrics reporting to support monitoring remco's state. This PR is inspired by this hashicorp/consul-template#1378 consul-template PR and metrics support in consul itself. Metrics are reported by go-metrics library (which is also used in consul and planned to be used in consul-template: hashicorp/consul-template#1395).

Exposed metrics:

  • files.template_execution_duration
    • Duration of template execution
  • files.check_command_duration
    • Duration of check_command execution
  • files.reload_command_duration
    • Duration of reload_command execution
  • files.stage_errors_total
    • Total number of errors in file staging action
  • files.staged_total
    • Total number of successfully files staged
  • files.sync_errors_total
    • Total number of errors in file syncing action
  • files.synced_total
    • Total number of successfully files synced
  • backends.sync_errors_total
    • Total errors in backend sync action
  • backends.synced_total
    • Total number of successfully synced backends

Copy link
Owner

@HeavyHorst HeavyHorst left a comment

Choose a reason for hiding this comment

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

This is great!

Just 2 nitpicks.

LGTM otherwise.

pkg/telemetry/prometheus.go Show resolved Hide resolved
pkg/telemetry/prometheus.go Outdated Show resolved Hide resolved
@syndicut
Copy link
Contributor Author

syndicut commented Oct 2, 2020

Updated PR with fixes to your comments and other small fixups. Hope you would not mind adding me to authors list as mentioned in contributing guide.

Fix import ordering
Add copyright header
Add comments to fix golint warnings
Add [email protected] to AUTHORS
Add prometheus endpoints to docs and fix error message
@HeavyHorst
Copy link
Owner

Thanks, great addition.

LGTM

@HeavyHorst HeavyHorst merged commit 2df9f57 into HeavyHorst:master Oct 2, 2020
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.

2 participants