Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Spring boot package [Threads - data stream]#2981

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
11 commits
Select commitHold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletionpackages/spring_boot/_dev/build/docs/README.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,4 +58,14 @@ This is the `memory` data stream.

{{event "memory"}}

{{fields "memory"}}
{{fields "memory"}}

### Threading Metrics

This is the `threading` data stream.

- This data stream gives metrics related to thread allocations, monitoring and CPU times.

{{event "threading"}}

{{fields "threading"}}
5 changes: 5 additions & 0 deletionspackages/spring_boot/changelog.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "0.4.0"
changes:
- description: threading data stream of the package
type: enhancement
link: https://github.com/elastic/integrations/pull/2981
- version: "0.3.0"
changes:
- description: memory data stream of the package
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
vars:
hosts: http://springboot:8090/actuator/jolokia
path: /jolokia/?ignoreErrors=true&canonicalNaming=false
input: jolokia/metrics
data_stream:
vars: ~
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
metricsets: ["jmx"]
namespace: "metrics"
hosts: {{hosts}}
http_method: "GET"
path: {{path}}
username: {{username}}
password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
jmx.mappings:
- mbean: 'java.lang:type=Threading'
attributes:
- attr: ThreadCount
field: threads.count
- attr: CurrentThreadAllocatedBytes
field: threads.current.allocated_bytes
- attr: CurrentThreadCpuTime
field: threads.current.time.cpu
- attr: CurrentThreadUserTime
field: threads.current.time.user
- attr: DaemonThreadCount
field: threads.daemon
- attr: TotalStartedThreadCount
field: threads.started

View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
---
description: Pipeline for parsing Spring Boot Threading metrics.
processors:
- set:
field: ecs.version
value: "8.1.0"
- rename:
field: jolokia.metrics
target_field: spring_boot.threading
ignore_missing: true
ignore_failure: true
- set:
field: event.type
value: info
- set:
field: event.kind
value: metric
- set:
field: event.category
value: web
- set:
field: event.module
value: spring_boot
- set:
field: event.dataset
value: spring_boot.threading
- remove:
field: jolokia
ignore_missing: true
ignore_failure: true
on_failure:
- set:
field: error.message
value: "{{ _ingest.on_failure_message }}"

View file
Open in desktop
Original file line numberDiff line numberDiff 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.
16 changes: 16 additions & 0 deletionspackages/spring_boot/data_stream/threading/fields/ecs.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
- external: ecs
name: ecs.version
- external: ecs
name: error.message
- external: ecs
name: event.category
- external: ecs
name: event.dataset
- external: ecs
name: event.kind
- external: ecs
name: event.module
- external: ecs
name: service.address
- external: ecs
name: service.type
33 changes: 33 additions & 0 deletionspackages/spring_boot/data_stream/threading/fields/fields.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
- name: spring_boot
type: group
fields:
- name: threading
type: group
fields:
- name: threads
type: group
fields:
- name: count
type: long
description: Current number of live threads including both daemon and non-daemon threads.
- name: current
type: group
fields:
- name: allocated_bytes
type: double
description: Allocated bytes for the current thread.
- name: time
type: group
fields:
- name: cpu
type: long
description: CPU time for the current thread in nanoseconds.
- name: user
type: long
description: User time for the current thread.
- name: daemon
type: long
description: Current number of live daemon threads.
- name: started
type: long
description: Total number of threads created and also started since the Java virtual machine started.
21 changes: 21 additions & 0 deletionspackages/spring_boot/data_stream/threading/manifest.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
title: Threading Metrics
type: metrics
streams:
- input: jolokia/metrics
template_path: stream.yml.hbs
title: Threading metrics
description: Collect Spring Boot Threading metrics.
vars:
- name: period
type: text
title: Period
default: 60s
- 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.

78 changes: 78 additions & 0 deletionspackages/spring_boot/data_stream/threading/sample_event.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
{
"@timestamp": "2022-04-27T05:15:58.803Z",
"agent": {
"ephemeral_id": "f4f1cd9b-9005-4325-a961-3275ac6d72ea",
"id": "d0841fd3-9fa3-477f-bdee-1308cbf51371",
"name": "docker-fleet-agent",
"type": "metricbeat",
"version": "8.1.0"
},
"data_stream": {
"dataset": "spring_boot.threading",
"namespace": "ep",
"type": "metrics"
},
"ecs": {
"version": "8.1.0"
},
"elastic_agent": {
"id": "d0841fd3-9fa3-477f-bdee-1308cbf51371",
"snapshot": false,
"version": "8.1.0"
},
"event": {
"agent_id_status": "verified",
"category": "web",
"dataset": "spring_boot.threading",
"duration": 99822322,
"ingested": "2022-04-27T05:16:01Z",
"kind": "metric",
"module": "spring_boot",
"type": "info"
},
"host": {
"architecture": "x86_64",
"containerized": true,
"hostname": "docker-fleet-agent",
"ip": [
"172.29.0.7"
],
"mac": [
"02:42:ac:1d:00:07"
],
"name": "docker-fleet-agent",
"os": {
"codename": "focal",
"family": "debian",
"kernel": "3.10.0-1160.59.1.el7.x86_64",
"name": "Ubuntu",
"platform": "ubuntu",
"type": "linux",
"version": "20.04.3 LTS (Focal Fossa)"
}
},
"metricset": {
"name": "jmx",
"period": 60000
},
"service": {
"address": "http://springboot:8090/actuator/jolokia",
"type": "jolokia"
},
"spring_boot": {
"threading": {
"threads": {
"count": 20,
"current": {
"allocated_bytes": 430512,
"time": {
"cpu": 185403326,
"user": 180000000
}
},
"daemon": 16,
"started": 23
}
}
}
}
114 changes: 114 additions & 0 deletionspackages/spring_boot/docs/README.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -351,3 +351,117 @@ An example event for `memory` looks as following:
| spring_boot.memory.non_heap.init | Init non-heap memory usage of JVM | long |
| spring_boot.memory.non_heap.max | Max non-heap memory usage of JVM | long |
| spring_boot.memory.non_heap.used | Used non-heap memory usage of JVM | long |


### Threading Metrics

This is the `threading` data stream.

- This data stream gives metrics related to thread allocations, monitoring and CPU times.

An example event for `threading` looks as following:

```json
{
"@timestamp": "2022-04-27T05:15:58.803Z",
"agent": {
"ephemeral_id": "f4f1cd9b-9005-4325-a961-3275ac6d72ea",
"id": "d0841fd3-9fa3-477f-bdee-1308cbf51371",
"name": "docker-fleet-agent",
"type": "metricbeat",
"version": "8.1.0"
},
"data_stream": {
"dataset": "spring_boot.threading",
"namespace": "ep",
"type": "metrics"
},
"ecs": {
"version": "8.1.0"
},
"elastic_agent": {
"id": "d0841fd3-9fa3-477f-bdee-1308cbf51371",
"snapshot": false,
"version": "8.1.0"
},
"event": {
"agent_id_status": "verified",
"category": "web",
"dataset": "spring_boot.threading",
"duration": 99822322,
"ingested": "2022-04-27T05:16:01Z",
"kind": "metric",
"module": "spring_boot",
"type": "info"
},
"host": {
"architecture": "x86_64",
"containerized": true,
"hostname": "docker-fleet-agent",
"ip": [
"172.29.0.7"
],
"mac": [
"02:42:ac:1d:00:07"
],
"name": "docker-fleet-agent",
"os": {
"codename": "focal",
"family": "debian",
"kernel": "3.10.0-1160.59.1.el7.x86_64",
"name": "Ubuntu",
"platform": "ubuntu",
"type": "linux",
"version": "20.04.3 LTS (Focal Fossa)"
}
},
"metricset": {
"name": "jmx",
"period": 60000
},
"service": {
"address": "http://springboot:8090/actuator/jolokia",
"type": "jolokia"
},
"spring_boot": {
"threading": {
"threads": {
"count": 20,
"current": {
"allocated_bytes": 430512,
"time": {
"cpu": 185403326,
"user": 180000000
}
},
"daemon": 16,
"started": 23
}
}
}
}
```

**Exported fields**

| Field | Description | Type |
|---|---|---|
| @timestamp | Event timestamp. | date |
| data_stream.dataset | Data stream dataset. | constant_keyword |
| data_stream.namespace | Data stream namespace. | constant_keyword |
| data_stream.type | Data stream type. | constant_keyword |
| ecs.version | ECS version this event conforms to. `ecs.version` is a required field and must exist in all events. When querying across multiple indices -- which may conform to slightly different ECS versions -- this field lets integrations adjust to the schema version of the events. | keyword |
| error.message | Error message. | match_only_text |
| event.category | This is one of four ECS Categorization Fields, and indicates the second level in the ECS category hierarchy. `event.category` represents the "big buckets" of ECS categories. For example, filtering on `event.category:process` yields all events relating to process activity. This field is closely related to `event.type`, which is used as a subcategory. This field is an array. This will allow proper categorization of some events that fall in multiple categories. | keyword |
| event.dataset | Name of the dataset. If an event source publishes more than one type of log or events (e.g. access log, error log), the dataset is used to specify which one the event comes from. It's recommended but not required to start the dataset name with the module name, followed by a dot, then the dataset name. | keyword |
| event.kind | This is one of four ECS Categorization Fields, and indicates the highest level in the ECS category hierarchy. `event.kind` gives high-level information about what type of information the event contains, without being specific to the contents of the event. For example, values of this field distinguish alert events from metric events. The value of this field can be used to inform how these kinds of events should be handled. They may warrant different retention, different access control, it may also help understand whether the data coming in at a regular interval or not. | keyword |
| event.module | Name of the module this data is coming from. If your monitoring agent supports the concept of modules or plugins to process events of a given source (e.g. Apache logs), `event.module` should contain the name of this module. | keyword |
| service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword |
| service.type | The type of the service data is collected from. The type can be used to group and correlate logs and metrics from one service type. Example: If logs or metrics are collected from Elasticsearch, `service.type` would be `elasticsearch`. | keyword |
| spring_boot.threading.threads.count | Current number of live threads including both daemon and non-daemon threads. | long |
| spring_boot.threading.threads.current.allocated_bytes | Allocated bytes for the current thread. | double |
| spring_boot.threading.threads.current.time.cpu | CPU time for the current thread in nanoseconds. | long |
| spring_boot.threading.threads.current.time.user | User time for the current thread. | long |
| spring_boot.threading.threads.daemon | Current number of live daemon threads. | long |
| spring_boot.threading.threads.started | Total number of threads created and also started since the Java virtual machine started. | long |

Loading

[8]ページ先頭

©2009-2026 Movatter.jp