Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new validations to manage object_type and metric_type fields (#527)
Add new validation checks to manage fields containing object_type and metric_type fields. These validations have been removed for previous spec versions.
- Loading branch information
Showing
14 changed files
with
198 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# newer versions go on top | ||
- version: "0.0.1" | ||
changes: | ||
- description: Initial draft of the package | ||
type: enhancement | ||
link: https://github.com/elastic/integrations/pull/1 # FIXME Replace with the real PR link |
6 changes: 6 additions & 0 deletions
6
test/packages/bad_metric_type_fields/data_stream/example/agent/stream/stream.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
metricsets: ["sample_metricset"] | ||
hosts: | ||
{{#each hosts}} | ||
- {{this}} | ||
{{/each}} | ||
period: {{period}} |
12 changes: 12 additions & 0 deletions
12
test/packages/bad_metric_type_fields/data_stream/example/fields/base-fields.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- name: data_stream.type | ||
type: constant_keyword | ||
description: Data stream type. | ||
- name: data_stream.dataset | ||
type: constant_keyword | ||
description: Data stream dataset. | ||
- name: data_stream.namespace | ||
type: constant_keyword | ||
description: Data stream namespace. | ||
- name: '@timestamp' | ||
type: date | ||
description: Event timestamp. |
32 changes: 32 additions & 0 deletions
32
test/packages/bad_metric_type_fields/data_stream/example/fields/fields.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
- name: example | ||
type: group | ||
fields: | ||
- name: agent.id | ||
type: keyword | ||
dimension: true | ||
- name: agent.call_count | ||
type: long | ||
metric_type: counter | ||
- name: agent.current_count | ||
type: long | ||
metric_type: gauge | ||
- name: agent.call_duration | ||
type: histogram | ||
metric_type: gauge | ||
dimension: true # This should fail, a histogram cannot be a dimension. | ||
- name: no_valid_type | ||
type: boolean | ||
metric_type: gauge | ||
- name: no_type | ||
metric_type: gauge | ||
- name: field_object_type_double | ||
type: double | ||
object_type: double | ||
metric_type: gauge | ||
- name: field_object_type_boolean | ||
type: object | ||
object_type: boolean | ||
metric_type: gauge | ||
- name: field_object | ||
type: object | ||
metric_type: gauge |
11 changes: 11 additions & 0 deletions
11
test/packages/bad_metric_type_fields/data_stream/example/manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
title: "Example data stream for time series" | ||
type: metrics | ||
streams: | ||
- input: sample/metrics | ||
title: Sample metrics | ||
description: Collect sample metrics | ||
vars: | ||
- name: period | ||
type: text | ||
title: Period | ||
default: 10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Package with fields using metric_type | ||
|
||
This is a new integration created using the [elastic-package](https://github.com/elastic/elastic-package) tool. | ||
|
||
Consider using the README template file `_dev/build/docs/README.md`to generate a list of exported fields or include a sample event. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
format_version: 2.10.0 | ||
name: bad_metric_type_fields | ||
title: "Package with fields using metric_type" | ||
version: 0.0.1 | ||
description: "This is a package with fields using metric type" | ||
type: integration | ||
categories: | ||
- custom | ||
- monitoring | ||
conditions: | ||
kibana.version: "^7.16.0" | ||
elastic.subscription: basic | ||
screenshots: | ||
- src: /img/sample-screenshot.png | ||
title: Sample screenshot | ||
size: 600x600 | ||
type: image/png | ||
icons: | ||
- src: /img/sample-logo.svg | ||
title: Sample logo | ||
size: 32x32 | ||
type: image/svg+xml | ||
policy_templates: | ||
- name: sample | ||
title: Sample logs | ||
description: Collect sample logs | ||
inputs: | ||
- type: logfile | ||
title: Collect sample logs from instances | ||
description: Collecting sample logs | ||
owner: | ||
github: elastic/integrations-developer-experience |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters