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

Clarification on DB connection #9

Closed
k-s-dean opened this issue Jan 26, 2017 · 8 comments
Closed

Clarification on DB connection #9

k-s-dean opened this issue Jan 26, 2017 · 8 comments

Comments

@k-s-dean
Copy link

@brian-brazil

Hi Brian,

Would it be possible to get some clarification on how to use influxdb_exporter, i need to use this exporter until go 1.8.0 and telegraf 1.3.0 is released as i am trying to connect telegraf to prometheus.
However telegraf currently has a bug #influxdata/telegraf#2282 which is causing issues within prometheus and grafana.

Until then i would like to use this if possible,
I have already looked through the code to see if there is any mention of a database but so far i haven't come across anything .

Could i clarify with you, is telegraf meant to write to the influxdb_exporter or is the influxdb_exporter meant to collect from an influxdb instance ? Have i misunderstood the docs or am i on the right track.

when configuring telegraf to point to the influxdb_exporter like so... as per your docs.

 [[outputs.influxdb]] 
   urls = ["http://localhost:9122"]
   database = "influxdb"  # this says it is required in the telegraf docs

I get the following from telegrafs docker logs output.

Database creation failed: Post http://localhost:9122/query?db=&q=CREATE+DATABASE+%22influxdb%22: dial tcp [::1]:9122: getsockopt: connection refused

Error writing to output [influxdb]: Could not write to any InfluxDB server in cluster

Is this repo still being maintained? or have you dropped it because telegraf already supports exposing Prometheus style endpoints ?

Notes: Everything is running in a container.

Thank you in advance for your help.

Kind Regards
K

@brian-brazil
Copy link
Contributor

Telegraf or whatever is meant to write to the influxdb exporter.

Is this repo still being maintained? or have you dropped it because telegraf already supports exposing Prometheus style endpoints ?

Support hasn't been dropped, there's things other than telegraf that speak influx's protocol.

@k-s-dean
Copy link
Author

Ok Sweet, Glad its still being maintained.

Any clue on how to get it running with telegraf/create database or should it just work?

@brian-brazil
Copy link
Contributor

It's meant to just work.

@k-s-dean
Copy link
Author

Is it possible for you test with latest telegraf to see if the issue is reproducible ?

@k-s-dean
Copy link
Author

Thanks for your help, User error. You got me thinking after you said it was just meant to work.

Regards

K

@brian-brazil
Copy link
Contributor

Grand then.

@stvnwrgs
Copy link

stvnwrgs commented Apr 18, 2017

I get the same error from my telegraf client (1.2.1). And I don't see any data in the exporter endpoint.

Any clue on how to get it running with telegraf/create database or should it just work?

It's meant to just work.

You got me thinking after you said it was just meant to work.

Maybe you guys could also include me into your telepathy club, only believing did not fixed the issue ...

@k-s-dean
Copy link
Author

@stvnwrgs , your last comment made me laugh, did you not know you need to be telepathic in IT?
I personally user the power of the universe and then ill refer to google.

So lucky for you i have dug into my old configs to provide you an answer, and here it is.

In the output plugins section of your telegraf config. Do like so....

[outputs.influxdb]]
#urls = ["http://CONTAINER-NAME.PRIVATE-DOCKERNETWORK:9122"]
urls = ["http://influxexporter.exporters_default:9122"]
database = "influxexporter-prd-int"
## Write timeout (for the InfluxDB client), formatted as a string.
## If not provided, will default to 5s. 0s means no timeout (not recommended).
timeout = "5s"
write_consistency = "one"

some notes on this configuration,

  • all my exporters are sitting behind TLS internally and externally, i suggest you do the same as best practice, bind your containers to localhost and redirect using nginx or a suitable web-server, if your monitoring in the cloud it is highly advisable as promethues does not provide native tls or ssl meaning your metrics will be exposed to the web allowing attackers to gain useful information about your systems.

And i feel your pain i had to build an entire monitoring system at my org with little to no documentation. Next you should try openstack ;)

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

3 participants