{"action":"created","issue":{"url":"https://api.github.com/repos/census-ecosystem/opencensus-go-exporter-stackdriver/issues/1","repository_url":"https://api.github.com/repos/census-ecosystem/opencensus-go-exporter-stackdriver","labels_url":"https://api.github.com/repos/census-ecosystem/opencensus-go-exporter-stackdriver/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/census-ecosystem/opencensus-go-exporter-stackdriver/issues/1/comments","events_url":"https://api.github.com/repos/census-ecosystem/opencensus-go-exporter-stackdriver/issues/1/events","html_url":"https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/issues/1","id":317246622,"number":1,"title":"No Resource information tied with traces?","user":{"login":"someone1","id":1321933,"avatar_url":"https://avatars1.githubusercontent.com/u/1321933?v=4","gravatar_id":"","url":"https://api.github.com/users/someone1","html_url":"https://github.com/someone1","followers_url":"https://api.github.com/users/someone1/followers","following_url":"https://api.github.com/users/someone1/following{/other_user}","gists_url":"https://api.github.com/users/someone1/gists{/gist_id}","starred_url":"https://api.github.com/users/someone1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/someone1/subscriptions","organizations_url":"https://api.github.com/users/someone1/orgs","repos_url":"https://api.github.com/users/someone1/repos","events_url":"https://api.github.com/users/someone1/events{/privacy}","received_events_url":"https://api.github.com/users/someone1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-24T14:15:05Z","updated_at":"2018-04-24T14:41:40Z","closed_at":null,"author_association":"NONE","body":"I am moving to this library from `cloud.google.com/go/trace` due to the obsolete notice, but noticed a few things that has me scratching my head. \r\n\r\nI setup the package as follows (I'm using AppEngine Flexible):\r\n\r\n```go\r\nimport (\r\n\t\"net/http\"\r\n\t\"os\"\r\n\r\n\t\"contrib.go.opencensus.io/exporter/stackdriver\"\r\n\t\"contrib.go.opencensus.io/exporter/stackdriver/propagation\"\r\n\t\"go.opencensus.io/plugin/ocgrpc\"\r\n\t\"go.opencensus.io/plugin/ochttp\"\r\n\t\"go.opencensus.io/stats/view\"\r\n\t\"go.opencensus.io/trace\"\r\n\tmrpb \"google.golang.org/genproto/googleapis/api/monitoredres\"\r\n)\r\n\r\nfunc InitTraceClient() error {\r\n        res := &mrpb.MonitoredResource{}\r\n\tres.Type = \"gae_app\"\r\n\tres.Labels = make(map[string]string)\r\n\tres.Labels[\"project_id\"] = os.Getenv(\"GOOGLE_CLOUD_PROJECT\")\r\n\tres.Labels[\"module_id\"] = os.Getenv(\"GAE_SERVICE\")\r\n\tres.Labels[\"version_id\"] = os.Getenv(\"GAE_VERSION\")\r\n\r\n\texporter, err := stackdriver.NewExporter(stackdriver.Options{\r\n\t\tProjectID: os.Getenv(\"GOOGLE_CLOUD_PROJECT\"),\r\n\t\tResource:  res,\r\n\t})\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tview.RegisterExporter(exporter)\r\n\ttrace.RegisterExporter(exporter)\r\n\r\n\tif err = view.Register(ochttp.DefaultClientViews...); err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tif err = view.Register(ocgrpc.DefaultClientViews...); err != nil {\r\n\t\treturn err\r\n\t}\r\n        return nil\r\n}\r\n```\r\n\r\nFor my datastore client I do:\r\n\r\n```go\r\nfunc getDatastoreClient(ctx context.Context) (*datastore.Client, error) {\r\n\tvar options []option.ClientOption\r\n\toptions = append(options, option.WithGRPCDialOption(grpc.WithStatsHandler(&ocgrpc.ClientHandler{})))\r\n\treturn datastore.NewClient(ctx, \"\", options...)\r\n}\r\n```\r\n\r\nAnd I add middleware to start tracing on every request:\r\n\r\n```go\r\nfunc TraceHandler(h http.Handler) http.Handler {\r\n\ttraceHandler := &ochttp.Handler{\r\n\t\tHandler:          h,\r\n\t\tPropagation:      &stackdriver.HTTPFormat{},\r\n\t\tIsPublicEndpoint: false, // I've tried true here as well...\r\n\t\tStartOptions: trace.StartOptions{\r\n\t\t\tSampler: trace.AlwaysSample(),\r\n\t\t},\r\n\t}\r\n\tfn := func(w http.ResponseWriter, r *http.Request) {\r\n\t\ttraceHandler.Handler.ServeHTTP(w, r)\r\n\t}\r\n\treturn http.HandlerFunc(fn)\r\n}\r\n```\r\n\r\nHowever, I get no HTTP traces in StackDriver, just datastore ones and other gRPC traces I didn't even intend to monitor (Logging). There are no labels associated with the spans to help identify the service/version/http request the spans originated from. \r\n\r\n![image](https://user-images.githubusercontent.com/1321933/39192779-fa05ec26-47a7-11e8-8f68-88715e1ef3a7.png)\r\n\r\n\r\nAm I missing something or is this package still not ready to trace requests like `cloud.google.com/go/trace` is able to?\r\n\r\nThanks for this feature in general, it's a really helpful tool and I really like the idea of OpenCensus!"},"comment":{"url":"https://api.github.com/repos/census-ecosystem/opencensus-go-exporter-stackdriver/issues/comments/383958135","html_url":"https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/issues/1#issuecomment-383958135","issue_url":"https://api.github.com/repos/census-ecosystem/opencensus-go-exporter-stackdriver/issues/1","id":383958135,"user":{"login":"someone1","id":1321933,"avatar_url":"https://avatars1.githubusercontent.com/u/1321933?v=4","gravatar_id":"","url":"https://api.github.com/users/someone1","html_url":"https://github.com/someone1","followers_url":"https://api.github.com/users/someone1/followers","following_url":"https://api.github.com/users/someone1/following{/other_user}","gists_url":"https://api.github.com/users/someone1/gists{/gist_id}","starred_url":"https://api.github.com/users/someone1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/someone1/subscriptions","organizations_url":"https://api.github.com/users/someone1/orgs","repos_url":"https://api.github.com/users/someone1/repos","events_url":"https://api.github.com/users/someone1/events{/privacy}","received_events_url":"https://api.github.com/users/someone1/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T14:41:40Z","updated_at":"2018-04-24T14:41:40Z","author_association":"NONE","body":"And of course I figure out it was an issue on my end as soon as I post the issue... Middleware was wrong by using the passed in Handler vs the `ochttp` one...\r\n\r\nShould be:\r\n\r\n```go\r\n        fn := func(w http.ResponseWriter, r *http.Request) {\r\n\t\ttraceHandler.ServeHTTP(w, r)\r\n\t}\r\n```\r\n\r\nHowever, I'm still not sure how to link things like Service/Version to the traces, are there special labels we can use? Is there a master list of all special labels for the Stackdriver platform and/or to AppEngine specifically somewhere?"}}
{"actor":{"display_login":"someone1"}}