Code Monkey home page Code Monkey logo

Comments (8)

sanderson avatar sanderson commented on June 12, 2024

Was just thinking the same thing when reviewing #35

from docs-v2.

davidgs avatar davidgs commented on June 12, 2024

I added the required lines to my telegraf.conf file, but so far it hasn't been working to actually write metrics to the db. I can write something up as soon as I figure it out.

from docs-v2.

sanderson avatar sanderson commented on June 12, 2024

@davidgs Be sure to export your 2.0 token as the INFLUX_TOKEN evar before starting up Telegraf with the new config.

Here's how to get it: https://v2.docs.influxdata.com/v2.0/users/tokens/view-tokens/

from docs-v2.

davidgs avatar davidgs commented on June 12, 2024

It was as simple as not setting the "Organization" ... I'll write something up. It's super simple once you're not being a bone-head.

from docs-v2.

timhallinflux avatar timhallinflux commented on June 12, 2024

The token can be sourced as an env var -- but, it can also be embedded in the config (just like v1 creds).

from docs-v2.

stevebang avatar stevebang commented on June 12, 2024

I was working on a page for this topic yesterday -- will continue it today. I was confused about the token bit too. @davidgs -- anything you learn and share will likely save me from some cognitive friction.

from docs-v2.

davidgs avatar davidgs commented on June 12, 2024

Using an exiisting Telegraf for v2.0 alpha

Create a new telegraf config file

$ telegraf config > telegraf.conf

Then edit the created (default) telegraf.conf file created according to the steps below:

Edit an existing telelgraf config file

Add the following to your existing telegraf.conf file:

# # Configuration for sending metrics to InfluxDB
# [[outputs.influxdb_v2]]
#   ## The URLs of the InfluxDB cluster nodes.
#   ##
#   ## Multiple URLs can be specified for a single cluster, only ONE of the
#   ## urls will be written to each interval.
#   urls = ["http://127.0.0.1:9999"]
#
#   ## Token for authentication.
#   token = ""
#
#   ## Organization is the name of the organization you wish to write to; must exist.
#   organization = ""
#
#   ## Destination bucket to write into.
#   bucket = ""
#
#   ## Timeout for HTTP messages.
#   # timeout = "5s"
  1. You must add the information for your host (url) -- and uncomment the urls line.
  2. In addition, you must either add your TOKEN to the "token=" line or export it as the INFLUX_TOKEN environment variable.
    To determine your token, use the InfluxDB user interface (UI) or the influx command line interface (CLI).

View tokens in the InfluxDB UI

  • Click the Influx icon in the navigation bar.
  • In the right panel labeled My Settings, click Tokens. All of your account’s tokens appear.
  • Click on a token name from the list to view the token and a summary of access permissions.

View tokens using the influx CLI

  • Use the influx auth find command to view tokens.

influx auth find
Filtering options such as filtering by authorization ID, username, or user ID are available.

  1. Set the organization field in the config file to an existing organization in your InfluxDBv2.0 instance

  2. Set the bucket field to an existing bucket in your InfluxDBv2.0 instance.

  3. Make sure that the organization and bucket lines are not commented out (remove the # from the beginning of the line).

Restart telegraf.

##Troubleshooting

If you are not seeing data written from telegraf to influxdb, set the location of the telegraf.log file in the telegraf.conf file, and then run telegraf --debug -config <location of config file> and then watch what is written to the log file.

from docs-v2.

sanderson avatar sanderson commented on June 12, 2024

To clarify about tokens - All requests to the 2.0 API must be authenticated. Any request that doesn't include a token is blocked. The Telegraf InfluxDB v2 output plugin includes a token config that can be used to hardcode a token into the file or you can add it as the INFLUX_TOKEN environment variable.

from docs-v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.