intelsdi-x / snap-plugin-collector-elasticsearch

Collects Elasticsearch cluster and nodes statistics
http://snap-telemetry.io/
Apache License 2.0
3 stars 14 forks source link

zero type of plugin.MetricType returned for all collected metrics #9

Closed woodsaj closed 8 years ago

woodsaj commented 8 years ago

steps to reproduce.

1) start up snap with elasticsearch plugin configured


---
log_level: 1
control:
  plugin_trust_level: 0
  plugins:
    collector:
      elasticsearch:
        all:
          server: 127.0.0.1
          port: 9200

2) create task to collect metrics

curl -X POST http://localhost:8181/v1/tasks -d '{
  "name": "es-test",
  "start": true,
  "workflow": {
    "collect": {
      "metrics": {
        "/intel/elasticsearch/*": {}
      }
    }
  },
  "schedule": {
    "type": "simple",
    "interval": "10s"
  }
}'

3) watch task

All data is the zero type of plugin.MetricType

data: {"type":"stream-open","message":"Stream opened"}

data: {"type":"metric-event","message":"","event":[{"namespace":"/","data":null,"timestamp":"0001-01-01T00:00:00Z","tags":{"plugin_running_on":"anthony-desktop"}},
...
candysmurf commented 8 years ago

@woodsaj , thanks for the steps. I'll take a look tomorrow and update you later.

candysmurf commented 8 years ago

@woodsaj, Are you suggesting removing all data that has zero type of plugin.MetricType automatically or as an option?

woodsaj commented 8 years ago

No i am saying that the plugin does not work at all. All data metrics returned for a task are zero type.

candysmurf commented 8 years ago

@woodsaj, Apparently, new metric schema String() method added the leading slash, which caused this issue. I just submitted a PR. Do you mind review it and let me know if it fixed your issue. thanks.

woodsaj commented 8 years ago

@candysmurf yep, things are now working as expected.

candysmurf commented 8 years ago

@woodsaj, thanks for the confirmation. We'll merge PR soon.

candysmurf commented 8 years ago

PR #10 is merged.