Skip to content

Commit f363e6c

Browse files
committed
Merge remote-tracking branch 'origin/main' into supports-agentless
* origin/main: Fix master timeout for serverless flavor (#1207) Add reroute processor data source for Elasticsearch ingest pipelines (#1204) chore(deps): update golang docker tag to v1.24.5 (#1202) chore(deps): update dependency go to v1.24.5 (#1200) Add support for timeslice metrics indicator (#1195)
2 parents 69ccfe3 + 6dea22c commit f363e6c

File tree

23 files changed

+1230
-5
lines changed

23 files changed

+1230
-5
lines changed

.buildkite/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
steps:
22
- label: Release
33
agents:
4-
image: "golang:1.24.4@sha256:20a022e5112a144aa7b7aeb3f22ebf2cdaefcc4aac0d64e8deeee8cdc18b9c0f"
4+
image: "golang:1.24.5@sha256:14fd8a55e59a560704e5fc44970b301d00d344e45d6b914dda228e09f359a088"
55
cpu: "16"
66
memory: "24G"
77
ephemeralStorage: "20G"

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## [Unreleased]
22

3+
- Add support for `timeslice_metric_indicator` in `elasticstack_kibana_slo` ([#1195](https://github.com/elastic/terraform-provider-elasticstack/pull/1195))
4+
- Add `elasticstack_elasticsearch_ingest_processor_reroute` data source ([#678](https://github.com/elastic/terraform-provider-elasticstack/issues/678))
5+
36
## [0.11.16] - 2025-07-09
47

58
- Add `headers` for the provider connection ([#1057](https://github.com/elastic/terraform-provider-elasticstack/pull/1057))
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
subcategory: "Ingest"
3+
layout: ""
4+
page_title: "Elasticstack: elasticstack_elasticsearch_ingest_processor_reroute Data Source"
5+
description: |-
6+
Helper data source to create a processor which reroutes a document to a different data stream, index, or index alias.
7+
---
8+
9+
# Data Source: elasticstack_elasticsearch_ingest_processor_reroute
10+
11+
Reroutes a document to a different data stream, index, or index alias. This processor is useful for routing documents based on data stream routing rules.
12+
13+
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/reroute-processor.html
14+
15+
16+
## Example Usage
17+
18+
```terraform
19+
provider "elasticstack" {
20+
elasticsearch {}
21+
}
22+
23+
data "elasticstack_elasticsearch_ingest_processor_reroute" "reroute" {
24+
destination = "logs-generic-default"
25+
dataset = "generic"
26+
namespace = "default"
27+
}
28+
29+
resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
30+
name = "reroute-ingest"
31+
32+
processors = [
33+
data.elasticstack_elasticsearch_ingest_processor_reroute.reroute.json
34+
]
35+
}
36+
```
37+
38+
<!-- schema generated by tfplugindocs -->
39+
## Schema
40+
41+
### Optional
42+
43+
- `dataset` (String) The destination dataset to route the document to.
44+
- `description` (String) Description of the processor.
45+
- `destination` (String) The destination data stream, index, or index alias to route the document to.
46+
- `if` (String) Conditionally execute the processor
47+
- `ignore_failure` (Boolean) Ignore failures for the processor.
48+
- `namespace` (String) The destination namespace to route the document to.
49+
- `on_failure` (List of String) Handle failures for the processor.
50+
- `tag` (String) Identifier for the processor.
51+
52+
### Read-Only
53+
54+
- `id` (String) Internal identifier of the resource.
55+
- `json` (String) JSON representation of this data source.

docs/resources/kibana_slo.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,41 @@ resource "elasticstack_kibana_slo" "custom_metric" {
190190
timeslice_window = "5m"
191191
}
192192
193+
}
194+
195+
//Available from 8.12.0
196+
resource "elasticstack_kibana_slo" "timeslice_metric" {
197+
name = "timeslice metric"
198+
description = "timeslice metric"
199+
200+
timeslice_metric_indicator {
201+
index = "my-index"
202+
timestamp_field = "@timestamp"
203+
metric {
204+
metrics {
205+
name = "A"
206+
aggregation = "sum"
207+
field = "latency"
208+
}
209+
equation = "A"
210+
comparator = "GT"
211+
threshold = 100
212+
}
213+
}
214+
215+
time_window {
216+
duration = "7d"
217+
type = "rolling"
218+
}
219+
220+
budgeting_method = "timeslices"
221+
222+
objective {
223+
target = 0.95
224+
timeslice_target = 0.95
225+
timeslice_window = "5m"
226+
}
227+
193228
}
194229
```
195230

@@ -216,6 +251,7 @@ resource "elasticstack_kibana_slo" "custom_metric" {
216251
- `slo_id` (String) An ID (8 and 36 characters). If omitted, a UUIDv1 will be generated server-side.
217252
- `space_id` (String) An identifier for the space. If space_id is not provided, the default space is used.
218253
- `tags` (List of String) The tags for the SLO.
254+
- `timeslice_metric_indicator` (Block List, Max: 1) Defines a timeslice metric indicator for SLO. (see [below for nested schema](#nestedblock--timeslice_metric_indicator))
219255

220256
### Read-Only
221257

@@ -405,6 +441,44 @@ Optional:
405441
- `frequency` (String)
406442
- `sync_delay` (String)
407443

444+
445+
<a id="nestedblock--timeslice_metric_indicator"></a>
446+
### Nested Schema for `timeslice_metric_indicator`
447+
448+
Required:
449+
450+
- `index` (String)
451+
- `metric` (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--timeslice_metric_indicator--metric))
452+
- `timestamp_field` (String)
453+
454+
Optional:
455+
456+
- `filter` (String)
457+
458+
<a id="nestedblock--timeslice_metric_indicator--metric"></a>
459+
### Nested Schema for `timeslice_metric_indicator.metric`
460+
461+
Required:
462+
463+
- `comparator` (String)
464+
- `equation` (String)
465+
- `metrics` (Block List, Min: 1) (see [below for nested schema](#nestedblock--timeslice_metric_indicator--metric--metrics))
466+
- `threshold` (Number)
467+
468+
<a id="nestedblock--timeslice_metric_indicator--metric--metrics"></a>
469+
### Nested Schema for `timeslice_metric_indicator.metric.metrics`
470+
471+
Required:
472+
473+
- `aggregation` (String) The aggregation type for this metric. One of: sum, avg, min, max, value_count, percentile, doc_count. Determines which other fields are required:
474+
- `name` (String) The unique name for this metric. Used as a variable in the equation field.
475+
476+
Optional:
477+
478+
- `field` (String) Field to aggregate. Required for aggregations: sum, avg, min, max, value_count, percentile. Must NOT be set for doc_count.
479+
- `filter` (String) Optional KQL filter for this metric. Supported for all aggregations except doc_count.
480+
- `percentile` (Number) Percentile value (e.g., 99). Required if aggregation is 'percentile'. Must NOT be set for other aggregations.
481+
408482
## Import
409483

410484
Import is supported using the following syntax:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
}
4+
5+
data "elasticstack_elasticsearch_ingest_processor_reroute" "reroute" {
6+
destination = "logs-generic-default"
7+
dataset = "generic"
8+
namespace = "default"
9+
}
10+
11+
resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
12+
name = "reroute-ingest"
13+
14+
processors = [
15+
data.elasticstack_elasticsearch_ingest_processor_reroute.reroute.json
16+
]
17+
}

examples/resources/elasticstack_kibana_slo/resource.tf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,38 @@ resource "elasticstack_kibana_slo" "custom_metric" {
176176
}
177177

178178
}
179+
180+
//Available from 8.12.0
181+
resource "elasticstack_kibana_slo" "timeslice_metric" {
182+
name = "timeslice metric"
183+
description = "timeslice metric"
184+
185+
timeslice_metric_indicator {
186+
index = "my-index"
187+
timestamp_field = "@timestamp"
188+
metric {
189+
metrics {
190+
name = "A"
191+
aggregation = "sum"
192+
field = "latency"
193+
}
194+
equation = "A"
195+
comparator = "GT"
196+
threshold = 100
197+
}
198+
}
199+
200+
time_window {
201+
duration = "7d"
202+
type = "rolling"
203+
}
204+
205+
budgeting_method = "timeslices"
206+
207+
objective {
208+
target = 0.95
209+
timeslice_target = 0.95
210+
timeslice_window = "5m"
211+
}
212+
213+
}

generated/slo-spec.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,18 @@ components:
969969
description: List of metrics with their name, aggregation type, and field.
970970
type: array
971971
items:
972+
discriminator:
973+
propertyName: aggregation
974+
mapping:
975+
percentile: '#/components/schemas/timeslice_metric_percentile_metric'
976+
doc_count: '#/components/schemas/timeslice_metric_doc_count_metric'
977+
sum: '#/components/schemas/timeslice_metric_basic_metric_with_field'
978+
avg: '#/components/schemas/timeslice_metric_basic_metric_with_field'
979+
min: '#/components/schemas/timeslice_metric_basic_metric_with_field'
980+
max: '#/components/schemas/timeslice_metric_basic_metric_with_field'
981+
std_deviation: '#/components/schemas/timeslice_metric_basic_metric_with_field'
982+
last_value: '#/components/schemas/timeslice_metric_basic_metric_with_field'
983+
cardinality: '#/components/schemas/timeslice_metric_basic_metric_with_field'
972984
anyOf:
973985
- $ref: '#/components/schemas/timeslice_metric_basic_metric_with_field'
974986
- $ref: '#/components/schemas/timeslice_metric_percentile_metric'

generated/slo/api/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,18 @@ components:
17051705
- $ref: '#/components/schemas/timeslice_metric_basic_metric_with_field'
17061706
- $ref: '#/components/schemas/timeslice_metric_percentile_metric'
17071707
- $ref: '#/components/schemas/timeslice_metric_doc_count_metric'
1708+
discriminator:
1709+
mapping:
1710+
percentile: '#/components/schemas/timeslice_metric_percentile_metric'
1711+
doc_count: '#/components/schemas/timeslice_metric_doc_count_metric'
1712+
sum: '#/components/schemas/timeslice_metric_basic_metric_with_field'
1713+
avg: '#/components/schemas/timeslice_metric_basic_metric_with_field'
1714+
min: '#/components/schemas/timeslice_metric_basic_metric_with_field'
1715+
max: '#/components/schemas/timeslice_metric_basic_metric_with_field'
1716+
std_deviation: '#/components/schemas/timeslice_metric_basic_metric_with_field'
1717+
last_value: '#/components/schemas/timeslice_metric_basic_metric_with_field'
1718+
cardinality: '#/components/schemas/timeslice_metric_basic_metric_with_field'
1719+
propertyName: aggregation
17081720
indicator_properties_timeslice_metric_params_metric:
17091721
description: |
17101722
An object defining the metrics, equation, and threshold to determine if it's a good slice or not

0 commit comments

Comments
 (0)