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

telegraf problem #10

Open
metal3d opened this issue Oct 6, 2017 · 2 comments
Open

telegraf problem #10

metal3d opened this issue Oct 6, 2017 · 2 comments

Comments

@metal3d
Copy link

metal3d commented Oct 6, 2017

Hi,
First: thanks for that nice package !

I wanted to try telegraf and that's what I've got:

./telegraf -config telegraf.conf 
2017-10-06T18:14:38Z I! Starting Telegraf v1.5.0~59bb31e7
2017-10-06T18:14:38Z I! Loaded outputs: influxdb
2017-10-06T18:14:38Z I! Loaded inputs: inputs.influxdb
2017-10-06T18:14:38Z I! Tags enabled: host=iidor.dhcp.lyon.intranet
2017-10-06T18:14:38Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"iidor.dhcp.lyon.intranet", Flush Interval:10s 
2017-10-06T18:14:40Z E! Error in plugin [inputs.influxdb]: [url=http://127.0.0.1:9090/debug/vars]: invalid character '<' looking for beginning of value

And yes, http://127.0.0.1:9090/debug/vars returns a 404 while graph are correctly displayed in grafana at http://127.0.0.1:9090

This is the config I've got:


# Global tags can be specified here in key="value" format.
[global_tags]
  # dc = "us-east-1" # will tag all metrics with dc=us-east-1
  # rack = "1a"
  ## Environment variables can be used as tags, and throughout the config file
  # user = "$USER"


# Configuration for telegraf agent
[agent]
  interval = "10s"
  round_interval = true

  metric_batch_size = 1000

  metric_buffer_limit = 10000

  collection_jitter = "0s"

  flush_interval = "10s"
  flush_jitter = "0s"

  precision = ""

  debug = false
  quiet = false
  logfile = ""

  hostname = ""
  omit_hostname = false

[[inputs.influxdb]]
  urls = ["http://127.0.0.1:9090/debug/vars"]

[[outputs.influxdb]]
  urls = ["http://127.0.0.1:8086"] # required
  database = "stats" # required
  timeout = "5s"

My package includes everything at startup:

package ogle

import (
	"fmt"
	"time"

	metrics "github.com/tevjef/go-runtime-metrics"
	_ "github.com/tevjef/go-runtime-metrics/expvar"
)

func init() {
	metrics.DefaultConfig.CollectionInterval = time.Second
	if err := metrics.RunCollector(metrics.DefaultConfig); err != nil {
		fmt.Println(err)
	}
}

One more time, graphs are ok.

Can you tell me what I'm doing wrong ?

@metal3d
Copy link
Author

metal3d commented Oct 6, 2017

I forget to say that I'm starting grafana and influxdb with a docker-compose file:

version: "2"
services:
  grafana:
    image: grafana/grafana:4.1.0
    ports:
      - 9090:3000
  influxdb:
    image: influxdb
    ports:
      - 8086:8086

@metal3d
Copy link
Author

metal3d commented Oct 6, 2017

Ok, I just understand that the input in example is wrong. 6060 (or 9090 in my own install) should be 8086, that is the port for influxdb and not graphana. I didn't checked (because the lack of knowledge about telegraf).

Now... the only problem is that I really dont understand what does telegraf and how to configure grafana to use it :)

Could you please make precision in you example ?

Thanks a lot

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

No branches or pull requests

1 participant