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

MonitoredResource.Autodetect could be more useful running locally #128

Open
eliben opened this issue Apr 8, 2019 · 0 comments
Open

MonitoredResource.Autodetect could be more useful running locally #128

eliben opened this issue Apr 8, 2019 · 0 comments

Comments

@eliben
Copy link

eliben commented Apr 8, 2019

I'm trying to run locally with tracing to Stackdriver (for testing). Calling monitoredresource.AutoDetect() takes a while and returns a nil (unable to detect GCE/GKE/AWS), so the traces go nowhere.

It would be nice if it returned something more use useful for local use, such as a global resource - or had a constructor that would do this. As I workaround I have:

type GlobalMonitoredResource struct {
	projectId string
}

func (g GlobalMonitoredResource) MonitoredResource() (string, map[string]string) {
	return "global", map[string]string{"project_id": g.projectId}
}

And then pass an initialized instance of this struct into sdserver.NewExporter

@zombiezen

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

1 participant