Skip to content

Commit

Permalink
Adjusted metric type in line with latest changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfeidau committed Dec 20, 2016
1 parent 81f9a7a commit 2fbca33
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions plugins/outputs/kinesis/kinesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,19 @@ func (k *KinesisOutput) Write(metrics []telegraf.Metric) error {
return err
}

for _, metric := range values {
d := kinesis.PutRecordsRequestEntry{
Data: []byte(metric),
PartitionKey: aws.String(k.PartitionKey),
}
r = append(r, &d)

if sz == 500 {
// Max Messages Per PutRecordRequest is 500
elapsed := writekinesis(k, r)
log.Printf("E! Wrote a %+v point batch to Kinesis in %+v.\n", sz, elapsed)
sz = 0
r = nil
}
d := kinesis.PutRecordsRequestEntry{
Data: values,
PartitionKey: aws.String(k.PartitionKey),
}

r = append(r, &d)

if sz == 500 {
// Max Messages Per PutRecordRequest is 500
elapsed := writekinesis(k, r)
log.Printf("E! Wrote a %+v point batch to Kinesis in %+v.\n", sz, elapsed)
sz = 0
r = nil
}

}
Expand Down

0 comments on commit 2fbca33

Please sign in to comment.