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

feat(dea): configure generator & loader #5

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.22.1

- name: Test
run: go test -v -race ./...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ bin

# High Dynamic Range (HDR) Histogram files
*.hdr

*.txt
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.13.1-alpine AS builder
FROM golang:1.22.1-alpine AS builder
WORKDIR /tsbs
COPY ./ ./
RUN apk update && apk add --no-cache git
Expand Down
11 changes: 6 additions & 5 deletions cmd/tsbs_load_prometheus/adapter/noop/noop_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (

"github.com/golang/protobuf/proto"
"github.com/golang/snappy"
"github.com/prometheus/common/log"

// "github.com/prometheus/common/log"
"github.com/timescale/promscale/pkg/prompb"
)

Expand All @@ -24,27 +25,27 @@ func NewAdapter(port int) *Adapter {
// Start starts no-op Prometheus adapter. This call will block go-routine
func (adapter *Adapter) Start() error {
http.HandleFunc("/", adapter.Handler)
log.Info("msg", fmt.Sprintf("Starting noop adapter listening on: %d\n", adapter.port))
// log.Info("msg", fmt.Sprintf("Starting noop adapter listening on: %d\n", adapter.port))
return http.ListenAndServe(fmt.Sprintf(":%d", adapter.port), nil)
}

// Handler counts number of requests and samples
func (adapter *Adapter) Handler(rw http.ResponseWriter, req *http.Request) {
compressed, err := ioutil.ReadAll(req.Body)
if err != nil {
log.Error("msg", "error while reading request", "error", err)
// log.Error("msg", "error while reading request", "error", err)
http.Error(rw, err.Error(), http.StatusInternalServerError)
return
}
decompressed, err := snappy.Decode(nil, compressed)
if err != nil {
log.Error("msg", "error while decompressing request", "error", err)
// log.Error("msg", "error while decompressing request", "error", err)
http.Error(rw, err.Error(), http.StatusInternalServerError)
return
}
var protoReq prompb.WriteRequest
if err := proto.Unmarshal(decompressed, &protoReq); err != nil {
log.Error("msg", "error while unmarshalling protobuf request", "error", err)
// log.Error("msg", "error while unmarshalling protobuf request", "error", err)
http.Error(rw, err.Error(), http.StatusBadRequest)
return
}
Expand Down
104 changes: 79 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,36 +1,90 @@
module github.com/timescale/tsbs

go 1.14
go 1.22

toolchain go1.22.1

require (
github.com/HdrHistogram/hdrhistogram-go v1.0.0
github.com/SiriDB/go-siridb-connector v0.0.0-20190110105621-86b34c44c921
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/ClickHouse/clickhouse-go/v2 v2.22.2
github.com/HdrHistogram/hdrhistogram-go v1.1.2
github.com/SiriDB/go-siridb-connector v1.0.14
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
github.com/aws/aws-sdk-go v1.35.13
github.com/aws/aws-sdk-go v1.51.5
github.com/blagojts/viper v1.6.3-0.20200313094124-068f44cf5e69
github.com/brianvoe/gofakeit/v7 v7.0.2
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/gocql/gocql v0.0.0-20190810123941-df4b9cc33030
github.com/golang/protobuf v1.4.2
github.com/golang/snappy v0.0.1
github.com/google/flatbuffers v1.11.0
github.com/google/go-cmp v0.5.2
github.com/jackc/pgx/v4 v4.8.0
github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5
github.com/gocql/gocql v1.6.0
github.com/golang/protobuf v1.5.3
github.com/golang/snappy v0.0.4
github.com/google/flatbuffers v24.3.7+incompatible
github.com/google/go-cmp v0.6.0
github.com/jackc/pgx/v4 v4.18.3
github.com/jmoiron/sqlx v1.3.5
github.com/kshvakov/clickhouse v1.3.11
github.com/lib/pq v1.3.0
github.com/lib/pq v1.10.9
github.com/matoous/go-nanoid/v2 v2.0.0
github.com/pkg/errors v0.9.1
github.com/prometheus/common v0.13.0
github.com/shirou/gopsutil v3.21.3+incompatible
github.com/spf13/cobra v1.0.0
github.com/prometheus/common v0.37.0
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/timescale/promscale v0.0.0-20201006153045-6a66a36f5c84
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/transceptor-technology/go-qpack v0.0.0-20190116123619-49a14b216a45
github.com/valyala/fasthttp v1.15.1
go.uber.org/atomic v1.6.0
golang.org/x/net v0.0.0-20200904194848-62affa334b73
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
gopkg.in/yaml.v2 v2.3.0
github.com/stretchr/testify v1.9.0
github.com/timescale/promscale v0.0.0-20230207163005-6ee8545bf30d
github.com/transceptor-technology/go-qpack v1.0.3
github.com/valyala/fasthttp v1.52.0
go.uber.org/atomic v1.11.0
golang.org/x/net v0.22.0
golang.org/x/time v0.5.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/ClickHouse/ch-go v0.61.5 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-faster/city v1.0.1 // indirect
github.com/go-faster/errors v0.7.1 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgtype v1.14.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/paulmach/orb v0.11.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.13 // indirect
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading