You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
Please answer these questions before submitting a bug report.
What version of OpenCensus are you using?
v0.22.5
What version of Go are you using?
1.15
What did you do?
I wanted to add an extra label/tag to the ocgcrpc-generated server metrics: client ID, and export them with a custom view. See a sample gRPC+metrics server. In particular lines around clientIDValue.
Then I send a grpc.health.v1.Health/Check() request and check the /metrics output.
What did you expect to see?
I expected the value for the KeyGRPCClient OC tag to show up in the ocgrpc view, i.e. get populated in the prom exporter hander as client="[email protected]" label
What did you see instead?
The value from the Go/OC context is not propagated to the ocgrpc context. The exported metrics have the label client=""
, where the oc tag map in the context is overwritten with tag.NewContext() to populate it with the tags from grpc metadata.
Currently there's a NewContext() method in the tag module to overwrite the tags map and New() which is used with mutators to add/remove single value.
At a first glance the solution might be to add a new mutator to merge the provided map (similar to the one in New()) into the current context and use the mutator instead of tag.NewContext().
This looks somewhat related to #746 but this one seems to have an easy solution that doesn't introduce the mutability concerns.
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting a bug report.
What version of OpenCensus are you using?
v0.22.5
What version of Go are you using?
1.15
What did you do?
I wanted to add an extra label/tag to the ocgcrpc-generated server metrics: client ID, and export them with a custom view. See a sample gRPC+metrics server. In particular lines around
clientIDValue
.Then I send a
grpc.health.v1.Health/Check()
request and check the /metrics output.What did you expect to see?
I expected the value for the
KeyGRPCClient
OC tag to show up in the ocgrpc view, i.e. get populated in the prom exporter hander asclient="[email protected]"
labelWhat did you see instead?
The value from the Go/OC context is not propagated to the ocgrpc context. The exported metrics have the label
client=""
Additional context
I believe the problem is at
opencensus-go/plugin/ocgrpc/server_stats_handler.go
Line 43 in e736602
tag.NewContext()
to populate it with the tags from grpc metadata.Currently there's a
NewContext()
method in thetag
module to overwrite the tags map andNew()
which is used with mutators to add/remove single value.At a first glance the solution might be to add a new mutator to merge the provided map (similar to the one in
New()
) into the current context and use the mutator instead oftag.NewContext()
.This looks somewhat related to #746 but this one seems to have an easy solution that doesn't introduce the mutability concerns.
The text was updated successfully, but these errors were encountered: