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
Fix Collector Metrics Prefix #530
Conversation
Fixes the Collector metrics prefix, from "oc_collector" to "otelcol" and make it configurable. Remove "oc_io" prefix from process metrics. Remove redundant "otelcol" prefix from observability metrics and "otelsvc_" from label keys.
Codecov Report
@@ Coverage Diff @@
## master #530 +/- ##
==========================================
+ Coverage 76.06% 76.09% +0.03%
==========================================
Files 126 126
Lines 7860 7870 +10
==========================================
+ Hits 5979 5989 +10
Misses 1584 1584
Partials 297 297
Continue to review full report at Codecov.
|
docs/service-extensions.md
Outdated
@@ -46,7 +46,7 @@ these sections would look like in the configuration file: | |||
|
|||
```yaml | |||
|
|||
# Example of the extensions provided in OTelSvc core. The list below | |||
# Example of the extensions available OOB with the Collector. The list below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does OOB stand for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of the box I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was really to to be out of the box, will avoid the acronym.
thanks! Is an empty string a valid prefix? We end up namespacing them anyways, at least in our metric system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is very unclear why this change is required, explicitly for the exported values like the tag keys.
observability/observability.go
Outdated
|
||
// TagKeyExporter defines tag key for Exporter. | ||
var TagKeyExporter, _ = tag.NewKey("otelsvc_exporter") | ||
var TagKeyExporter, _ = tag.NewKey("exporter") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, trying to get this change more visibility and coordinate release of it.
@rghetia this will break Google usage of the collector, you should review. |
observability/observability.go
Outdated
mExporterReceivedSpans = stats.Int64("exporter/received_spans", "Counts the number of spans received by the exporter", "1") | ||
mExporterDroppedSpans = stats.Int64("exporter/dropped_spans", "Counts the number of spans received by the exporter", "1") | ||
mExporterReceivedTimeSeries = stats.Int64("exporter/received_timeseries", "Counts the number of timeseries received by the exporter", "1") | ||
mExporterDroppedTimeSeries = stats.Int64("exporter/dropped_timeseries", "Counts the number of timeseries received by the exporter", "1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this is against the documentation in the opencensus which suggested to prefix metrics with the component name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, all metrics are prefixed with "otelcol" there is no need to repeat it here.
The goal is to get consistent and clear naming for the metrics improving discoverability and readability. Names like "oc_collector_otelsvc_*" can confuse first time users. Since it is a breaking change the time to do it is before it reaches its first official release. That said I know that the Collector is already being used in production so we need to make the breaking change. Reaching folks out to make this clear and perhaps consider some alternatives. |
Yes, I don't find a reason to prevent it. |
Changing those will be a breaking change for some. Limiting the scope of this change to only fixing the prefix, metrics rename/reorg will come in later.
I removed the renaming of metrics and labels and limited this one to just changing the prefix, but since it is a command-line flag one can still use the old one if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This package is going to allow controlled transition/rename of metrics. The initial implementation just prepares the way to remove the calls to the observability package. In order to be able to rename and change the metrics generated by the Collector without breaking current usage the obsreport package is being introduced. After this is merged a command-line flag can be added to control the generation of the different sets of metrics - initially with the default as legacy only. Link to tracking Issue: Needed for #141, see also the comments of PR #530 Testing: Besides the added tests I have a series of follow up PRs ready, I used these other PRs to manually validate the changes. Documentation: Please refer to doc.go in the new package.
…y#530) Bumps [boto3](https://github.com/boto/boto3) from 1.17.105 to 1.17.106. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](boto/boto3@1.17.105...1.17.106) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fixes the Collector metrics prefix, from "oc_collector" to "otelcol" and make it configurable.
Remove "oc_io" prefix from process metrics.
Remove redundant "otelcol" prefix from observability metrics and "otelsvc_" from label keys.
Description: Fix some basic metric naming issues and make the prefix configurable with default "otelcol".
Link to tracking Issue: Part of #141.
Testing: Manual verification and added a new test to ensure that the new command-line option is working as expected.
Documentation: Further documentation will come with other changes, for now recording the specific changes of this PR:
--metrics-prefix
flag.