matt_elgazar
02/13/2024, 9:34 PMimport google.cloud.logging
client = google.cloud.logging.Client()
client.setup_logging()
<http://logging.info|logging.info>("*** INFO ***")
logging.critical("*** CRITICAL ***")
I like that gcp cloud logging captures the severity level, which I haven’t figured out how to do using meltano / docker -> gcp.Edgar Ramírez (Arch.dev)
02/14/2024, 12:10 AMmatt_elgazar
02/15/2024, 5:16 AMmeltano test
with the error Unable to configure handler 'google'
• On Ubuntu, all steps in that doc work. I am able to see logs from running meltano test
but not when running an actual tap. I assume this may have something to do with the log messages being too big / long? Or something to do with google cloud storage?
Take my tap-yfinance
tap. Running meltano el tap-yfinance target-jsonl --select futures_tickers
will actually complete the tap but the logs don’t get sent to GCP cloud logging. I get this error:
Program shutting down now, attempting to send 12724 queued log entries to Cloud Logging...
Waiting up to 5 seconds.
Failed to send 12203 pending logs.
I thought maybe this could have something to do with invalid credentials or issue reading .env variables, so I hard coded every env variable to rule that out. Got the same error 😞matt_elgazar
02/15/2024, 5:26 AMstate-backend
section, I get the following error:
meltano el tap-yfinance target-jsonl --select futures_tickers
Need help fixing this problem? Visit <http://melta.no/> for troubleshooting steps, or to
join our friendly Slack community.
ELT could not be completed: Cannot start extractor: module 'google.cloud' has no attribute 'storage'.
For more detailed log messages re-run the command using 'meltano --log-level=debug ...' CLI flag.
Note that you can also check the generated log file at '/home/oem/scripts/dev/ds-mono-repo/projects/financial_elt/tap-yfinance/.meltano/logs/elt/2024-02-15T052410--tap-yfinance--target-jsonl/75cff2c3-81cc-4fb8-9717-e0b361aa91fa/elt.log'.
For more information on debugging and logging: <https://docs.meltano.com/reference/command-line-interface#debugging>
Program shutting down, attempting to send 14 queued log entries to Cloud Logging...
Waiting up to 5 seconds.
Sent all pending logs
matt_elgazar
02/15/2024, 6:28 PMEdgar Ramírez (Arch.dev)
02/16/2024, 1:58 AMmeltano run tap-getpocket target-jsonl --full-refresh
from my machine:
Program shutting down, attempting to send 3 queued log entries to Cloud Logging...
Waiting up to 5 seconds.
Sent all pending logs.
It's not as many logs as you were trying to send but 12724
still doesn't look like that large a number 🤔.
That said, I'm pretty sure there's an even easier way to send logs to cloud logging with the Ops Agent, logging.FileHandler
and meltano.core.logging.json_formatter
. I've yet to try that though 😅
when I uncomment theThat means you probably need to installsection, I get the following error:state-backend
meltano[gcs]
Edgar Ramírez (Arch.dev)
02/16/2024, 3:18 PMmatt_elgazar
02/16/2024, 5:41 PMgoogle.yaml
to logging.yaml
. I guess there was an issue with the name google.yaml
, which is weird because it’s specified in meltano.yml.
• The new steps aren’t working for me (I’m on a local ubuntu machine, not a GCP VM). Are you running this on a gcp vm? Do you think this would work on any machine (not necessarily a GCP vm)?matt_elgazar
02/16/2024, 5:43 PMmatt_elgazar
02/17/2024, 4:03 AMmatt_elgazar
02/17/2024, 4:52 AM