Skip to content

Commit a8de37c

Browse files
authored
T-4795 Rename ingestion host to ingesting host (#31)
1 parent 15352bb commit a8de37c

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GOLANGCI_LINT := golangci-lint run --disable-all \
88
-E staticcheck \
99
-E typecheck \
1010
-E unused
11-
VERSION := 0.3.6
11+
VERSION := 0.3.7
1212
.PHONY: test build
1313

1414
help:

docs/data-sources/source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ This Data Source allows you to look up existing Sources using their table name.
2424
- **created_at** (String) The time when this monitor group was created.
2525
- **data_region** (String) Region where we store your data.
2626
- **id** (String) The ID of this source.
27+
- **ingesting_host** (String) The host where the logs or metrics should be sent. See [documentation](https://betterstack.com/docs/logs/start/) for your specific source platform for details.
2728
- **ingesting_paused** (Boolean) This property allows you to temporarily pause data ingesting for this source (e.g., when you are reaching your plan's usage quota and you want to prioritize some sources over others).
28-
- **ingestion_host** (String) The host where the logs or metrics should be sent. See [documentation](https://betterstack.com/docs/logs/start/) for your specific source platform for details.
2929
- **live_tail_pattern** (String) Freeform text template for formatting Live tail output with columns wrapped in {column} brackets. Example: "PID: {message_json.pid} {level} {message}"
3030
- **logs_retention** (Number) Data retention for logs in days. There might be additional charges for longer retention.
3131
- **metrics_retention** (Number) Data retention for metrics in days. There might be additional charges for longer retention.

docs/resources/source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ This resource allows you to create, modify, and delete your Sources. For more in
8585

8686
- **created_at** (String) The time when this monitor group was created.
8787
- **id** (String) The ID of this source.
88-
- **ingestion_host** (String) The host where the logs or metrics should be sent. See [documentation](https://betterstack.com/docs/logs/start/) for your specific source platform for details.
88+
- **ingesting_host** (String) The host where the logs or metrics should be sent. See [documentation](https://betterstack.com/docs/logs/start/) for your specific source platform for details.
8989
- **table_name** (String) The table name generated for this source.
9090
- **token** (String) The token of this source. This token is used to identify and route the data you will send to Better Stack.
9191
- **updated_at** (String) The time when this monitor group was updated.

examples/advanced/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ resource "logtail_source" "this" {
1414
resource "logtail_metric" "duration_ms" {
1515
source_id = logtail_source.this.id
1616
name = "duration_ms"
17-
sql_expression = "JSONExtract(json, 'duration_ms', 'Nullable(Float)')"
17+
sql_expression = "getJSON(raw, 'duration_ms')"
1818
aggregations = ["avg", "max", "min"]
1919
type = "float64_delta"
2020
}
2121

2222
resource "logtail_metric" "service_name" {
2323
source_id = logtail_source.this.id
2424
name = "service_name"
25-
sql_expression = "JSONExtract(json, 'service_name', 'Nullable(String)')"
25+
sql_expression = "getJSON(raw, 'service_name')"
2626
aggregations = []
2727
type = "string_low_cardinality"
2828
}

examples/advanced/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
output "logtail_source_token" {
22
value = logtail_source.this.token
33
}
4-
output "logtail_ingestion_host" {
5-
value = logtail_source.this.ingestion_host
4+
output "logtail_ingesting_host" {
5+
value = logtail_source.this.ingesting_host
66
}
77

88
output "default_metric_expression" {

examples/advanced/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
logtail = {
55
source = "BetterStackHQ/logtail"
6-
version = ">= 0.3.6"
6+
version = ">= 0.3.7"
77
}
88
}
99
}

examples/basic/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
output "logtail_source_token" {
22
value = logtail_source.this.token
33
}
4-
output "logtail_ingestion_host" {
5-
value = logtail_source.this.ingestion_host
4+
output "logtail_ingesting_host" {
5+
value = logtail_source.this.ingesting_host
66
}

examples/basic/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
logtail = {
55
source = "BetterStackHQ/logtail"
6-
version = ">= 0.3.6"
6+
version = ">= 0.3.7"
77
}
88
}
99
}

internal/provider/resource_source.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var sourceSchema = map[string]*schema.Schema{
117117
}
118118
},
119119
},
120-
"ingestion_host": {
120+
"ingesting_host": {
121121
Description: "The host where the logs or metrics should be sent. See [documentation](https://betterstack.com/docs/logs/start/) for your specific source platform for details.",
122122
Type: schema.TypeString,
123123
Optional: false,
@@ -224,7 +224,7 @@ type source struct {
224224
Token *string `json:"token,omitempty"`
225225
TableName *string `json:"table_name,omitempty"`
226226
Platform *string `json:"platform,omitempty"`
227-
IngestionHost *string `json:"ingestion_host,omitempty"`
227+
IngestingHost *string `json:"ingesting_host,omitempty"`
228228
IngestingPaused *bool `json:"ingesting_paused,omitempty"`
229229
LogsRetention *int `json:"logs_retention,omitempty"`
230230
MetricsRetention *int `json:"metrics_retention,omitempty"`
@@ -259,7 +259,7 @@ func sourceRef(in *source) []struct {
259259
{k: "token", v: &in.Token},
260260
{k: "table_name", v: &in.TableName},
261261
{k: "platform", v: &in.Platform},
262-
{k: "ingestion_host", v: &in.IngestionHost},
262+
{k: "ingesting_host", v: &in.IngestingHost},
263263
{k: "ingesting_paused", v: &in.IngestingPaused},
264264
{k: "logs_retention", v: &in.LogsRetention},
265265
{k: "metrics_retention", v: &in.MetricsRetention},

internal/provider/resource_source_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestResourceSource(t *testing.T) {
3434
t.Fatal(err)
3535
}
3636
body = inject(t, body, "token", "generated_by_logtail")
37-
body = inject(t, body, "ingestion_host", "in.logs.betterstack.com")
37+
body = inject(t, body, "ingesting_host", "in.logs.betterstack.com")
3838
body = inject(t, body, "table_name", "test_source")
3939
data.Store(body)
4040
w.WriteHeader(http.StatusCreated)
@@ -58,7 +58,7 @@ func TestResourceSource(t *testing.T) {
5858
t.Fatal(err)
5959
}
6060
patched = inject(t, patched, "token", "generated_by_logtail")
61-
patched = inject(t, patched, "ingestion_host", "in.logs.betterstack.com")
61+
patched = inject(t, patched, "ingesting_host", "in.logs.betterstack.com")
6262
patched = inject(t, patched, "table_name", "test_source")
6363
data.Store(patched)
6464
_, _ = w.Write([]byte(fmt.Sprintf(`{"data":{"id":%q,"attributes":%s}}`, id, patched)))
@@ -100,7 +100,7 @@ func TestResourceSource(t *testing.T) {
100100
resource.TestCheckResourceAttr("logtail_source.this", "name", name),
101101
resource.TestCheckResourceAttr("logtail_source.this", "platform", platform),
102102
resource.TestCheckResourceAttr("logtail_source.this", "token", "generated_by_logtail"),
103-
resource.TestCheckResourceAttr("logtail_source.this", "ingestion_host", "in.logs.betterstack.com"),
103+
resource.TestCheckResourceAttr("logtail_source.this", "ingesting_host", "in.logs.betterstack.com"),
104104
resource.TestCheckResourceAttr("logtail_source.this", "data_region", "eu-hel-1-legacy"),
105105
),
106106
},
@@ -126,7 +126,7 @@ func TestResourceSource(t *testing.T) {
126126
resource.TestCheckResourceAttr("logtail_source.this", "platform", platform),
127127
resource.TestCheckResourceAttr("logtail_source.this", "ingesting_paused", "true"),
128128
resource.TestCheckResourceAttr("logtail_source.this", "token", "generated_by_logtail"),
129-
resource.TestCheckResourceAttr("logtail_source.this", "ingestion_host", "in.logs.betterstack.com"),
129+
resource.TestCheckResourceAttr("logtail_source.this", "ingesting_host", "in.logs.betterstack.com"),
130130
resource.TestCheckResourceAttr("logtail_source.this", "data_region", "eu-hel-1-legacy"),
131131
),
132132
},

0 commit comments

Comments
 (0)