forked from Dabz/ccloudexporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM golang:1.13 | ||
|
||
WORKDIR /go/src/app | ||
|
||
RUN git clone -b v1.3.0 https://github.com/edenhill/librdkafka.git && cd librdkafka && ./configure --prefix /usr && make && make install | ||
RUN go get github.com/Dabz/ccloudexporter/cmd/ccloudexporter | ||
RUN go install github.com/Dabz/ccloudexporter/cmd/ccloudexporter | ||
|
||
CMD ["ccloudexporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,42 @@ | |
|
||
A simple prometheus exporter that can be used to extract metrics from [Confluent Cloud Metric API](https://docs.confluent.io/current/cloud/metrics-api.html). | ||
By default, the scrapper will be exposing the metrics on [port 2112](http://localhost:2112) | ||
In order to use the scrapper, the following environment variable need to be specified: | ||
To use the scrapper, the following environment variables need to be specified: | ||
|
||
* `CCLOUD_USER`: Your Confluent Cloud login | ||
* `CCLOUD_PASSWORD`: Your Confluent Cloud password | ||
|
||
`CCLOUD_USER` and `CCLOUD_PASSWORD` environment variable will be used to invoke the https://api.telemetry.confluent.cloud endpoint | ||
`CCLOUD_USER` and `CCLOUD_PASSWORD` environment variables will be used to invoke the https://api.telemetry.confluent.cloud endpoint. | ||
|
||
## Usage | ||
``` | ||
./ccloudexporter <cluster_id> [kafka client configuration] | ||
```` | ||
## Examples | ||
## Building and executing | ||
``` | ||
go get github.com/Dabz/ccloudexporter/cmd/ccloudexporter | ||
go install github.com/Dabz/ccloudexporter/cmd/ccloudexporter | ||
export CCLOUD_USER=[email protected] | ||
export CCLOUD_PASSWORD=totopassword | ||
./ccloudexporter lkc-abc123 | ||
``` | ||
## How to build | ||
## Using docker | ||
``` | ||
docker run -e CCLOUD_USER=$CCLOUD_USER -e CCLOUD_PASSWORD=$CCLOUD_PASSWORD dabz/ccloudexporter:latest ccloudexporter lkc-abc123 | ||
``` | ||
## Using docker-compose | ||
``` | ||
export CCLOUD_USER=[email protected] | ||
export CCLOUD_PASSWORD=totopassword | ||
export CCLOUD_CLUSTER=lkc-abc123 | ||
docker-compose up -d | ||
``` | ||
TODO | ||
## How to build | ||
``` | ||
go get github.com/Dabz/ccloudexporter/cmd/ccloudexporter | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.1' | ||
|
||
services: | ||
prometheus: | ||
image: prom/prometheus | ||
volumes: | ||
- ./prometheus.yml:/prometheus.yml | ||
command: | ||
- '--config.file=/prometheus.yml' | ||
ports: | ||
- 9090:9090 | ||
restart: always | ||
ccloud_exporter: | ||
build: ./ | ||
environment: | ||
CCLOUD_USER: ${CCLOUD_USER} | ||
CCLOUD_PASSWORD: ${CCLOUD_PASSWORD} | ||
CCLOUD_CLUSTER: ${CCLOUD_CLUSTER} | ||
command: ccloudexporter ${CCLOUD_CLUSTER} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.1' | ||
|
||
services: | ||
prometheus: | ||
image: prom/prometheus | ||
volumes: | ||
- ./prometheus.yml:/prometheus.yml | ||
command: | ||
- '--config.file=/prometheus.yml' | ||
ports: | ||
- 9090:9090 | ||
restart: always | ||
ccloud_exporter: | ||
image: dabz/ccloudexporter | ||
environment: | ||
CCLOUD_USER: ${CCLOUD_USER} | ||
CCLOUD_PASSWORD: ${CCLOUD_PASSWORD} | ||
CCLOUD_CLUSTER: ${CCLOUD_CLUSTER} | ||
command: ccloudexporter ${CCLOUD_CLUSTER} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
global: | ||
scrape_interval: 15s | ||
scrape_configs: | ||
- job_name: 'ccloudexporter' | ||
scrape_interval: 15s | ||
static_configs: | ||
- targets: ['ccloud_exporter:2112'] | ||
|