Closed Bug 1665365 Opened 5 years ago Closed 5 years ago

fix stage-submitter logging

Categories

(Socorro :: General, defect, P2)

Tracking

(Not tracked)

RESOLVED FIXED

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.

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?

Flags: needinfo?(bpitts)

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

Flags: needinfo?(bpitts)

This covers creating a client:

https://googleapis.dev/python/logging/latest/index.html#using-the-api

This covers integrating with the Python logging module:

https://googleapis.dev/python/logging/latest/stdlib-usage.html#integration-with-python-logging-module

I'll try to do that soon.

Assignee: nobody → willkg
Status: NEW → ASSIGNED

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.

Flags: needinfo?(bpitts)

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

Flags: needinfo?(bpitts)

Cool--will do that!

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.

Depends on: 1665978

This is working and I can see logs now. Marking as FIXED.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: