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

use raw host name + add time precision option #26

Merged
merged 1 commit into from
Sep 25, 2015

Conversation

BarthV
Copy link

@BarthV BarthV commented Sep 24, 2015

This PR is based on old & outdated PR #21.

2 things :

  • Change Body "name" => key.gsub!('-','') to "name" => key
    • AFAIK there's no technical limit that prevent us to use - in metric name.
  • add time_precision in influx url option.

a check with a modified metrics-load script that use ms epoch timestamps

{
  "checks": {
    "metric-load": {
      "interval": 10,
      "type": "metric",
      "command": "metrics-load-ms.rb",
      "time_precision": "ms",
      "subscribers": [
        "all"
      ],
      "handlers": [
        "influx"
      ]
    }
  }
}

Result :

POST /db/sensu.metrics/series?time_precision=ms&u=*****&p=***** HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Connection: close
Host: dev.metrics.local:8086
User-Agent: EventMachine HttpClient
Content-Length: 90

[{"name":"test.load_avg.one","columns":["time","value"],"points":[[1443099053000.0,2.0]]}]

With the real community plugin (that output with epoch in seconds) :

POST /db/sensu.metrics/series?time_precision=s&u=*****&p=***** HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Connection: close
Host: dev.metrics.local:8086
User-Agent: EventMachine HttpClient
Content-Length: 87

[{"name":"test.load_avg.one","columns":["time","value"],"points":[[1443097834.0,0.0]]}]

@alfredopalhares
Copy link

thumbs-up

Good research, thank you!

alfredopalhares pushed a commit that referenced this pull request Sep 25, 2015
Use raw host name + add time precision option
@alfredopalhares alfredopalhares merged commit 04cf5bf into seegno:master Sep 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants