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

Add hsperfdata Input Plugin #2058

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ configuration options.
* [filestat](./plugins/inputs/filestat)
* [haproxy](./plugins/inputs/haproxy)
* [hddtemp](./plugins/inputs/hddtemp)
* [hsperfdata](./plugins/inputs/hsperfdata) (Hostpot JVMs)
* [http_response](./plugins/inputs/http_response)
* [httpjson](./plugins/inputs/httpjson) (generic JSON-emitting http service plugin)
* [internal](./plugins/inputs/internal)
Expand Down
1 change: 1 addition & 0 deletions plugins/inputs/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
_ "github.com/influxdata/telegraf/plugins/inputs/graylog"
_ "github.com/influxdata/telegraf/plugins/inputs/haproxy"
_ "github.com/influxdata/telegraf/plugins/inputs/hddtemp"
_ "github.com/influxdata/telegraf/plugins/inputs/hsperfdata"
_ "github.com/influxdata/telegraf/plugins/inputs/http_listener"
_ "github.com/influxdata/telegraf/plugins/inputs/http_response"
_ "github.com/influxdata/telegraf/plugins/inputs/httpjson"
Expand Down
39 changes: 39 additions & 0 deletions plugins/inputs/hsperfdata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# hsperfdata Plugin

The plugin gathers data from Hotspot JVMs via the hsperfdata files they expose. This plugin won't work if you've disabled their creation using `-XX:-UsePerfData` or `-XX:+PerfDisableSharedMem`!

### Configuration:

```toml
[[inputs.hsperfdata]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure this matches what is in sampleConfig

# Optional: gather data from processes belonging to a different user. By
# default, the username in the USER environment variable is used to generate
# the hsperfdata directory name (usually "/tmp/hsperfdata_username")
user: "root"

# use the named keys in the hsperfdata file as tags, not fields. By default,
# every key is exposed as a field. This example shows how to tag by JVM major
# version:
tags: ["java.property.java.vm.specification.version"]
```

### Measurements & Fields:

All metrics are gathered as the "java" measurement.

All keys in the hsperfdata file are exposed as fields; there's no comprehensive list as they vary by Hotspot version.

### Tags:

- All measurements have the following tags:
- pid (the process id of the monitored process)
- procname (the class name containing the `main` function being run)

### Example Output:

Most fields abbreviated; there's usually 200-300 of them:

```
$ ./telegraf -config telegraf.conf -input-filter example -test
java,host=nwhite91-mac,pid=17427,procname=com.sun.javaws.Main java.ci.totalTime="49874911809",...,sun.zip.zipFiles="28" 1479466710000000000
```
Loading