Avoid exposing OpenCensus reference in public APIs#3253
Avoid exposing OpenCensus reference in public APIs#3253bogdandrutu merged 1 commit intoopen-telemetry:mainfrom
Conversation
ea7fcbb to
bf08eb0
Compare
obsreport/obsreport.go
Outdated
| type ObsMetrics struct { | ||
| Views []*view.View | ||
| } |
There was a problem hiding this comment.
Can we put this in internal so external users cannot construct it?
There was a problem hiding this comment.
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.
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.
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
| // 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.
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.
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
obsreportandobsreporttestpackages, there are 3 public APIs inobsreportare using OpenCensus View.Changes
obsreport.Configure()andAllViews()into internal folderobsreportconfigand madeAllViewsprivate, 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/obsmetricsTODO
obsreport.ProcessorMetricViewsfrom the package and update it's consumercontribpackage 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