Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

nerdynick/ccloud-go-sdk

Repository files navigation

ccloud-go-sdk

A Confluent Cloud GOLang SDK for the Telemetry API

Go Report Card Build Status GoDoc

How To

Install/Get

go get github.com/nerdynick/ccloud-go-sdk

Create Telemetry Client

import "github.com/nerdynick/ccloud-go-sdk/telemetry"

func main(){
    telemetryClient := telemetry.New(MyAPIKey, MyAPISecret)
}

The TelemetryClient also has the following additional attributes that you can adjust to configure how the TelemetryClient interacts with the API

PageLimit  int
DataSet    Dataset
BaseURL    string
MaxWorkers int

Get All Available Resources

import "github.com/nerdynick/ccloud-go-sdk/telemetry"

func main(){
    telemetryClient := telemetry.New(MyAPIKey, MyAPISecret)
    resourceTypes, err := telemetryClient.GetAvailableResources()
}

Get All Available Metrics for a Kafka Cluster

import (
    "github.com/nerdynick/ccloud-go-sdk/telemetry"
    "github.com/nerdynick/ccloud-go-sdk/telemetry/labels"
)

func main(){
    telemetryClient := telemetry.New(MyAPIKey, MyAPISecret)
    metrics, err := telemetryClient.GetAvailableMetricsForResource(labels.ResourceKafka, "MyClusterID")
}

Get All Available Metrics

Do Note: This func is deprecated post Telemetry API V1. You will want to use the GetAvailableMetricsForResource instead.

import "github.com/nerdynick/ccloud-go-sdk/telemetry"

func main(){
    telemetryClient := telemetry.New(MyAPIKey, MyAPISecret)
    metrics, err := telemetryClient.GetAvailableMetrics()
}

Documentation

Full Docs | Telemetry Docs |

About

Confluent Cloud Metrics API SDK in GOLang

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages