Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metricbeat] Move statsd metricbeat module to GA #16447

Merged
merged 8 commits into from
Feb 20, 2020
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Fix docs, extract development section to README
Marcin Tojek committed Feb 20, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 33c213b68b9550ff5d1b0f8aecebae9a4f9c99ba
45 changes: 2 additions & 43 deletions metricbeat/docs/modules/statsd.asciidoc
Original file line number Diff line number Diff line change
@@ -28,30 +28,14 @@ The module supports the following types of metrics:
*Set (s)*:: Measurement which counts unique occurrences until flushed (value set to 0).

[float]
=== Configuration options
=== Module-specific configuration notes

This module has some configuration options for controlling its behavior. The
following example shows all configuration options.

[source,yaml]
----
- module: statsd
metricsets: ["server"]
host: "localhost"
port: "8125"
#ttl: "30s"
----

This module also supports the
<<module-standard-options-{modulename},standard configuration options>>
described later.
The `statsd` module has these additional config options:

*`ttl`*:: It defines how long a metric will be reported after it was last recorded.
Irrespective of the given ttl, metrics will be reported at least once.
A ttl of zero means metrics will never expire.

include::{docdir}/metricbeat-options.asciidoc[]

[float]
=== Metricsets

@@ -61,31 +45,6 @@ Currently, there is only `server` metricset in `statsd` module.
==== `server`
The metricset collects metric data sent using UDP and publishes them under the `statsd` prefix.

[float]
=== Development

Run metricbeat locally with configured `statsd` module. Use favorite statsd client to emit metrics, e.g.:

[source,shell script]
----
$ npm install statsd-client
$ node
----

Emit some metrics:

[source,javascript]
----
let SDC = require('statsd-client'), sdc = new SDC({host: 'localhost', port: 8125});
sdc.increment('systemname.subsystem.value');
sdc.gauge('what.you.gauge', 100);
sdc.gaugeDelta('what.you.gauge', -70);
sdc.gauge('gauge.with.tags', 100, {foo: 'bar'});
sdc.set('set.with.tags', 100, {foo: 'bar'});
sdc.set('set.with.tags', 200, {foo: 'bar'});
sdc.set('set.with.tags', 100, {foo: 'baz'});
----


[float]
=== Example configuration
32 changes: 32 additions & 0 deletions x-pack/metricbeat/module/statsd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
### Development

Run metricbeat locally with configured `statsd` module:

```yaml
- module: statsd
metricsets: ["server"]
host: "localhost"
port: "8125"
enabled: true
#ttl: "30s"
```

Use favorite statsd client to emit metrics, e.g.:

```bash
$ npm install statsd-client
$ node
```

Emit some metrics:

```javascript
let SDC = require('statsd-client'), sdc = new SDC({host: 'localhost', port: 8125});
sdc.increment('systemname.subsystem.value');
sdc.gauge('what.you.gauge', 100);
sdc.gaugeDelta('what.you.gauge', -70);
sdc.gauge('gauge.with.tags', 100, {foo: 'bar'});
sdc.set('set.with.tags', 100, {foo: 'bar'});
sdc.set('set.with.tags', 200, {foo: 'bar'});
sdc.set('set.with.tags', 100, {foo: 'baz'});
```
45 changes: 2 additions & 43 deletions x-pack/metricbeat/module/statsd/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -20,30 +20,14 @@ The module supports the following types of metrics:
*Set (s)*:: Measurement which counts unique occurrences until flushed (value set to 0).

[float]
=== Configuration options
=== Module-specific configuration notes

This module has some configuration options for controlling its behavior. The
following example shows all configuration options.

[source,yaml]
----
- module: statsd
metricsets: ["server"]
host: "localhost"
port: "8125"
#ttl: "30s"
----

This module also supports the
<<module-standard-options-{modulename},standard configuration options>>
described later.
The `statsd` module has these additional config options:

*`ttl`*:: It defines how long a metric will be reported after it was last recorded.
Irrespective of the given ttl, metrics will be reported at least once.
A ttl of zero means metrics will never expire.

include::{docdir}/metricbeat-options.asciidoc[]

[float]
=== Metricsets

@@ -52,28 +36,3 @@ Currently, there is only `server` metricset in `statsd` module.
[float]
==== `server`
The metricset collects metric data sent using UDP and publishes them under the `statsd` prefix.

[float]
=== Development

Run metricbeat locally with configured `statsd` module. Use favorite statsd client to emit metrics, e.g.:

[source,shell script]
----
$ npm install statsd-client
$ node
----

Emit some metrics:

[source,javascript]
----
let SDC = require('statsd-client'), sdc = new SDC({host: 'localhost', port: 8125});
sdc.increment('systemname.subsystem.value');
sdc.gauge('what.you.gauge', 100);
sdc.gaugeDelta('what.you.gauge', -70);
sdc.gauge('gauge.with.tags', 100, {foo: 'bar'});
sdc.set('set.with.tags', 100, {foo: 'bar'});
sdc.set('set.with.tags', 200, {foo: 'bar'});
sdc.set('set.with.tags', 100, {foo: 'baz'});
----