Skip to content

Commit

Permalink
remove cloud logging
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencl1013 committed Jul 17, 2020
1 parent 5432bae commit db1db6e
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions exporter/stackdriverexporter/spandata.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"errors"
"time"

"cloud.google.com/go/logging"
resourcepb "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
"github.com/golang/protobuf/ptypes"
Expand Down Expand Up @@ -167,21 +166,10 @@ func pdataStatusCodeToGRPCCode(c pdata.StatusCode) codes.Code {
}

func pdataAttributesToOTAttributes(attrs pdata.AttributeMap, resource pdata.Resource) []kv.KeyValue {
ctx := context.Background()
client, _ := logging.NewClient(ctx, "my-project-id")
logName := "spans"
logger := client.Logger(logName)

otAttrs := make([]kv.KeyValue, 0, attrs.Len())
//logger.Log(logging.Entry{Payload: map[string]interface{} {"num_pdata_attrs": attrs.Len()}})
appendAttrs := func(m pdata.AttributeMap) {
m.ForEach(func(k string, v pdata.AttributeValue) {
var newVal value.Value
logger.Log(logging.Entry{Payload: map[string]interface{} {"key": k}})
logger.Log(logging.Entry{Payload: map[string]interface{} {
// always giving "NULL"??
"val_type": pdata.AttributeValueType(v.Type()).String(),
}})
switch v.Type() {
case pdata.AttributeValueSTRING:
newVal = value.String(v.StringVal())
Expand All @@ -197,7 +185,6 @@ func pdataAttributesToOTAttributes(attrs pdata.AttributeMap, resource pdata.Reso
Key: kv.Key(k),
Value: newVal,
})
logger.Log(logging.Entry{Payload: map[string]interface{} {"ot_attrs": otAttrs}})
})
}
if !resource.IsNil() {
Expand Down

0 comments on commit db1db6e

Please sign in to comment.