Skip to content

Commit

Permalink
Remove dynamic templates from otel-plugin that set index:false (ela…
Browse files Browse the repository at this point in the history
…stic#113409)

* Remove dynamic templates from otel-plugin that set `index:false`

* Update x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_metrics_tests.yml

Co-authored-by: Felix Barnsteiner <[email protected]>

* Remove unused dynamic templates

* Update [email protected]

---------

Co-authored-by: Felix Barnsteiner <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
3 people committed Sep 26, 2024
1 parent 774a97f commit 87048f1
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,50 +43,6 @@
"default_metric": "value_count"
}
}
},
{
"histogram": {
"mapping": {
"type": "histogram",
"ignore_malformed": true
}
}
},
{
"counter_long": {
"mapping": {
"type": "long",
"time_series_metric": "counter",
"ignore_malformed": true
}
}
},
{
"gauge_long": {
"mapping": {
"type": "long",
"time_series_metric": "gauge",
"ignore_malformed": true
}
}
},
{
"counter_double": {
"mapping": {
"type": "double",
"time_series_metric": "counter",
"ignore_malformed": true
}
}
},
{
"gauge_double": {
"mapping": {
"type": "double",
"time_series_metric": "gauge",
"ignore_malformed": true
}
}
}
],
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,33 @@ template:
type: keyword
time_series_dimension: true
ignore_above: 1024
dynamic_templates:
- histogram:
mapping:
type: histogram
ignore_malformed: true
- counter_long:
mapping:
type: long
time_series_metric: counter
ignore_malformed: true
- gauge_long:
mapping:
type: long
time_series_metric: gauge
ignore_malformed: true
- counter_double:
mapping:
type: double
time_series_metric: counter
ignore_malformed: true
- gauge_double:
mapping:
type: double
time_series_metric: gauge
ignore_malformed: true
- summary:
mapping:
type: aggregate_metric_double
metrics: sum, value_count
default_metric: value_count
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ _meta:
description: default OpenTelemetry metrics template installed by x-pack
managed: true
composed_of:
- metrics@mappings
- metrics@tsdb-settings
- otel@mappings
- metrics-otel@mappings
Expand Down Expand Up @@ -38,4 +37,3 @@ template:
ignore_above: 1024
type: keyword
match_mapping_type: string

Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,21 @@ IP dimensions:
expand_wildcards: hidden
- match: { .$idx0name.mappings.properties.resource.properties.attributes.properties.host\.ip.type: 'ip' }
- match: { .$idx0name.mappings.properties.attributes.properties.philip.type: "keyword" }
---
"Long data type in attributes must be accepted":
- do:
indices.get_index_template:
name: metrics-otel@template
- length: {index_templates: 1}
- do:
bulk:
index: metrics-generic.otel-default
refresh: true
body:
- create: {}
- '{"@timestamp":"2024-07-18T14:48:33.467654000Z","attributes":{"processor.pid": 17}}'
- is_false: errors
- do:
search:
index: metrics-generic.otel-default
- length: { hits.hits: 1 }

0 comments on commit 87048f1

Please sign in to comment.