You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Allow configuration through environment variables
* Use nonroot image, require parameters, add version parameter
* Adding config for build automation
* Add config to release to quay.io
* Update documentation and add image build
[](https://quay.io/repository/kohlstechnology/prometheus_bigquery_remote_storage_adapter)
6
+
3
7
This is a write adapter that receives samples via Prometheus's remote write protocol and stores them in Google BigQuery. This adapter is based off code found in the official prometheus repo:
@@ -8,7 +12,6 @@ Remote read is not currently supported by this adapter.
8
12
9
13
Billing MUST be enabled on the GCP project with the destination BigQuery tables. This adapter uses the "streaming inserts" API. More information is available here: https://cloud.google.com/bigquery/streaming-data-into-bigquery#before_you_begin
10
14
11
-
12
15
The table schema in BigQuery should be the following format:
13
16
14
17
| Field name | Type | Mode |
@@ -18,7 +21,6 @@ The table schema in BigQuery should be the following format:
18
21
| value | FLOAT | NULLABLE |
19
22
| timestamp | TIMESTAMP | NULLABLE |
20
23
21
-
22
24
It is recommended that the BigQuery table is partitioned on the timestamp column for performance.
23
25
24
26
The tags field is a json string and can be easily extracted. Here is an example query:
WHERE JSON_EXTRACT(tags, '$.some_label') = "\\"target_label_value\\""
31
33
```
32
34
33
-
## Building
34
-
35
-
```
36
-
go build
37
-
```
38
-
39
-
## Running
35
+
## Running directly
40
36
41
37
```
42
38
./bigquery_remote_storage_adapter \
@@ -51,6 +47,19 @@ To show all flags:
51
47
./bigquery_remote_storage_adapter -h
52
48
```
53
49
50
+
## Configuration
51
+
52
+
You can configure this storage adapter either through command line options or environment variables. The later is required if you're using our docker image.
53
+
54
+
| Command Line Flag | Environment Variable | Required | Default | Description |
55
+
| --- | --- | --- | --- | --- |
56
+
|`--googleAPIjsonkeypath`|`PROMBQ_GCP_JSON`| Yes || Path to json keyfile for GCP service account. JSON keyfile also contains project_id. |
57
+
|`--googleAPIdatasetID`|`PROMBQ_DATASET`| Yes || Dataset name as shown in GCP |
58
+
|`--googleAPItableID`|`PROMBQ_TABLE`| Yes || Table name as showon in GCP |
59
+
|`--send-timeout`|`PROMBQ_TIMEOUT`| No |`30s`| The timeout to use when sending samples to the remote storage |
60
+
|`--web.listen-address`|`PROMBQ_LISTEN`| No |`:9201`| Address to listen on for web endpoints |
61
+
|`--web.telemetry-path`|`PROMBQ_TELEMETRY`| No |`/metrics`| Address to listen on for web endpoints |
62
+
54
63
## Configuring Prometheus
55
64
56
65
To configure Prometheus to send samples to this binary, add the following to your `prometheus.yml`:
@@ -61,3 +70,43 @@ remote_write:
61
70
- url: "http://localhost:9201/write"
62
71
63
72
```
73
+
74
+
## Building
75
+
76
+
### Binary
77
+
78
+
If you just need a local version to test, then the simplest way is to execute:
79
+
80
+
```
81
+
make build
82
+
```
83
+
84
+
### Image
85
+
86
+
In order to build the docker image, simply execute
87
+
88
+
```
89
+
make image
90
+
```
91
+
92
+
## Releasing
93
+
94
+
This project is using [goreleaser](https://goreleaser.com). GitHub release creation is automated using Travis
95
+
CI. New releases are automatically created when new tags are pushed to the repo.
96
+
```
97
+
$ TAG=v0.0.2 make tag
98
+
```
99
+
100
+
How to manually create a release without relying on Travis CI.
101
+
```
102
+
$ TAG=v0.0.2 make tag
103
+
$ GITHUB_TOKEN=xxx make clean release
104
+
```
105
+
106
+
### Testing
107
+
108
+
You can execute goreleaser locally in order to test any changes.
0 commit comments