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 #1378

Merged
merged 6 commits into from
May 11, 2020
Merged

Add metrics reporting #1378

merged 6 commits into from
May 11, 2020

Conversation

findkim
Copy link
Contributor

@findkim findkim commented May 5, 2020

This is the first step towards adding support for Consul Template monitoring. The changes integrate with OpenTelemetry to add stdout, prometheus, and dogstatsd metric sinks. Metric configuration and metric sample outputs are added to the README documentation.

Things to consider when configuring telemetry:

  • Namespace and global labels are currently not supported in this first version of metrics. Collecting metrics on multiple Consul Template instances may result in inaccurate gauge values.
  • Statsd is not yet supported by opentelemetry-go Remove dogstatsd and statsd support open-telemetry/opentelemetry-go#591; the support for statsd will be updated when the library does. The dogstatsd export option may or may not work for your metrics collector depending on the tags delimiter.

Enhancement request #1078 to integrate OpenCensus received a number of community votes, and since it has been merged to become OpenTelemetry, we decided to choose the OpenTelemetry library. OpenTelemetry was chosen over armon/go-metrics, which has been commonly used in various HashiCorp projects, for Consul Template as an experiment towards a new library that has dedicated support to expand on new sinks and has tracing functionality. For a period of time, there may be a mismatch in supported sinks between Consul and Consul-Template, but we do hope to update this regularly as OpenTelemetry expands.

Resolves #1338, resolves #826, resolves #1078

@findkim findkim requested review from a team May 5, 2020 17:37
Metrics will be configured in files and not through the CLI to
avoid unnecessarily expanding the CLI options.

Flush metrics on shutdown and configure dogstatsd reporting interval
Add no-op provider
Add documentation
Add telemetry config tests
Change instruments helper to accept nil meter
This allows metric collectors to distinguish the service metrics are
reported on. Add dep type to dependencies received counter for more
metadata on monitored changes to dependencies by type.
Status is more clear and uniform with the other metric labels.
config/convert.go Outdated Show resolved Hide resolved
config/convert.go Outdated Show resolved Hide resolved
config/convert.go Outdated Show resolved Hide resolved
The helper functions were initially added for completeness of
config/convert.go in supporting the copy function for all of the
supported types. However they remained unused and are now removed
to keep the code trimmed and can be easily re-added when needed.
@findkim findkim requested a review from eikenb May 11, 2020 22:58
Copy link
Contributor

@eikenb eikenb left a comment

Choose a reason for hiding this comment

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

Thanks for removing those unused functions. Looks good.

@eikenb eikenb added this to the 0.26.0 milestone May 11, 2020
@eikenb eikenb merged commit a6404e0 into hashicorp:master May 11, 2020
@findkim findkim deleted the metrics branch May 12, 2020 14:25
eikenb added a commit that referenced this pull request Jul 23, 2020
This reverts commit a6404e0, reversing
changes made to 15b9f25.
@eikenb eikenb removed this from the 0.26.0 milestone Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants