-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Avoid exposing OpenCensus reference in public APIs #3253
Conversation
ea7fcbb
to
bf08eb0
Compare
obsreport/obsreport.go
Outdated
type ObsMetrics struct { | ||
Views []*view.View | ||
} |
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.
Can we put this in internal
so external users cannot construct it?
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.
obsreport.ProcessorMetricViews
uses it as input in a few components in contrib
. We'll need it for contrib changes.
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.
I think we should remove these calls, we should look into why is this called, and how we can get rid of it. I think they are mainly call into the ProcessorMetricViews
to standardize the name, but we have the BuildProcessorCustomMetricName
so mostly they can change to just build the name of the metrics with that call.
What do you think?
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.
Yes, you're right. I'll make the changes in separate PR since I've made this PR enough now to hide Configure()
and AllViews()
from external. Updated description as well. PTAL! Thanks
obsreport/obsreport.go
Outdated
@@ -62,15 +67,19 @@ func setParentLink(parentCtx context.Context, childSpan *trace.Span) bool { | |||
|
|||
// Configure is used to control the settings that will be used by the obsreport | |||
// package. | |||
func Configure(level configtelemetry.Level) (views []*view.View) { | |||
func Configure(level configtelemetry.Level) *ObsMetrics { |
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.
Probably this should be moved in internal if possible since this API will no longer exists when switching to otel metrics.
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.
Yes, made the changes and updated the PR description.
b7f9dcb
to
5848f4d
Compare
@mxiamxia need a rebase the circleCI is fix on head |
yes, rebased with the latest on head. |
Hey @mxiamxia & @bogdandrutu sorry to hijack this old MR. I am updating https://github.com/grafana/tempo to make use of the latest version of this component. It seems they made use of this views to expose opencesus metrics from their embedded receivers. grafana/tempo#1142 This PR mentions these api's are hidden in order to expose Opentelemetry metrics but I don't seem to see if that is already possible. They are wondering if we can keep these metrics ( |
Description:
Hide OpenCensus references from public APIs in
obsreport
andobsreporttest
packages, there are 3 public APIs inobsreport
are using OpenCensus View.Changes
obsreport.Configure()
andAllViews()
into internal folderobsreportconfig
and madeAllViews
private, only keep the necessary telemetry APIs inobsreport
. It helps to separate obsreport telemetry setup and collector telemetry reporting. Also, it hides the unnecessary public APIs.stats
) defines for each components into internal folderobsreportconfig/obsmetrics
TODO
obsreport.ProcessorMetricViews
from the package and update it's consumercontrib
package for above changes.Checklist,
obsreport
func Configure(level configtelemetry.Level) (views []*view.View) {}
func AllViews() (views []*view.View) {}
func ProcessorMetricViews(configType string, legacyViews []*view.View) []*view.View {}
Link to tracking Issue:
#2648
Testing:
make all