Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

all: update opencensus-proto to latest version and add grpc-gateway Metrics release is made #607

Closed
odeke-em opened this issue Jul 18, 2019 · 1 comment · Fixed by #608
Closed
Assignees

Comments

@odeke-em
Copy link
Member

This issue is a placeholder to update to the opencensus-proto version that features Metrics for the grpc-gateway as per PR census-instrumentation/opencensus-proto#205

and then in the source code, we can add this

diff --git a/receiver/opencensusreceiver/opencensus.go b/receiver/opencensusreceiver/opencensus.go
index 1db22ab..abeba11 100644
--- a/receiver/opencensusreceiver/opencensus.go
+++ b/receiver/opencensusreceiver/opencensus.go
@@ -259,6 +259,11 @@ func (ocr *Receiver) startServer() error {
 				errChan <- err
 				return
 			}
+			err = agentmetricspb.RegisterMetricsServiceHandlerFromEndpoint(c, ocr.gatewayMux, endpoint, opts)
+			if err != nil {
+				errChan <- err
+				return
+			}
 
 			// Start the gRPC and HTTP/JSON (grpc-gateway) servers on the same port.
 			m := cmux.New(ocr.ln)

and then finally the grpc-gateway will be able to receive metrics in JSON form.

@odeke-em
Copy link
Member Author

Kindly paging @songy23 @draffensperger

@songy23 songy23 self-assigned this Jul 18, 2019
songy23 added a commit to songy23/opencensus-service that referenced this issue Jul 18, 2019
songy23 added a commit that referenced this issue Jul 18, 2019
* Add metrics service gRPC gateway. Upgrade deps.

Fixes #607

* Use a tag for ocagent exporter

* Add a simple unit test for metrics grpc gateway
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants