Skip to content

Commit

Permalink
Fix import path from gen-go files. (#17)
Browse files Browse the repository at this point in the history
* Fix import path from gen-go files.

* Update opencensus-proto in vendor directory.

* Fix package name conflict.
  • Loading branch information
songy23 authored Aug 30, 2018
1 parent a38ab70 commit b987f0c
Show file tree
Hide file tree
Showing 21 changed files with 4,848 additions and 2,852 deletions.
2 changes: 1 addition & 1 deletion cmd/opencensusd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"os"
"os/signal"

pb "github.com/census-instrumentation/opencensus-proto/gen-go/exporterproto"
pb "github.com/census-instrumentation/opencensus-proto/gen-go/exporter/v1"
"github.com/census-instrumentation/opencensus-service/cmd/opencensusd/exporter"
"github.com/census-instrumentation/opencensus-service/internal"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion cmd/opencensusd/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package main

import (
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/traceproto"
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
"github.com/golang/protobuf/ptypes"
"go.opencensus.io/trace"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/opencensusd/proto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"
"time"

tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/traceproto"
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
"github.com/golang/protobuf/ptypes"
"go.opencensus.io/trace"
)
Expand Down
16 changes: 8 additions & 8 deletions exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"go.opencensus.io/trace"
"google.golang.org/grpc"

"github.com/census-instrumentation/opencensus-proto/gen-go/exporterproto"
"github.com/census-instrumentation/opencensus-proto/gen-go/traceproto"
exporterpb "github.com/census-instrumentation/opencensus-proto/gen-go/exporter/v1"
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
"github.com/census-instrumentation/opencensus-service/internal"
"github.com/golang/protobuf/ptypes/timestamp"
)
Expand All @@ -47,7 +47,7 @@ type Exporter struct {

clientMu sync.Mutex
clientEndpoint string
spanClient exporterproto.Export_ExportSpanClient
spanClient exporterpb.Export_ExportSpanClient
}

func (e *Exporter) init() {
Expand Down Expand Up @@ -96,7 +96,7 @@ func (e *Exporter) lookup() {
e.clientMu.Lock()
defer e.clientMu.Unlock()

client := exporterproto.NewExportClient(conn)
client := exporterpb.NewExportClient(conn)
e.spanClient, err = client.ExportSpan(context.Background())
if err != nil {
e.onError(err)
Expand Down Expand Up @@ -129,11 +129,11 @@ func (e *Exporter) ExportSpan(sd *trace.SpanData) {
}

debugPrintf("Exporting span [%v]", sd.SpanContext)
s := &traceproto.Span{
s := &tracepb.Span{
TraceId: sd.SpanContext.TraceID[:],
SpanId: sd.SpanContext.SpanID[:],
ParentSpanId: sd.ParentSpanID[:],
Name: &traceproto.TruncatableString{
Name: &tracepb.TruncatableString{
Value: sd.Name,
},
StartTime: &timestamp.Timestamp{
Expand All @@ -147,8 +147,8 @@ func (e *Exporter) ExportSpan(sd *trace.SpanData) {
// TODO(jbd): Add attributes and others.
}

if err := spanClient.Send(&exporterproto.ExportSpanRequest{
Spans: []*traceproto.Span{s},
if err := spanClient.Send(&exporterpb.ExportSpanRequest{
Spans: []*tracepb.Span{s},
}); err != nil {
if err == io.EOF {
debugPrintf("Connection is unavailable; will try to reconnect in a minute")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b987f0c

Please sign in to comment.