I'm trying to get stackdriver working with GCE. I went through the standard instructions to install (executing stack-install.sh --write-gcm
), however it doesn't seem to work at all. When I add monitoring alerts to watch processes, I get:
Process monitoring not available for this instance
In /var/log/messages
I see:
Mar 28 19:47:59 myhost stackdriver-agent: which: no java in (/root/.gvm/bin:/usr/local/sbin:/sbin
:/usr/sbin:/bin:/usr/bin:/go/bin:/bin)
Mar 28 19:47:59 myhost stackdriver-agent: Starting stackdriver-collectd: option = PIDFile; value
= /var/run/stackdriver-agent.pid;
Mar 28 19:47:59 myhost stackdriver-agent: option = Interval; value = 60.000000;
Mar 28 19:47:59 myhost stackdriver-agent: Created new plugin context.
Mar 28 19:47:59 myhost stackdriver-agent: [ OK ]
Mar 28 19:47:59 myhost collectd[1934]: Initialization complete, entering read-loop.
Mar 28 19:47:59 myhost systemd: Started LSB: start and stop Stackdriver Agent.
Mar 28 19:47:59 myhost collectd[1934]: match_throttle_metadata_keys: 1 history entries, 1 distinc
t keys, 71 bytes server memory.
Mar 28 19:47:59 myhost collectd[1934]: tcpconns plugin: Reading from netlink succeeded. Will use
the netlink method from now on.
Mar 28 19:47:59 myhost collectd[1934]: write_gcm: Asking metadata server for auth token
I have verified that the service is enabled. When I check the permissions, it says I don't need to need special credentials since I am using GCE. However, when I restart the stackdriver-extractor service, I get:
Please set STACKDRIVER_API_KEY in /etc/sysconfig/stackdriver
And so if I set that... I get:
stackdriver-extractor[3020]: Starting stackdriver-extractor: Unable to determine extractor endpoint!
stackdriver-extractor[3020]: Unable to generate config file
I feel like something is wrong at the project level where this service is not getting the key information automatically like it is supposed to.
I dug into the scripts and found where it gets it...
curl -f -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/project/attributes/stackdriver-agent-key
But this is getting a 404.
Also, when I check the scopes:
# curl --silent -f -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/scopes
https://www.googleapis.com/auth/cloud.useraccounts.readonly
https://www.googleapis.com/auth/devstorage.read_only
https://www.googleapis.com/auth/logging.write
https://www.googleapis.com/auth/monitoring.write
Any ideas? My ultimate problem is that I can't create alerts on the process counts, but I think this is where Stackdriver gets it from.