Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Stackdriver exporters: automatically determine project_id #324

Open
g-easy opened this issue Jun 3, 2019 · 2 comments
Open

Stackdriver exporters: automatically determine project_id #324

g-easy opened this issue Jun 3, 2019 · 2 comments

Comments

@g-easy
Copy link
Contributor

g-easy commented Jun 3, 2019

When running on GCE, this should be doable via the metadata server: https://cloud.google.com/compute/docs/storing-retrieving-metadata#default

@mandarjog
Copy link

/subscribe

@alichnewsky
Copy link

sample implementation in a test program here. Uses cpr as an idiomatic wrapper to libcurl.

  • needs to be encapsulated, moved to a library ( in opencensus/common/internal/cloud ? ). Unless a dedicated, idiomatic library is provided by google-cloud-cpp.
  • needs to make the distinction between GCE VM, GKE container/pod, ( a docker container inside GCE VM? inside AppEngine flex ? inside Cloud Run ? they will have different well known google.api.MonitoredResource objects and labels...)
  • a lingering question remains in my mind on the difference between the project id at the monitored resource level and as a monitored resource label (lines 210-213) . Are they the same when on GCE VM? if a workspace monitors multiple project, does the code submitting the metric need to know a 'stackdriver project id ?'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants