fix stage-submitter logging
Categories
(Socorro :: General, defect, P2)
Tracking
(Not tracked)
People
(Reporter: willkg, Assigned: willkg)
References
Details
Attachments
(2 files)
The stage-submitter logs aren't captured anywhere (as far as I understand it). That makes it difficult to debug when things go awry.
This bug covers fixing stage-submitter logging so that we can see them.
| Assignee | ||
Comment 1•5 years ago
|
||
Brian: A week or two ago, we talked about logging and the stage-submitter briefly. Can you walk me through what we need to change to get logs somewhere they can be viewed?
Comment 2•5 years ago
|
||
Logs are currently going to https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html . I can access them, but unfortunately you can't.
To get them in stackdriver alongside the other socorro logs, you could modify the lambda to use the stackdriver logging client library.
https://cloud.google.com/logging/docs/reference/libraries
https://googleapis.github.io/google-cloud-python/latest/logging/usage.html
| Assignee | ||
Comment 3•5 years ago
|
||
This covers creating a client:
https://googleapis.dev/python/logging/latest/index.html#using-the-api
This covers integrating with the Python logging module:
I'll try to do that soon.
| Assignee | ||
Comment 4•5 years ago
|
||
Brian: How do you want to provide credentials to set up the stackdriver logging client library? I think I can get it to take a path to a service account file. I don't know if I can configure it via environment variables, but maybe.
Comment 5•5 years ago
|
||
I don't think I have a way of passing in configuration other than an environment variable. I think I should stick the service account credentials json blob in one, and you should load from there and pass it explicitly when creating the client.
This goes into the overall flow https://googleapis.dev/python/google-api-core/latest/auth.html#explicit-credentials
ANd step 3 at this link has what looks like a relevant code sample https://google-auth.readthedocs.io/en/latest/user-guide.html#service-account-private-key-files
| Assignee | ||
Comment 6•5 years ago
|
||
Cool--will do that!
| Assignee | ||
Comment 7•5 years ago
|
||
| Assignee | ||
Comment 8•5 years ago
|
||
| Assignee | ||
Comment 9•5 years ago
•
|
||
This requires a new SUBMITTER_GCP_CREDENTIALS environment variable which is the contents of the service account key file. I'll tell Brian about that for the next deploy.
| Assignee | ||
Comment 10•5 years ago
|
||
| Assignee | ||
Comment 11•5 years ago
|
||
| Assignee | ||
Comment 12•5 years ago
|
||
This is working and I can see logs now. Marking as FIXED.
Description
•