Add trace export grpc-gateway config (#77)

Add API configuration file and auto-generate command and for HTTP/JSON -> gRPC gateway for the OpenCensus trace exporter service.

This will enable the opencensus-service to implement an HTTP endpoint for exporting traces.
pull/155/head
Dave Raffensperger 6 years ago committed by GitHub
parent 654f0722aa
commit ad721dcdba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/mkgogen.sh
  2. 9
      src/opencensus/proto/agent/trace/v1/trace_service_http.yaml

@ -4,6 +4,9 @@
# go get -d github.com/census-instrumentation/opencensus-proto
# to check in the repo to the GOAPTH.
#
# This also requires the grpc-gateway plugin.
# See: https://github.com/grpc-ecosystem/grpc-gateway#installation
#
# To generate:
#
# cd $(go env GOPATH)/census-instrumentation/opencensus-proto
@ -18,4 +21,5 @@ protoc --go_out=plugins=grpc:$OUTDIR opencensus/proto/stats/v1/stats.proto \
&& protoc --go_out=plugins=grpc:$OUTDIR opencensus/proto/trace/v1/trace_config.proto \
&& protoc -I=. --go_out=plugins=grpc:$OUTDIR opencensus/proto/agent/common/v1/common.proto \
&& protoc -I=. --go_out=plugins=grpc:$OUTDIR opencensus/proto/agent/metrics/v1/metrics_service.proto \
&& protoc -I=. --go_out=plugins=grpc:$OUTDIR opencensus/proto/agent/trace/v1/trace_service.proto
&& protoc -I=. --go_out=plugins=grpc:$OUTDIR opencensus/proto/agent/trace/v1/trace_service.proto \
&& protoc --grpc-gateway_out=logtostderr=true,grpc_api_configuration=./opencensus/proto/agent/trace/v1/trace_service_http.yaml:$OUTDIR opencensus/proto/agent/trace/v1/trace_service.proto

@ -0,0 +1,9 @@
# This is an API configuration to generate an HTTP/JSON -> gRPC gateway for the
# OpenCensus service using github.com/grpc-ecosystem/grpc-gateway.
type: google.api.Service
config_version: 3
http:
rules:
- selector: opencensus.proto.agent.trace.v1.TraceService.Export
post: /v1/trace
body: "*"
Loading…
Cancel
Save