Repository navigation
[Ceph] Add Integration Package with Pool Disk data stream #5070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kush-elastic
merged 6 commits into
elastic:main
from
chavdaharnish:package-ceph_pool_disk
Feb 8, 2023
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9ebe066
Add pool disk data stream
harnish-crest-data 79c4992
update changelog.yml
harnish-crest-data 692d708
remove dashboard
harnish-crest-data 2dfb88a
update readme
harnish-crest-data b73d7f1
Merge branch 'main' of https://github.com/harnish-elastic/integration…
harnish-crest-data ff17161
Merge branch 'main' of https://github.com/harnish-elastic/integration…
harnish-crest-data File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
3 changes: 3 additions & 0 deletions
3
packages/ceph/data_stream/pool_disk/_dev/test/pipeline/test-common-config.yml
This file contains hidden or 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,3 @@ | ||
| fields: | ||
| tags: | ||
| - preserve_original_event |
1 change: 1 addition & 0 deletions
1
packages/ceph/data_stream/pool_disk/_dev/test/pipeline/test-pool-disk-metrics.log
This file contains hidden or 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 @@ | ||
| {"name":"device_health_metrics","id":1,"stats":{"stored":2142673,"objects":4,"kb_used":6336,"bytes_used":6488064,"percent_used":8.4363608038984239e-05,"max_avail":25633155072}} |
39 changes: 39 additions & 0 deletions
39
...es/ceph/data_stream/pool_disk/_dev/test/pipeline/test-pool-disk-metrics.log-expected.json
This file contains hidden or 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,39 @@ | ||
| { | ||
| "expected": [ | ||
| { | ||
| "ceph": { | ||
| "pool_disk": { | ||
| "available": { | ||
| "bytes": 25633155072 | ||
| }, | ||
| "object": { | ||
| "count": 4 | ||
| }, | ||
| "pool_id": 1, | ||
| "pool_name": "device_health_metrics", | ||
| "stored": { | ||
| "bytes": 2142673 | ||
| }, | ||
| "used": { | ||
| "bytes": 6488064, | ||
| "pct": 8.436360803898424E-5 | ||
| } | ||
| } | ||
| }, | ||
| "ecs": { | ||
| "version": "8.5.1" | ||
| }, | ||
| "event": { | ||
| "kind": "metric", | ||
| "module": "ceph", | ||
| "original": "{\"name\":\"device_health_metrics\",\"id\":1,\"stats\":{\"stored\":2142673,\"objects\":4,\"kb_used\":6336,\"bytes_used\":6488064,\"percent_used\":8.4363608038984239e-05,\"max_avail\":25633155072}}", | ||
| "type": [ | ||
| "info" | ||
| ] | ||
| }, | ||
| "tags": [ | ||
| "preserve_original_event" | ||
| ] | ||
| } | ||
| ] | ||
| } |
7 changes: 7 additions & 0 deletions
7
packages/ceph/data_stream/pool_disk/_dev/test/system/test-default-config.yml
This file contains hidden or 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,7 @@ | ||
| input: httpjson | ||
| service: ceph | ||
| vars: | ||
| hostname: http://{{Hostname}}:{{Port}} | ||
| data_stream: | ||
| vars: | ||
| preserve_original_event: true |
50 changes: 50 additions & 0 deletions
50
packages/ceph/data_stream/pool_disk/agent/stream/httpjson.yml.hbs
This file contains hidden or 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,50 @@ | ||
| config_version: 2 | ||
| interval: {{period}} | ||
| {{#if api_user}} | ||
| {{#if api_secret}} | ||
| auth.basic.user: {{api_user}} | ||
| auth.basic.password: {{api_secret}} | ||
| {{/if}} | ||
| {{/if}} | ||
| {{#if ssl}} | ||
| request.ssl: {{ssl}} | ||
| {{/if}} | ||
| request.method: POST | ||
| request.url: {{hostname}}/request?wait=1 | ||
| request.transforms: | ||
| - set: | ||
| target: body.prefix | ||
| value: "df" | ||
| - set: | ||
| target: body.format | ||
| value: "json" | ||
| response.split: | ||
| target: body.finished | ||
| ignore_empty_value: true | ||
| transforms: | ||
| - set: | ||
| target: body.outb | ||
| value: '[[.body.outb]]' | ||
| value_type: json | ||
| split: | ||
| target: body.outb.pools | ||
| value_type: json | ||
| ignore_empty_value: true | ||
| tags: | ||
| {{#if preserve_original_event}} | ||
| - preserve_original_event | ||
| {{/if}} | ||
| {{#each tags as |tag|}} | ||
| - {{tag}} | ||
| {{/each}} | ||
| {{#contains "forwarded" tags}} | ||
| publisher_pipeline.disable_host: true | ||
| {{/contains}} | ||
| processors: | ||
| - add_fields: | ||
| target: service | ||
| fields: | ||
| address: {{hostname}} | ||
| {{#if processors}} | ||
| {{processors}} | ||
| {{/if}} |
87 changes: 87 additions & 0 deletions
87
packages/ceph/data_stream/pool_disk/elasticsearch/ingest_pipeline/default.yml
This file contains hidden or 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,87 @@ | ||
| --- | ||
| description: Pipeline for processing Ceph Pool Disk metrics. | ||
| processors: | ||
| - set: | ||
| field: ecs.version | ||
| value: 8.5.1 | ||
| - set: | ||
| field: event.type | ||
| value: [info] | ||
| - set: | ||
| field: event.kind | ||
| value: metric | ||
| - set: | ||
| field: event.module | ||
| value: ceph | ||
| - rename: | ||
| field: message | ||
| target_field: event.original | ||
| ignore_missing: true | ||
| - json: | ||
| field: event.original | ||
| target_field: json | ||
| on_failure: | ||
| - append: | ||
| field: error.message | ||
| value: '{{{_ingest.on_failure_message}}}' | ||
| - rename: | ||
| field: json.id | ||
| target_field: ceph.pool_disk.pool_id | ||
| ignore_missing: true | ||
| - rename: | ||
| field: json.name | ||
| target_field: ceph.pool_disk.pool_name | ||
| ignore_missing: true | ||
| - rename: | ||
| field: json.stats.bytes_used | ||
| target_field: ceph.pool_disk.used.bytes | ||
| ignore_missing: true | ||
| - rename: | ||
| field: json.stats.max_avail | ||
| target_field: ceph.pool_disk.available.bytes | ||
| ignore_missing: true | ||
| - rename: | ||
| field: json.stats.objects | ||
| target_field: ceph.pool_disk.object.count | ||
| ignore_missing: true | ||
| - rename: | ||
| field: json.stats.stored | ||
| target_field: ceph.pool_disk.stored.bytes | ||
| ignore_missing: true | ||
| - rename: | ||
| field: json.stats.percent_used | ||
| target_field: ceph.pool_disk.used.pct | ||
| ignore_missing: true | ||
| - script: | ||
| description: Drops null/empty values recursively. | ||
| lang: painless | ||
| source: | | ||
| boolean drop(Object o) { | ||
| if (o == null || o == "") { | ||
| return true; | ||
| } else if (o instanceof Map) { | ||
| ((Map) o).values().removeIf(v -> drop(v)); | ||
| return (((Map) o).size() == 0); | ||
| } else if (o instanceof List) { | ||
| ((List) o).removeIf(v -> drop(v)); | ||
| return (((List) o).length == 0); | ||
| } | ||
| return false; | ||
| } | ||
| drop(ctx); | ||
| - remove: | ||
| field: event.original | ||
| if: "ctx.tags == null || !(ctx.tags.contains('preserve_original_event'))" | ||
| ignore_missing: true | ||
| - remove: | ||
| field: | ||
| - json | ||
| ignore_missing: true | ||
| on_failure: | ||
| - set: | ||
| field: error.message | ||
| value: "{{{_ingest.on_failure_message}}}" | ||
| - append: | ||
| field: event.kind | ||
| value: pipeline_error | ||
| allow_duplicates: false |
18 changes: 18 additions & 0 deletions
18
packages/ceph/data_stream/pool_disk/fields/base-fields.yml
This file contains hidden or 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,18 @@ | ||
| - 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: input.type | ||
| type: keyword | ||
| description: Type of Filebeat input. | ||
| - name: tags | ||
| type: keyword | ||
| description: List of keywords used to tag each event. | ||
| - name: '@timestamp' | ||
| type: date | ||
| description: Event timestamp. |
This file contains hidden or 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,22 @@ | ||
| - external: ecs | ||
| name: ecs.version | ||
| - external: ecs | ||
| name: error.message | ||
| - external: ecs | ||
| name: event.agent_id_status | ||
| - external: ecs | ||
| name: event.created | ||
| - external: ecs | ||
| name: event.dataset | ||
| - external: ecs | ||
| name: event.ingested | ||
| - external: ecs | ||
| name: event.kind | ||
| - external: ecs | ||
| name: event.module | ||
| - external: ecs | ||
| name: event.original | ||
| - external: ecs | ||
| name: event.type | ||
| - external: ecs | ||
| name: service.address |
This file contains hidden or 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,39 @@ | ||
| - name: ceph | ||
| type: group | ||
| fields: | ||
| - name: pool_disk | ||
| type: group | ||
| fields: | ||
| - name: available.bytes | ||
| type: long | ||
| description: Available bytes of the pool. | ||
| metric_type: gauge | ||
| unit: byte | ||
| - name: object.count | ||
| type: long | ||
| description: Number of objects of the pool. | ||
| metric_type: gauge | ||
| - name: pool_id | ||
| type: long | ||
| description: Id of the pool. | ||
| - name: pool_name | ||
| type: keyword | ||
| description: Name of the pool. | ||
| - name: stored.bytes | ||
| type: long | ||
| description: Stored data of the pool. | ||
| metric_type: gauge | ||
| unit: byte | ||
| - name: used | ||
| type: group | ||
| fields: | ||
| - name: bytes | ||
| type: long | ||
| description: Used bytes of the pool. | ||
| metric_type: gauge | ||
| unit: byte | ||
| - name: pct | ||
| type: double | ||
| description: Used bytes in percentage of the pool. | ||
| metric_type: gauge | ||
| unit: percent | ||
This file contains hidden or 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,39 @@ | ||
| title: Pool Disk metrics | ||
| type: logs | ||
| streams: | ||
| - input: httpjson | ||
| vars: | ||
| - name: preserve_original_event | ||
| required: true | ||
| show_user: true | ||
| title: Preserve original event | ||
| description: Preserves a raw copy of the original event, added to the field `event.original`. | ||
| type: bool | ||
| multi: false | ||
| default: false | ||
| - name: period | ||
| type: text | ||
| required: true | ||
| title: Period | ||
| default: 10s | ||
| show_user: true | ||
| description: Period of fetching metrics, i.e. 1s/1m/1h. | ||
| - name: tags | ||
| type: text | ||
| title: Tags | ||
| multi: true | ||
| required: true | ||
| show_user: false | ||
| default: | ||
| - ceph-pool_disk | ||
| - forwarded | ||
| - name: processors | ||
| type: yaml | ||
| title: Processors | ||
| multi: false | ||
| required: false | ||
| show_user: false | ||
| description: Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the logs are parsed. See [Processors](https://www.elastic.co/guide/en/beats/filebeat/current/filtering-and-enhancing-data.html) for details. | ||
| template_path: httpjson.yml.hbs | ||
| title: Ceph Pool Disk metrics | ||
| description: Collect Pool Disk metrics. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.