Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to v3 api #10

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ RUN go get github.com/Masterminds/glide
WORKDIR /go/src/github.com/jirwin/burrow_exporter
COPY . /go/src/github.com/jirwin/burrow_exporter
RUN glide install
RUN go build burrow-exporter.go
RUN go build -o burrow-exporter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only difference I can see from #9. What does it do?


FROM alpine
COPY --from=glide /go/src/github.com/jirwin/burrow_exporter/burrow-exporter .
ENV BURROW_ADDR http://localhost:8000
ENV METRICS_ADDR 0.0.0.0:8080
ENV INTERVAL 30
CMD ./burrow-exporter --burrow-addr $BURROW_ADDR --metrics-addr $METRICS_ADDR --interval $INTERVAL
CMD ./burrow-exporter --burrow-addr $BURROW_ADDR --metrics-addr $METRICS_ADDR --interval $INTERVAL
20 changes: 10 additions & 10 deletions burrow_exporter/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type ConsumerGroupStatus struct {
Cluster string `json:"cluster"`
Group string `json:"group"`
Status string `json:"status"`
Complete bool `json:"complete"`
Complete float64 `json:"complete"`
MaxLag Partition `json:"maxlag"`
Partitions []Partition `json:"partitions"`
TotalLag int64 `json:"totallag"`
Expand Down Expand Up @@ -149,7 +149,7 @@ func (bc *BurrowClient) HealthCheck() (bool, error) {
}

func (bc *BurrowClient) ListClusters() (*ClustersResp, error) {
endpoint, err := bc.buildUrl("/v2/kafka")
endpoint, err := bc.buildUrl("/v3/kafka")
if err != nil {
return nil, err
}
Expand All @@ -174,7 +174,7 @@ func (bc *BurrowClient) ListClusters() (*ClustersResp, error) {
}

func (bc *BurrowClient) ClusterDetails(cluster string) (*ClusterDetailsResp, error) {
endpoint, err := bc.buildUrl(fmt.Sprintf("/v2/kafka/%s", cluster))
endpoint, err := bc.buildUrl(fmt.Sprintf("/v3/kafka/%s", cluster))
if err != nil {
return nil, err
}
Expand All @@ -201,7 +201,7 @@ func (bc *BurrowClient) ClusterDetails(cluster string) (*ClusterDetailsResp, err
}

func (bc *BurrowClient) ListConsumers(cluster string) (*ConsumerGroupsResp, error) {
endpoint, err := bc.buildUrl(fmt.Sprintf("/v2/kafka/%s/consumer", cluster))
endpoint, err := bc.buildUrl(fmt.Sprintf("/v3/kafka/%s/consumer", cluster))
if err != nil {
return nil, err
}
Expand All @@ -228,7 +228,7 @@ func (bc *BurrowClient) ListConsumers(cluster string) (*ConsumerGroupsResp, erro
}

func (bc *BurrowClient) ListConsumerTopics(cluster, consumerGroup string) (*TopicsResp, error) {
endpoint, err := bc.buildUrl(fmt.Sprintf("/v2/kafka/%s/consumer/%s/topic", cluster, consumerGroup))
endpoint, err := bc.buildUrl(fmt.Sprintf("/v3/kafka/%s/consumer/%s/topic", cluster, consumerGroup))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -257,7 +257,7 @@ func (bc *BurrowClient) ListConsumerTopics(cluster, consumerGroup string) (*Topi
}

func (bc *BurrowClient) ListClusterTopics(cluster string) (*TopicsResp, error) {
endpoint, err := bc.buildUrl(fmt.Sprintf("/v2/kafka/%s/topic", cluster))
endpoint, err := bc.buildUrl(fmt.Sprintf("/v3/kafka/%s/topic", cluster))
if err != nil {
return nil, err
}
Expand All @@ -284,7 +284,7 @@ func (bc *BurrowClient) ListClusterTopics(cluster string) (*TopicsResp, error) {
}

func (bc *BurrowClient) ConsumerGroupTopicDetails(cluster, consumerGroup, topic string) (*ConsumerGroupTopicDetailsResp, error) {
endpoint, err := bc.buildUrl(fmt.Sprintf("/v2/kafka/%s/consumer/%s/topic/%s", cluster, consumerGroup, topic))
endpoint, err := bc.buildUrl(fmt.Sprintf("/v3/kafka/%s/consumer/%s/topic/%s", cluster, consumerGroup, topic))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -315,7 +315,7 @@ func (bc *BurrowClient) ConsumerGroupTopicDetails(cluster, consumerGroup, topic
}

func (bc *BurrowClient) ConsumerGroupStatus(cluster, consumerGroup string) (*ConsumerGroupStatusResp, error) {
endpoint, err := bc.buildUrl(fmt.Sprintf("/v2/kafka/%s/consumer/%s/status", cluster, consumerGroup))
endpoint, err := bc.buildUrl(fmt.Sprintf("/v3/kafka/%s/consumer/%s/status", cluster, consumerGroup))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -344,7 +344,7 @@ func (bc *BurrowClient) ConsumerGroupStatus(cluster, consumerGroup string) (*Con
}

func (bc *BurrowClient) ConsumerGroupLag(cluster, consumerGroup string) (*ConsumerGroupStatusResp, error) {
endpoint, err := bc.buildUrl(fmt.Sprintf("/v2/kafka/%s/consumer/%s/lag", cluster, consumerGroup))
endpoint, err := bc.buildUrl(fmt.Sprintf("/v3/kafka/%s/consumer/%s/lag", cluster, consumerGroup))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -373,7 +373,7 @@ func (bc *BurrowClient) ConsumerGroupLag(cluster, consumerGroup string) (*Consum
}

func (bc *BurrowClient) ClusterTopicDetails(cluster, topic string) (*ClusterTopicDetailsResp, error) {
endpoint, err := bc.buildUrl(fmt.Sprintf("/v2/kafka/%s/topic/%s", cluster, topic))
endpoint, err := bc.buildUrl(fmt.Sprintf("/v3/kafka/%s/topic/%s", cluster, topic))
if err != nil {
return nil, err
}
Expand Down