Skip to content

Commit 82ef179

Browse files
committed
Tweak naming of variables
1 parent 33762ae commit 82ef179

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This template provides a scalable solution for streaming data from Google Cloud
1818
The template requires two environment variables:
1919

2020
- `BETTER_STACK_SOURCE_TOKEN`: Your Better Stack source token
21-
- `BETTER_STACK_INGEST_HOST`: The Better Stack ingest host URL
21+
- `BETTER_STACK_INGESTING_HOST`: The Better Stack ingest host URL
2222

2323
## Building the Template
2424

@@ -28,14 +28,24 @@ git clone https://github.com/your-org/gcp-dataflow-pubsub-to-telemetry.git
2828
cd gcp-dataflow-pubsub-to-telemetry
2929
```
3030

31+
2. Choose Google Cloud Platform project to use
32+
```bash
33+
# See currently selected project
34+
gcloud config get-value project
35+
# You can switch to a different project using
36+
gcloud projects list
37+
gcloud config set project PROJECT_ID
38+
```
39+
3140
2. Build the Docker image:
3241
```bash
33-
docker build -t gcr.io/YOUR_PROJECT/pubsub-to-betterstack .
42+
docker build -t gcr.io/$(gcloud config get-value project)/pubsub-to-betterstack .
3443
```
3544

3645
3. Push the image to Google Container Registry:
3746
```bash
38-
docker push gcr.io/YOUR_PROJECT/pubsub-to-betterstack
47+
gcloud auth configure-docker
48+
docker push gcr.io/$(gcloud config get-value project)/pubsub-to-betterstack
3949
```
4050

4151
## Deploying the Template
@@ -48,7 +58,7 @@ You can deploy the template using the Google Cloud Console or the gcloud CLI:
4858
gcloud dataflow flex-template run "pubsub-to-betterstack-$(date +%Y%m%d-%H%M%S)" \
4959
--template-file-gcs-location=gs://YOUR_BUCKET/templates/pubsub-to-betterstack.json \
5060
--parameters input_subscription=projects/YOUR_PROJECT/subscriptions/YOUR_SUBSCRIPTION \
51-
--region=YOUR_REGION \
61+
--region=$(gcloud config get-value compute/region) \
5262
--additional-experiments=use_runner_v2
5363
```
5464

@@ -62,7 +72,7 @@ gcloud dataflow flex-template run "pubsub-to-betterstack-$(date +%Y%m%d-%H%M%S)"
6272
- `input_subscription`: Your PubSub subscription to read from
6373
6. Set the environment variables:
6474
- `BETTER_STACK_SOURCE_TOKEN`
65-
- `BETTER_STACK_INGEST_HOST`
75+
- `BETTER_STACK_INGESTING_HOST`
6676
7. Click "Run Job"
6777

6878
## Message Format

pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ def run(argv=None):
4545

4646
# Get Better Stack credentials from environment variables
4747
source_token = os.environ.get('BETTER_STACK_SOURCE_TOKEN')
48-
ingest_host = os.environ.get('BETTER_STACK_INGEST_HOST')
48+
ingest_host = os.environ.get('BETTER_STACK_INGESTING_HOST')
4949

5050
if not source_token or not ingest_host:
5151
raise ValueError(
52-
"Environment variables BETTER_STACK_SOURCE_TOKEN and BETTER_STACK_INGEST_HOST must be set"
52+
"Environment variables BETTER_STACK_SOURCE_TOKEN and BETTER_STACK_INGESTING_HOST must be set"
5353
)
5454

5555
pipeline_options = PipelineOptions(

0 commit comments

Comments
 (0)