Closed yanweiguo closed 4 years ago
cc @songy23 @rghetia Does it make sense to you?
Ah, GetMetricType func(view *view.View) string
is using view.View
. You are deprecating usage of view.View
. Then I think we need something similar to it, say GetMetricPrefix func(name string) string
MetricPrefix
metricTypeFromProto
)All of the above is definitely confusing. It should be fixed as follows
@yanweiguo , It is not clear why MetricPrefix will not work for you with exporting Metric?
If it doesn't work then we can implement GetMetricPrefix func()
. Not sure if should take string or Metric. I am leaning towards Metric because callee can make decision based on multiple parameters of Metric.
But before we add GetMetricPrefix
I would like to know why MetricPrefix does not work.
As I understand @yanweiguo wants this option in order to specify different prefixes based on the metric names.
But before we add
GetMetricPrefix
I would like to know why MetricPrefix does not work.
@rghetia Some of our metrics are reported to global
resource type with custom.googleapi.com/knative.dev
prefix and others are reported to other resource type, for example knative_revision
, with knative.dev
prefix. Similar to resource type, we need an option to dynamically decide the prefix based on the metric name.
Is your feature request related to a problem? Please describe. Description of
MetricPrefix
:It's about display name, however it is used as metric prefix here
Description of
GetMetricType
:However it is not used in
metrics.go
.Describe the solution you'd like Use
GetMetricType
instead ofMetricPrefix
to determine metric prefix.Describe alternatives you've considered My proposal is what is used in the old pipeline: https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/blob/61e3caa20a46015704f45956535fe83133eaf62e/stats.go#L564 I think it is a bug. Unless we want to change the behavior, then no alternatives are considered.