This service is responsible for sinking pub/sub messages from enrich bad topic to BigQuery. It is written in Python and uses the Google Cloud Pub/Sub and BigQuery libraries.
- Python 3.10+
- Google Cloud SDK
- Install the required dependencies:
pip install -r requirements.txt
- Set the required environment variables:
GCP_PROJECT_ID
- project idENRICH_BAD_SUB
- subscription id of topic where bad messages are publishedBIGQUERY_DATASET
- dataset id in bigqueryBIGQUERY_TABLE
- table id in bigquery
export GCP_PROJECT_ID=<project-id>
export ENRICH_BAD_SUB=<subscription-id>
export BIGQUERY_DATASET=<dataset-id>
export BIGQUERY_TABLE=<table-id>
- Run the service:
python main.py
Deploy project to GCP using cloud build command:
gcloud builds submit --config=cloudbuild.yaml .
Query example for enrich bad data
SELECT
*,
SPLIT(JSON_EXTRACT(data, '$.failure.messages[0].schemaKey'), '/')[OFFSET(1)] as event_name
FROM `<project-id>.gametuner_monitoring.enrich_bad_events`
WHERE DATE(load_tstamp) = CURRENT_DATE()
The GameTuner ETL service is copyright 2022-2024 AlgebraAI.
GameTuner ETL service is released under the Apache 2.0 License.