Skip to content

Commit

Permalink
Add linting config and fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed Jan 9, 2025
1 parent 3284c26 commit 7710391
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 32 deletions.
72 changes: 40 additions & 32 deletions docs/static/spec/openapi/logstash-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,28 +282,31 @@ paths:
# summary:
value:
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)
- name: "[test2]>worker3"
percent_of_cpu_time: 0.85
state: waiting
traces:
- "sun.misc.Unsafe.park(Native Method)"
- "java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)"
- "java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)"
- name: "[test2]>worker2"
percent_of_cpu_time: 0.85
state: runnable
traces:
- "org.jruby.RubyClass.allocate(RubyClass.java:225)"
- "org.jruby.RubyClass.newInstance(RubyClass.java:856)"
- "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)"
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)"
- name: "[test2]>worker3"
percent_of_cpu_time: 0.85
state: waiting
traces:
- "sun.misc.Unsafe.park(Native Method)"
- "java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)"
- "java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)"
- name: "[test2]>worker2"
percent_of_cpu_time: 0.85
state: runnable
traces:
- "org.jruby.RubyClass.allocate(RubyClass.java:225)"
- "org.jruby.RubyClass.newInstance(RubyClass.java:856)"
- "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)"

/_health_report:
get:
Expand Down Expand Up @@ -346,23 +349,28 @@ paths:
type: object
properties:
indicators:
description: Information about the health of Logstash indicators.
type: object
status:
$ref: '#/components/schemas/Statuses'
examples:
healthStatusExample1:
# summary:
value:
status:
- green: Logstash is healthy.
unknown: Logstash health could not be determined.
yellow: The functionality of Logstash is in a degraded state and may need remediation to avoid the health becoming red.
red: Logstash is experiencing an outage or certain features are unavailable for use.
indicators: Information about the health of Logstash indicators.
components:
securitySchemes:
apiKeyAuth:
# description:
in: header
name: Authorization
type: apiKey
schemas:
Statuses:
type: string
description: |
Health status of Logstash, based on the aggregated status of all indicators.
Statuses are:
- `green`: Logstash is healthy.
- `unknown`: Logstash health could not be determined.
- `yellow`: The functionality of Logstash is in a degraded state and may need remediation to avoid the health becoming red.
- `red`: Logstash is experiencing an outage or certain features are unavailable for use.
enum:
- green
- red
Expand Down
52 changes: 52 additions & 0 deletions docs/static/spec/openapi/redocly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
extends:
- recommended
rules:
# Built-in rules
# Descriptions
parameter-description: warn
tag-description: warn
operation-description: off
# Document info
info-contact: warn
info-license: warn
# Examples
no-invalid-media-type-examples:
severity: warn
allowAdditionalProperties: false
no-invalid-schema-examples:
severity: warn
allowAdditionalProperties: false
# Operations
operation-operationId: error
operation-operationId-unique: error
operation-operationId-url-safe: warn
operation-summary: warn
# Parameters
path-parameters-defined: warn
# Paths
no-ambiguous-paths: warn
no-identical-paths: error
path-excludes-patterns:
severity: error
patterns:
- ^\/internal
# Responses
operation-4xx-response: off
operation-2xx-response: off
# Schema
spec: off
spec-strict-refs: off
# Tags
operation-tag-defined: off
tags-alphabetical: off
operation-singular-tag: off
# Custom rules
rule/operation-summary-length:
subject:
type: Operation
property: summary
message: Operation summary must have a minimum of 5 and maximum of 45 characters
severity: warn
assertions:
maxLength: 45
minLength: 5

0 comments on commit 7710391

Please sign in to comment.