forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logstash] Adding Health Report to Logstash Integration (elastic#12677)
* third time is the charm
- Loading branch information
Showing
17 changed files
with
5,530 additions
and
2,209 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
63 changes: 63 additions & 0 deletions
63
packages/logstash/data_stream/health_report/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,63 @@ | ||
config_version: "1" | ||
interval: {{period}} | ||
resource.url: "{{url}}/_health_report" | ||
{{#if resource_ssl}} | ||
resource.ssl: | ||
{{resource_ssl}} | ||
{{/if}} | ||
|
||
{{#if username}} | ||
auth.basic.user: {{escape_string username}} | ||
{{/if}} | ||
{{#if password}} | ||
auth.basic.password: {{escape_string password}} | ||
{{/if}} | ||
{{#if condition}} | ||
condition: {{ condition }} | ||
{{/if}} | ||
|
||
redact: | ||
fields: ~ | ||
|
||
program: | | ||
get(state.url) | ||
.as(resp, bytes(resp.Body) | ||
.decode_json().as(body, | ||
[ | ||
[{ | ||
"logstash.node": { | ||
"name":body.name, | ||
"address":body.http_address, | ||
"uuid":body.id, | ||
"version":body.version, | ||
"status":body.status, | ||
"symptom":body.symptom, | ||
}, | ||
}], | ||
body.indicators.pipelines.indicators.as(pipelines, // pipelines = body.indicators.pipelines.indicators | ||
pipelines.map(pipeline_name, pipelines[pipeline_name].as(pipeline, { // pipeline = pipelines[pipeline_name] | ||
"logstash": { | ||
"node": { | ||
"name": body.name, | ||
"version": body.version, | ||
"address": body.http_address, | ||
"uuid": body.id | ||
}, | ||
"pipeline": { | ||
"id":pipeline_name, | ||
"status":pipeline.status, | ||
"symptom":pipeline.symptom, | ||
"state":pipeline.details.status.state, | ||
"flow": pipeline.details.flow, | ||
"diagnosis": has(pipeline.diagnosis) ? pipeline.diagnosis[0] : {}, | ||
"impacts": has(pipeline.impacts) ? pipeline.impacts[0] : {}, | ||
} | ||
} | ||
} | ||
)) | ||
) | ||
].as(entries, { | ||
"events": entries.flatten() | ||
}) | ||
) | ||
) |
9 changes: 9 additions & 0 deletions
9
packages/logstash/data_stream/health_report/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,9 @@ | ||
- name: data_stream.type | ||
external: ecs | ||
- name: data_stream.dataset | ||
external: ecs | ||
- name: data_stream.namespace | ||
external: ecs | ||
- name: service.hostname | ||
type: keyword | ||
description: Hostname of the service |
24 changes: 24 additions & 0 deletions
24
packages/logstash/data_stream/health_report/fields/ecs.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,24 @@ | ||
- name: '@timestamp' | ||
external: ecs | ||
- name: service.id | ||
external: ecs | ||
- name: service.type | ||
external: ecs | ||
- name: service.version | ||
external: ecs | ||
- name: service.address | ||
external: ecs | ||
- name: service.name | ||
external: ecs | ||
- name: process.pid | ||
external: ecs | ||
- name: ecs.version | ||
external: ecs | ||
- name: event.dataset | ||
external: ecs | ||
- name: event.duration | ||
external: ecs | ||
- name: event.module | ||
external: ecs | ||
- name: error.message | ||
external: ecs |
90 changes: 90 additions & 0 deletions
90
packages/logstash/data_stream/health_report/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,90 @@ | ||
- name: logstash | ||
type: group | ||
fields: | ||
- name: node | ||
type: group | ||
fields: | ||
- name: name | ||
type: keyword | ||
- name: version | ||
type: keyword | ||
- name: address | ||
type: keyword | ||
- name: symptom | ||
type: keyword | ||
multi_fields: | ||
- name: text | ||
type: match_only_text | ||
- name: uuid | ||
type: keyword | ||
- name: status | ||
type: keyword | ||
- name: pipeline | ||
type: group | ||
fields: | ||
- name: id | ||
type: keyword | ||
- name: status | ||
type: keyword | ||
- name: state | ||
type: keyword | ||
- name: symptom | ||
type: keyword | ||
multi_fields: | ||
- name: text | ||
type: match_only_text | ||
- name: diagnosis | ||
type: group | ||
fields: | ||
- name: id | ||
type: keyword | ||
- name: cause | ||
type: keyword | ||
multi_fields: | ||
- name: text | ||
type: match_only_text | ||
- name: action | ||
type: keyword | ||
multi_fields: | ||
- name: text | ||
type: match_only_text | ||
- name: help_url | ||
type: keyword | ||
format: url | ||
multi_fields: | ||
- name: text | ||
type: match_only_text | ||
- name: impacts | ||
type: group | ||
fields: | ||
- name: id | ||
type: keyword | ||
- name: severity | ||
type: short | ||
- name: description | ||
type: keyword | ||
multi_fields: | ||
- name: text | ||
type: match_only_text | ||
- name: impact_areas | ||
type: keyword | ||
- name: flow | ||
type: group | ||
fields: | ||
- name: worker_utilization | ||
type: group | ||
fields: | ||
- name: current | ||
type: float | ||
- name: last_1_hour | ||
type: float | ||
- name: last_5_minutes | ||
type: float | ||
- name: last_15_minutes | ||
type: float | ||
- name: lifetime | ||
type: float | ||
- name: last_1_minute | ||
type: float | ||
- name: last_24_hours | ||
type: float |
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,20 @@ | ||
title: "Health Report" | ||
type: metrics | ||
dataset: logstash.health_report | ||
release: beta | ||
elasticsearch: | ||
index_template: | ||
mappings: | ||
dynamic: false | ||
streams: | ||
- input: cel | ||
title: "Collect Health Report" | ||
description: "Health Report for Logstash instance" | ||
vars: | ||
- name: period | ||
type: text | ||
title: Period | ||
multi: false | ||
required: true | ||
show_user: true | ||
default: 30s |
41 changes: 41 additions & 0 deletions
41
packages/logstash/data_stream/health_report/sample_event.json
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,41 @@ | ||
{ | ||
"logstash": { | ||
"pipeline": { | ||
"symptom": "The pipeline is unhealthy; 1 area is impacted and 1 diagnosis is available", | ||
"diagnosis": { | ||
"help_url": "https://www.elastic.co/guide/en/logstash/8.17/health-report-pipeline-status.html#terminated", | ||
"action": "view logs to determine the cause of abnormal pipeline shutdown", | ||
"cause": "pipeline is not running, likely because it has encountered an error", | ||
"id": "logstash:health:pipeline:status:diagnosis:terminated" | ||
}, | ||
"state": "TERMINATED", | ||
"impacts": { | ||
"severity": 1, | ||
"impact_areas": [ | ||
"pipeline_execution" | ||
], | ||
"description": "the pipeline is not currently processing", | ||
"id": "logstash:health:pipeline:status:impact:not_processing" | ||
}, | ||
"id": "bad", | ||
"flow": { | ||
"worker_utilization": { | ||
"current": 0.000001826, | ||
"last_24_hours": 0.000001826, | ||
"last_5_minutes": 0.000001826, | ||
"last_1_hour": 0.000001826, | ||
"last_15_minutes": 0.000001826, | ||
"lifetime": 0.000001826, | ||
"last_1_minute": 0.000001826 | ||
} | ||
}, | ||
"status": "red" | ||
}, | ||
"node": { | ||
"address": "0.0.0.0:9600", | ||
"name": "9cbebe0b66d9", | ||
"version": "8.17.1", | ||
"uuid": "1a3d4358-0d0a-4b82-8cf7-21f59ea592e8" | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.