Skip to content

Commit

Permalink
Add framework for node and hot threads
Browse files Browse the repository at this point in the history
  • Loading branch information
karenzone committed Dec 27, 2024
1 parent 0cd5d16 commit 64863e1
Showing 1 changed file with 41 additions and 76 deletions.
117 changes: 41 additions & 76 deletions docs/static/spec/openapi/starter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,52 +28,28 @@ servers:
- url: /
security:
- apiKeyAuth: []
paths:

## Node info API

/_node/plugins:
paths:
/_node/<types>:
get:
summary: Get node info
description: >
Get information about all Logstash plugins that are currently installed.
This API returns the output of running the `bin/logstash-plugin list --verbose` command.
operationId: nodePlugins
parameters:
- name: pretty
in: query
schema:
type: boolean
description: >
If you append `?pretty=true` to the request, the JSON returned will be pretty formatted (use it for debugging only!).
responses:
'200':
description: Indicates a successful call
content:
application/json:
examples:
nodePluginsExample1:
total: 1
plugins:
- name: logstash-codec-cef
version: 4.1.2
Get information about Logstash nodes, where `<types>` (optional) specifies the types of node info you want returned.
You can limit the info that is returned by combining any of these types in a comma-separated list:
- `pipelines`
- `os`
- `jvm`

/_node/plugins:
get:
summary: Get plugin info
description: >
Get information about all Logstash plugins that are currently installed.
This API returns the output of running the `bin/logstash-plugin list --verbose` command.
operationId: nodePlugins
parameters:
- name: pretty
in: query
schema:
type: boolean
description: >
If you append `?pretty=true` to the request, the JSON returned will be pretty formatted (use it for debugging only!).
If you append `?pretty=true` to the request, the JSON returned will be pretty formatted. Use it for debugging only!
responses:
'200':
description: Indicates a successful call
Expand All @@ -84,52 +60,21 @@ paths:
total: 1
plugins:
- name: logstash-codec-cef
version: 6.2.7

## Plugins info API (LISA)

version: 4.1.2
/_node/plugins:
get:
summary: Get plugin info
description: >
Get information about all Logstash plugins that are currently installed.
This API returns the output of running the `bin/logstash-plugin list --verbose` command.
This API returns the same output you get by running the `bin/logstash-plugin list --verbose` command.
operationId: nodePlugins
parameters:
- name: pretty
in: query
schema:
type: boolean
description: >
If you append `?pretty=true` to the request, the JSON returned will be pretty formatted (use it for debugging only!).
responses:
'200':
description: Indicates a successful call
content:
application/json:
examples:
nodePluginsExample1:
total: 1
plugins:
- name: logstash-codec-cef
version: 6.2.7

## Node stats API

/_node/plugins:
get:
summary: Get node info
description: >
Get information about all Logstash plugins that are currently installed.
This API returns the output of running the `bin/logstash-plugin list --verbose` command.
operationId: nodePlugins
parameters:
- name: pretty
in: query
schema:
type: boolean
description: >
If you append `?pretty=true` to the request, the JSON returned will be pretty formatted (use it for debugging only!).
If you append `?pretty=true` to the request, the JSON returned will be pretty formatted. Use it for debugging only!
responses:
'200':
description: Indicates a successful call
Expand All @@ -142,9 +87,6 @@ paths:
- name: logstash-codec-cef
version: 4.1.2


## Hot Threads API

/_node/hot_threads:
get:
summary: Get hot threads
Expand All @@ -153,27 +95,50 @@ paths:
A hot thread is a Java thread that has high CPU usage and takes longer than normal to execute.
operationId: nodeHot_threads
parameters:
- name: threads
in: query
schema:
type: integer
description: >
The number of hot threads to return. The default is 10.
- name: stacktrace_size
in: query
schema:
type: integer
description: >
The depth of the stack trace to report for each thread. The default is 50.
- name: ignore_idle_threads
in: query
schema:
type: boolean
description: >
If true, does not return idle threads. The default is `true`.
- name: pretty
in: query
schema:
type: boolean
description: >
If you append `?pretty=true` to the request, the JSON returned will be pretty formatted (use it for debugging only!).
If you append `?pretty=true` to the request, the JSON returned will be pretty formatted. Use it for debugging only!
- name: human
in: query
schema:
type: boolean
description: >
If you append `?human=true` to the request, the JSON returned will be in a human-readable format.
responses:
'200':
description: Indicates a successful call
content:
application/json:
examples:
nodePluginsExample1:
total: 1
plugins:
- name: logstash-codec-cef
version: 4.1.2
nodeHotThreadsExample1:
hot_threads:
- time: 2025-01-06T18:25:28-07:00
busiest_threads: 3
threads:
name: Ruby-0-Thread-7
percent_of_cpu_time: 0.0
state: timed_waiting
path: /path/to/logstash-8.17.0/vendor/bundle/jruby/1.9/gems/puma-2.16.0-java/lib/puma/thread_pool.rb:187
traces: java.lang.Object.wait(Native Method)", "org.jruby.RubyThread.sleep(RubyThread.java:1002)", "org.jruby.RubyKernel.sleep(RubyKernel.java:803)

0 comments on commit 64863e1

Please sign in to comment.