Skip to content

Commit

Permalink
Add fields for Nginx and Nginx stub metricset
Browse files Browse the repository at this point in the history
  • Loading branch information
KS Chan committed May 2, 2016
1 parent 02108ed commit ed26ba2
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 1 deletion.
84 changes: 84 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ grouped in the following categories:
* <<exported-fields-apache>>
* <<exported-fields-redis>>
* <<exported-fields-mysql>>
* <<exported-fields-nginx>>
* <<exported-fields-system>>

[[exported-fields-common]]
Expand Down Expand Up @@ -518,6 +519,89 @@ type: long
The number of bytes sent to all clients.


[[exported-fields-nginx]]
=== Nginx Status Fields

Nginx server status metrics collected from various modules.



=== nginx-stubstatus Fields

`nginx-stubstatus` contains the metrics that were scraped from the ngx_http_stub_status_module status page.



==== nginx-stubstatus.hostname

type: keyword

Nginx hostname


==== nginx-stubstatus.active

type: integer

The current number of active client connections including Waiting connections.


==== nginx-stubstatus.accepts

type: integer

The total number of accepted client connections.


==== nginx-stubstatus.handled

type: integer

The total number of handled client connections.


==== nginx-stubstatus.dropped

type: integer

The total number of dropped client connections.


==== nginx-stubstatus.requests

type: integer

The total number of client requests.


==== nginx-stubstatus.current

type: integer

The current number of client requests.


==== nginx-stubstatus.reading

type: integer

The current number of connections where nginx is reading the request header.


==== nginx-stubstatus.writing

type: integer

The current number of connections where nginx is writing the response back to the client.


==== nginx-stubstatus.waiting

type: integer

The current number of idle client connections waiting for a request.


[[exported-fields-system]]
=== System Status Fields

Expand Down
51 changes: 51 additions & 0 deletions metricbeat/etc/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sections:
- ["apache", "Apache Status"]
- ["redis", "Redis Info"]
- ["mysql", "MySQL Status"]
- ["nginx", "Nginx Status"]
- ["system", "System Status"]

common:
Expand Down Expand Up @@ -284,6 +285,56 @@ mysql:
type: long
description: >
The number of bytes sent to all clients.
nginx:
type: group
description: >
Nginx server status metrics collected from various modules.
fields:
- name: nginx-stubstatus
type: group
description: >
`nginx-stubstatus` contains the metrics that were scraped from the ngx_http_stub_status_module status page.
fields:
- name: hostname
type: keyword
description: >
Nginx hostname
- name: active
type: integer
description: >
The current number of active client connections including Waiting connections.
- name: accepts
type: integer
description: >
The total number of accepted client connections.
- name: handled
type: integer
description: >
The total number of handled client connections.
- name: dropped
type: integer
description: >
The total number of dropped client connections.
- name: requests
type: integer
description: >
The total number of client requests.
- name: current
type: integer
description: >
The current number of client requests.
- name: reading
type: integer
description: >
The current number of connections where nginx is reading the request header.
- name: writing
type: integer
description: >
The current number of connections where nginx is writing the response back to the client.
- name: waiting
type: integer
description: >
The current number of idle client connections waiting for a request.
redis:
type: group
description: >
Expand Down
1 change: 1 addition & 0 deletions metricbeat/etc/fields_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sections:
- ["apache", "Apache Status"]
- ["redis", "Redis Info"]
- ["mysql", "MySQL Status"]
- ["nginx", "Nginx Status"]
- ["system", "System Status"]

common:
Expand Down
36 changes: 36 additions & 0 deletions metricbeat/metricbeat.template-es2x.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,42 @@
}
}
},
"nginx-stubstatus": {
"properties": {
"accepts": {
"type": "integer"
},
"active": {
"type": "integer"
},
"current": {
"type": "integer"
},
"dropped": {
"type": "integer"
},
"handled": {
"type": "integer"
},
"hostname": {
"ignore_above": 1024,
"index": "not_analyzed",
"type": "string"
},
"reading": {
"type": "integer"
},
"requests": {
"type": "integer"
},
"waiting": {
"type": "integer"
},
"writing": {
"type": "integer"
}
}
},
"redis-info": {
"properties": {
"clients": {
Expand Down
35 changes: 35 additions & 0 deletions metricbeat/metricbeat.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,41 @@
}
}
},
"nginx-stubstatus": {
"properties": {
"accepts": {
"type": "integer"
},
"active": {
"type": "integer"
},
"current": {
"type": "integer"
},
"dropped": {
"type": "integer"
},
"handled": {
"type": "integer"
},
"hostname": {
"ignore_above": 1024,
"type": "keyword"
},
"reading": {
"type": "integer"
},
"requests": {
"type": "integer"
},
"waiting": {
"type": "integer"
},
"writing": {
"type": "integer"
}
}
},
"redis-info": {
"properties": {
"clients": {
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,5 @@ logging:
# Sets log level. The default log level is error.
# Available log levels are: critical, error, warning, info, debug
#level: error


5 changes: 5 additions & 0 deletions metricbeat/module/nginx/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nginx:
type: group
description: >
Nginx server status metrics collected from various modules.
fields:
45 changes: 45 additions & 0 deletions metricbeat/module/nginx/stubstatus/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- name: nginx-stubstatus
type: group
description: >
`nginx-stubstatus` contains the metrics that were scraped from the ngx_http_stub_status_module status page.
fields:
- name: hostname
type: keyword
description: >
Nginx hostname
- name: active
type: integer
description: >
The current number of active client connections including Waiting connections.
- name: accepts
type: integer
description: >
The total number of accepted client connections.
- name: handled
type: integer
description: >
The total number of handled client connections.
- name: dropped
type: integer
description: >
The total number of dropped client connections.
- name: requests
type: integer
description: >
The total number of client requests.
- name: current
type: integer
description: >
The current number of client requests.
- name: reading
type: integer
description: >
The current number of connections where nginx is reading the request header.
- name: writing
type: integer
description: >
The current number of connections where nginx is writing the response back to the client.
- name: waiting
type: integer
description: >
The current number of idle client connections waiting for a request.
2 changes: 1 addition & 1 deletion metricbeat/module/nginx/stubstatus/stubstatus.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Reads server status from nginx host under /server-status, stub_status module is required.
// Reads server status from nginx host under /server-status, ngx_http_stub_status_module is required.
package stubstatus

import (
Expand Down

0 comments on commit ed26ba2

Please sign in to comment.