Skip to content

Update dependencies #366

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

Merged
merged 1 commit into from
May 10, 2024
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go env
uses: actions/setup-go@v5.0.1
uses: actions/setup-go@v5
with:
go-version: '1.16'
go-version: '1.21'
- name: Run tests
run: go test -v ./... -bench=.

Expand All @@ -23,9 +23,9 @@ jobs:
with:
fetch-depth: 0
- name: Setup go env
uses: actions/setup-go@v5.0.1
uses: actions/setup-go@v5
with:
go-version: '1.16'
go-version: '1.21'
- name: Release new package on tag
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go env
uses: actions/setup-go@v5.0.1
uses: actions/setup-go@v5
with:
go-version: '1.16'
go-version: '1.21'
- name: Run tests
run: go test -v ./...
18 changes: 16 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/dpattmann/prometheus-timestream-adapter

go 1.16
go 1.21

toolchain go1.21.6

require (
github.com/aws/aws-sdk-go v1.52.2
Expand All @@ -9,8 +11,20 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/common v0.53.0
github.com/prometheus/prometheus v2.5.0+incompatible
github.com/prometheus/prometheus v0.52.0
github.com/spf13/pflag v1.0.5
go.uber.org/zap v1.27.0
golang.org/x/net v0.25.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
)
1,688 changes: 14 additions & 1,674 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions timestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (t TimeStreamAdapter) readDimension(measureName string) (dimensions []strin
return
}

func (t TimeStreamAdapter) readLabels(labels []*prompb.Label) (task writeTask) {
func (t TimeStreamAdapter) readLabels(labels []prompb.Label) (task writeTask) {
for _, s := range labels {
if s.Name == model.MetricNameLabel {
task.measureName = s.Value
Expand All @@ -345,14 +345,14 @@ func (t TimeStreamAdapter) handleQueryResult(qo *timestreamquery.QueryOutput, ti
for _, row := range qo.Rows {
var ts prompb.TimeSeries

ts.Labels = append(ts.Labels, &prompb.Label{
ts.Labels = append(ts.Labels, prompb.Label{
Name: model.MetricNameLabel,
Value: measureName,
})

for i, d := range row.Data {
if d.ScalarValue != nil {
ts.Labels = append(ts.Labels, &prompb.Label{
ts.Labels = append(ts.Labels, prompb.Label{
Name: *qo.ColumnInfo[i].Name,
Value: *d.ScalarValue,
})
Expand Down
36 changes: 18 additions & 18 deletions timestream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (t TimeStreamQueryMock) QueryPages(input *timestreamquery.QueryInput, handl

func TestTimeSteamAdapter_readLabels(t *testing.T) {
type args struct {
labels []*prompb.Label
labels []prompb.Label
}
tests := []struct {
name string
Expand All @@ -219,7 +219,7 @@ func TestTimeSteamAdapter_readLabels(t *testing.T) {
{
name: "Prom data request",
args: args{
labels: []*prompb.Label{
labels: []prompb.Label{
{
Name: "__name__",
Value: "sample_metric",
Expand Down Expand Up @@ -263,9 +263,9 @@ func TestTimeSteamAdapter_toRecords(t *testing.T) {
name: "Prom data request",
args: args{
req: &prompb.WriteRequest{
Timeseries: []*prompb.TimeSeries{
Timeseries: []prompb.TimeSeries{
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "sample_metric",
Expand Down Expand Up @@ -305,9 +305,9 @@ func TestTimeSteamAdapter_toRecords(t *testing.T) {
name: "Prom with NaN value",
args: args{
req: &prompb.WriteRequest{
Timeseries: []*prompb.TimeSeries{
Timeseries: []prompb.TimeSeries{
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "sample_metric",
Expand All @@ -333,9 +333,9 @@ func TestTimeSteamAdapter_toRecords(t *testing.T) {
name: "Prom with positive inf number",
args: args{
req: &prompb.WriteRequest{
Timeseries: []*prompb.TimeSeries{
Timeseries: []prompb.TimeSeries{
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "sample_metric",
Expand All @@ -361,9 +361,9 @@ func TestTimeSteamAdapter_toRecords(t *testing.T) {
name: "Prom with negative inf number",
args: args{
req: &prompb.WriteRequest{
Timeseries: []*prompb.TimeSeries{
Timeseries: []prompb.TimeSeries{
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "sample_metric",
Expand All @@ -389,9 +389,9 @@ func TestTimeSteamAdapter_toRecords(t *testing.T) {
name: "Prom with long metric name",
args: args{
req: &prompb.WriteRequest{
Timeseries: []*prompb.TimeSeries{
Timeseries: []prompb.TimeSeries{
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "sample_metric_measure_name_exceeds_the_maximum_supported_length",
Expand Down Expand Up @@ -436,9 +436,9 @@ func TestTimeSteamAdapter_Write(t *testing.T) {
name: "Write Timestream Request",
args: args{
req: &prompb.WriteRequest{
Timeseries: []*prompb.TimeSeries{
Timeseries: []prompb.TimeSeries{
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "sample_name",
Expand All @@ -460,9 +460,9 @@ func TestTimeSteamAdapter_Write(t *testing.T) {
name: "Write Timestream Request With Error",
args: args{
req: &prompb.WriteRequest{
Timeseries: []*prompb.TimeSeries{
Timeseries: []prompb.TimeSeries{
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "sample_name_error",
Expand Down Expand Up @@ -527,7 +527,7 @@ func TestTimeSteamAdapter_Read(t *testing.T) {
{
Timeseries: []*prompb.TimeSeries{
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "mock",
Expand All @@ -549,7 +549,7 @@ func TestTimeSteamAdapter_Read(t *testing.T) {
},
},
{
Labels: []*prompb.Label{
Labels: []prompb.Label{
{
Name: "__name__",
Value: "mock",
Expand Down
Loading