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

http json output plugin #4389

Closed
vikrant6 opened this issue Jul 5, 2018 · 2 comments
Closed

http json output plugin #4389

vikrant6 opened this issue Jul 5, 2018 · 2 comments
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@vikrant6
Copy link
Contributor

vikrant6 commented Jul 5, 2018

No description provided.

@vikrant6
Copy link
Contributor Author

vikrant6 commented Jul 5, 2018

System info:

[Include Telegraf version, operating system name, and other relevant details]

telegraf version 1.7.0
mac os

Steps to reproduce:

Configure the http output plugin to post to an https endpoint.

[[inputs.cpu]]
  ## Whether to report per-cpu stats or not
  percpu = true
  ## Whether to report total system cpu stats or not
  totalcpu = true
  ## If true, collect raw CPU time metrics.
  collect_cpu_time = false
  ## If true, compute and report the sum of all non-idle CPU states.
  report_active = false


# Read metrics about memory usage
[[inputs.mem]]
    ...
    ...

Expected behavior:
post json to the configured url
Actual behavior:
Errors out and crashes with below error

anic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x4dbe75a]

goroutine 8 [running]:
github.com/influxdata/telegraf/plugins/outputs/http.(*HTTP).write(0xc420446000, 0xc4200fc900, 0x5d8, 0x8d3, 0x0, 0x0)
	/private/tmp/telegraf-20180614-31387-h4ela8/telegraf-1.7.0/src/github.com/influxdata/telegraf/plugins/outputs/http/http.go:131 +0xca
github.com/influxdata/telegraf/plugins/outputs/http.(*HTTP).Write(0xc420446000, 0xc42030c1e0, 0x5, 0x5, 0xc420300101, 0xc4203dbe68)
	/private/tmp/telegraf-20180614-31387-h4ela8/telegraf-1.7.0/src/github.com/influxdata/telegraf/plugins/outputs/http/http.go:121 +0x97
github.com/influxdata/telegraf/internal/models.(*RunningOutput).write(0xc4200d8dc0, 0xc42030c1e0, 0x5, 0x5, 0x0, 0x0)
	/private/tmp/telegraf-20180614-31387-h4ela8/telegraf-1.7.0/src/github.com/influxdata/telegraf/internal/models/running_output.go:179 +0xf7
github.com/influxdata/telegraf/internal/models.(*RunningOutput).Write(0xc4200d8dc0, 0x52b42a8, 0xc420296180)
	/private/tmp/telegraf-20180614-31387-h4ela8/telegraf-1.7.0/src/github.com/influxdata/telegraf/internal/models/running_output.go:161 +0x462
github.com/influxdata/telegraf/agent.(*Agent).flush.func1(0xc420296180, 0xc4200d8dc0)
	/private/tmp/telegraf-20180614-31387-h4ela8/telegraf-1.7.0/src/github.com/influxdata/telegraf/agent/agent.go:232 +0x59
created by github.com/influxdata/telegraf/agent.(*Agent).flush
	/private/tmp/telegraf-20180614-31387-h4ela8/telegraf-1.7.0/src/github.com/influxdata/telegraf/agent/agent.go:230 +0xa3
Additional info:

[Include gist of relevant config, logs, etc.]

@danielnelson danielnelson added this to the 1.7.2 milestone Jul 5, 2018
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Jul 5, 2018
@glinton glinton self-assigned this Jul 16, 2018
glinton added a commit that referenced this issue Jul 16, 2018
@glinton
Copy link
Contributor

glinton commented Jul 16, 2018

@vikrant6 I'm not sure if you were able to continue, but you'll need to ensure the url format in your output block matches the following: [scheme:][//[userinfo@]host][/]path[?query][#fragment]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants