Skip to content
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
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cache:
environment:
GOPATH: c:\gopath
GOROOT: c:\Program Files\Go
GOVERSION: 1.26.3
GOVERSION: 1.26.6
GO111MODULE: 'on'
GOPROXY: 'https://proxy.golang.org'

Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orbs:
parameters:
go_version:
type: string
default: "1.26.3"
default: "1.26.6"

sensu_go_build_env: &sensu_go_build_env
docker:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/static-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
name: staticcheck (project)
runs-on: ubuntu-latest
env:
GO_VERSION: 1.26.3
GO_VERSION: 1.26.6
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: "1.26.3"
go-version: "1.26.6"
- uses: dominikh/staticcheck-action@v1.3.1
with:
version: "2025.1.1"
install-go: false
cache-key: "1.26.3"
cache-key: "1.26.6"
env:
GO_VERSION: 1.26.3
GO_VERSION: 1.26.6
2 changes: 1 addition & 1 deletion agent/allow_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"strings"

"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

type allowList struct {
Expand Down
53 changes: 25 additions & 28 deletions agent/statsd_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/sensu/sensu-go/types"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"golang.org/x/time/rate"
)

// GetMetricsAddr gets the metrics address of the statsd server.
Expand All @@ -46,39 +45,37 @@ func NewStatsdServer(a *Agent) *statsd.Server {
}
s.FlushInterval = time.Duration(c.FlushInterval) * time.Second
s.MetricsAddr = fmt.Sprintf("%s:%d", c.Host, c.Port)
s.StatserType = statsd.StatserNull
s.StatserType = gostatsd.StatserNull
return s
}

// NewServer will create a new statsd Server with the default configuration.
func NewServer() *statsd.Server {
return &statsd.Server{
Backends: []gostatsd.Backend{},
Limiter: rate.NewLimiter(statsd.DefaultMaxCloudRequests, statsd.DefaultBurstCloudRequests),
InternalTags: statsd.DefaultInternalTags,
InternalNamespace: statsd.DefaultInternalNamespace,
DefaultTags: statsd.DefaultTags,
ExpiryInterval: statsd.DefaultExpiryInterval,
FlushInterval: statsd.DefaultFlushInterval,
MaxReaders: statsd.DefaultMaxReaders,
MaxParsers: statsd.DefaultMaxParsers,
MaxWorkers: statsd.DefaultMaxWorkers,
MaxQueueSize: statsd.DefaultMaxQueueSize,
MaxConcurrentEvents: statsd.DefaultMaxConcurrentEvents,
EstimatedTags: statsd.DefaultEstimatedTags,
MetricsAddr: statsd.DefaultMetricsAddr,
PercentThreshold: statsd.DefaultPercentThreshold,
IgnoreHost: statsd.DefaultIgnoreHost,
ConnPerReader: statsd.DefaultConnPerReader,
HeartbeatEnabled: statsd.DefaultHeartbeatEnabled,
ReceiveBatchSize: statsd.DefaultReceiveBatchSize,
CacheOptions: statsd.CacheOptions{
CacheRefreshPeriod: statsd.DefaultCacheRefreshPeriod,
CacheEvictAfterIdlePeriod: statsd.DefaultCacheEvictAfterIdlePeriod,
CacheTTL: statsd.DefaultCacheTTL,
CacheNegativeTTL: statsd.DefaultCacheNegativeTTL,
},
Viper: viper.New(),
Backends: []gostatsd.Backend{},
ServerMode: gostatsd.DefaultServerMode,
InternalTags: gostatsd.DefaultInternalTags,
InternalNamespace: gostatsd.DefaultInternalNamespace,
DefaultTags: gostatsd.DefaultTags,
ExpiryIntervalCounter: gostatsd.DefaultExpiryInterval,
ExpiryIntervalGauge: gostatsd.DefaultExpiryInterval,
ExpiryIntervalSet: gostatsd.DefaultExpiryInterval,
ExpiryIntervalTimer: gostatsd.DefaultExpiryInterval,
FlushInterval: gostatsd.DefaultFlushInterval,
MaxReaders: gostatsd.DefaultMaxReaders,
MaxParsers: gostatsd.DefaultMaxParsers,
MaxWorkers: gostatsd.DefaultMaxWorkers,
MaxQueueSize: gostatsd.DefaultMaxQueueSize,
MaxConcurrentEvents: gostatsd.DefaultMaxConcurrentEvents,
EstimatedTags: gostatsd.DefaultEstimatedTags,
MetricsAddr: gostatsd.DefaultMetricsAddr,
PercentThreshold: gostatsd.DefaultPercentThreshold,
IgnoreHost: gostatsd.DefaultIgnoreHost,
ConnPerReader: gostatsd.DefaultConnPerReader,
HeartbeatEnabled: gostatsd.DefaultHeartbeatEnabled,
ReceiveBatchSize: gostatsd.DefaultReceiveBatchSize,
ReceiveBufferSize: gostatsd.DefaultReceiveBufferSize,
Viper: viper.New(),
}
}

Expand Down
4 changes: 0 additions & 4 deletions agent/statsd_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ func FixtureCounter(now int64) gostatsd.Counter {
PerSecond: 2,
Value: 3,
Timestamp: gostatsd.Nanotime(now),
Hostname: "host",
Tags: gostatsd.Tags{"foo:bar"},
}
}
Expand Down Expand Up @@ -225,7 +224,6 @@ func FixtureTimer(now int64) gostatsd.Timer {
Values: []float64{1, 2, 3},
Percentiles: []gostatsd.Percentile{{Float: 4, Str: "str"}},
Timestamp: gostatsd.Nanotime(now),
Hostname: "host",
Tags: gostatsd.Tags{"foo:bar"},
}
}
Expand All @@ -243,7 +241,6 @@ func FixtureGauge(now int64) gostatsd.Gauge {
return gostatsd.Gauge{
Value: 3,
Timestamp: gostatsd.Nanotime(now),
Hostname: "host",
Tags: gostatsd.Tags{"foo:bar"},
}
}
Expand All @@ -261,7 +258,6 @@ func FixtureSet(now int64) gostatsd.Set {
return gostatsd.Set{
Values: map[string]struct{}{"foo": struct{}{}},
Timestamp: gostatsd.Nanotime(now),
Hostname: "host",
Tags: gostatsd.Tags{"foo:bar"},
}
}
Expand Down
4 changes: 2 additions & 2 deletions backend/apid/graphql/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestCheckTypeRuntimeAssetsField(t *testing.T) {
// return associated silence
impl := &checkImpl{}
cfg := ServiceConfig{AssetClient: assetClient}
ctx := contextWithLoaders(context.Background(), cfg)
ctx := contextWithLoaders(context.Background(), cfg, false)
res, err := impl.RuntimeAssets(graphql.ResolveParams{Source: check, Context: ctx})
require.NoError(t, err)
assert.Len(t, res, 2)
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestCheckConfigTypeRuntimeAssetsField(t *testing.T) {
// return associated silence
impl := &checkCfgImpl{}
cfg := ServiceConfig{AssetClient: assetClient}
ctx := contextWithLoaders(context.Background(), cfg)
ctx := contextWithLoaders(context.Background(), cfg, false)
res, err := impl.RuntimeAssets(graphql.ResolveParams{Source: check, Context: ctx})
require.NoError(t, err)
assert.Len(t, res, 2)
Expand Down
Loading
Loading