ccloud-go-sdk

module
v0.0.0-...-1825ddb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2021 License: Apache-2.0

README

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 |

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL