Skip to content

Commit a25597f

Browse files
authored
Use Golang 1.13.1, Azure EventHubs SDK 2.0.3 (#9)
* update sdk, golang dependencies * remove throughput calc
1 parent ff0f262 commit a25597f

8 files changed

Lines changed: 57 additions & 127 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ Template:
1212
### Fixed
1313
```
1414

15-
## v0.3.3 - \[Unreleased\]
15+
## v0.3.3 - 14 October 2019
1616
### Changed
17+
- build with golang 1.13.1
18+
- use azure event hubs sdk v2.0.3
19+
### Removed
20+
- throughput calc function
21+
### Fixed
1722
- debug message in hub package not accurate
1823

1924
## v0.3.2 - 20 August 2019

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Encodes events as JSON using the goavro library. The Avro-JSON data model is the
169169

170170
Requirements:
171171

172-
* [Go](https://golang.org/dl/) 1.12.x or higher
172+
* [Go](https://golang.org/dl/) 1.13.x or higher
173173
* Go [modules](https://github.com/golang/go/wiki/Modules) is used for dependency management
174174

175175
```bash

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trigger:
77
- master
88

99
variables:
10-
GOVERSION: '1.12.9'
10+
GOVERSION: '1.13.1'
1111
LDFLAGS: "-w -s -X main.Version=$(Build.SourceBranchName) -X main.Commit=$(Build.SourceVersion) -X main.Build=$(Build.BuildNumber)"
1212

1313
jobs:

go.mod

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
module github.com/bryanklewis/prometheus-eventhubs-adapter
22

3-
go 1.12
3+
go 1.13
44

55
require (
66
github.com/Azure/azure-amqp-common-go/v2 v2.1.0
7-
github.com/Azure/azure-event-hubs-go/v2 v2.0.1
7+
github.com/Azure/azure-event-hubs-go/v2 v2.0.3
88
github.com/Azure/go-autorest v12.0.0+incompatible
99
github.com/gin-gonic/gin v1.4.0
10-
github.com/gogo/protobuf v1.2.1
10+
github.com/gogo/protobuf v1.3.1
1111
github.com/golang/snappy v0.0.1
12-
github.com/linkedin/goavro/v2 v2.9.6
12+
github.com/linkedin/goavro/v2 v2.9.7
1313
github.com/mitchellh/go-homedir v1.1.0
14-
github.com/prometheus/client_golang v1.0.0
15-
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
16-
github.com/prometheus/common v0.6.0
14+
github.com/prometheus/client_golang v1.1.0
15+
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
16+
github.com/prometheus/common v0.7.0
1717
github.com/prometheus/prometheus v2.5.0+incompatible
18-
github.com/rs/zerolog v1.14.3
19-
github.com/spf13/pflag v1.0.3
18+
github.com/rs/zerolog v1.15.0
19+
github.com/spf13/pflag v1.0.5
2020
github.com/spf13/viper v1.4.0
21-
google.golang.org/genproto v0.0.0-20190708153700-3bdd9d9f5532 // indirect
2221
)

go.sum

Lines changed: 40 additions & 20 deletions
Large diffs are not rendered by default.

main.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -261,18 +261,6 @@ func writeHandler(w writer) func(c *gin.Context) {
261261
log.ErrorObj(err).Int("num_samples", len(samples)).Msg("Error sending samples to remote storage")
262262
return
263263
}
264-
265-
counter, err := sentSamples.GetMetricWithLabelValues(w.Name())
266-
if err != nil {
267-
log.ErrorObj(err).Str("labelValue", w.Name()).Msg("Couldn't get a counter")
268-
}
269-
writeThroughput.SetCurrent(getCounterValue(counter))
270-
271-
select {
272-
case d := <-writeThroughput.Values:
273-
log.Info().Float64("samples_per_sec", d).Msg("Samples write throughput")
274-
default:
275-
}
276264
}
277265
}
278266

metric.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ package main
2323
*/
2424

2525
import (
26-
"time"
27-
2826
"github.com/prometheus/client_golang/prometheus"
29-
30-
"github.com/bryanklewis/prometheus-eventhubs-adapter/util"
3127
)
3228

3329
var (
@@ -80,8 +76,6 @@ var (
8076
},
8177
[]string{"path"},
8278
)
83-
84-
writeThroughput = util.NewThroughputCalc(time.Second)
8579
)
8680

8781
func init() {
@@ -92,5 +86,4 @@ func init() {
9286
prometheus.MustRegister(failedSamples)
9387
prometheus.MustRegister(sentBatchDuration)
9488
prometheus.MustRegister(httpRequestDuration)
95-
writeThroughput.Start()
9689
}

util/throughput.go

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)