Giter Club home page Giter Club logo

ccloud-influx's Introduction

ccloud-influx

Demo Setup for Scraping Confluent Cloud Metrics (Metrics API) with Telegraf and save them to influxdb.

1. Prerequisites

  • docker-compose
  • access to Confluent Cloud
  • a Confluent Cloud Cluster

2. create Cloud API Key and Secret

create with Confluent CLI or Cloud UI

confluent api-key create --resource cloud

Save both the api key and the secret

Output will look like

+------------+------------------------------------------------------------------+
| API Key    | 3RDR6YRBVOG3S4MP                                                 |
| API Secret | lkmqOGxtdQ+PuVq8gD+hmTWpeettHZKAZV3y72Ic7cMYirKf2sj86cFk86O52ZfB |
+------------+------------------------------------------------------------------+

3. set the required env variables

export CCLOUD_METRICS_API_KEY="3RDR6YRBVOG3S4MP"
export CCLOUD_METRICS_API_SECRET="lkmqOGxtdQ+PuVq8gD+hmTWpeettHZKAZV3y72Ic7cMYirKf2sj86cFk86O52ZfB"
export DOCKER_INFLUXDB_INIT_ORG=demo-org
export DOCKER_INFLUXDB_INIT_BUCKET=demo-bucket
export DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=testtoken

4. adapt telegraf.conf

adapt line 148 set to your cluster id, s.th like lkc-xxxxxx

urls = ["https://api.telemetry.confluent.cloud/v2/metrics/cloud/export?resource.kafka.id=lkc-z310w0"]

5. start the stack with

docker-compose up -d 

check the logs for the both container started.

6. check the collected metrics via influxdb ui

point you browser to

http://localhost:8086

login with the credentials set in docker-compose.yml (user:root, pw:welcome12)

check the bucket for incoming data and query it

influx01

Happy testing!

Refs

https://docs.confluent.io/confluent-cli/current/command-reference/api-key/confluent_api-key_create.html

https://www.influxdata.com/blog/running-influxdb-2-0-and-telegraf-using-docker/

ccloud-influx's People

Contributors

mmuehlbeyer avatar

Watchers

 avatar

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.