Skip to content

Commit

Permalink
Merge branch 'main' of github.com:honeycombio/refinery into mike/husky
Browse files Browse the repository at this point in the history
* 'main' of github.com:honeycombio/refinery:
  prepare v1.6.0 release (#348)
  bump libhoney-go to v1.15.6 (#347)
  Use alpine as base image (#343)
  empower apply-labels action to apply labels (#344)
  Add an --interface-names flag (#342)

# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
MikeGoldsmith committed Nov 9, 2021
2 parents d605293 + 4946888 commit aaf4190
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apply-labels.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Apply project labels
on: [issues, pull_request, label]
on: [issues, pull_request_target, label]
jobs:
apply-labels:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .ko.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaultBaseImage: alpine:3.13
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Refinery Changelog

## 1.6.0 2021-11-04

- Add an --interface-names flag (#342) | [@ismith](https://github.com/ismith)

### Fixes

- bump libhoney-go to v1.15.6
- empower apply-labels action to apply labels (#344)
- Bump github.com/honeycombio/libhoney-go from 1.15.4 to 1.15.5 (#327)
- Re-add missing docker login when publishing (#338)

## 1.5.2 2021-10-13

### Fixes
Expand Down
21 changes: 17 additions & 4 deletions cmd/refinery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ var BuildID string
var version string

type Options struct {
ConfigFile string `short:"c" long:"config" description:"Path to config file" default:"/etc/refinery/refinery.toml"`
RulesFile string `short:"r" long:"rules_config" description:"Path to rules config file" default:"/etc/refinery/rules.toml"`
Version bool `short:"v" long:"version" description:"Print version number and exit"`
Debug bool `short:"d" long:"debug" description:"If enabled, runs debug service (runs on the first open port between localhost:6060 and :6069 by default)"`
ConfigFile string `short:"c" long:"config" description:"Path to config file" default:"/etc/refinery/refinery.toml"`
RulesFile string `short:"r" long:"rules_config" description:"Path to rules config file" default:"/etc/refinery/rules.toml"`
Version bool `short:"v" long:"version" description:"Print version number and exit"`
Debug bool `short:"d" long:"debug" description:"If enabled, runs debug service (runs on the first open port between localhost:6060 and :6069 by default)"`
InterfaceNames bool `long:"interface-names" description:"If set, print system's network interface names and exit."`
}

func main() {
Expand All @@ -58,6 +59,18 @@ func main() {
os.Exit(0)
}

if opts.InterfaceNames {
ifaces, err := net.Interfaces()
if err != nil {
fmt.Printf("Error: %s\n", err)
os.Exit(1)
}
for _, i := range ifaces {
fmt.Println(i.Name)
}
os.Exit(0)
}

a := app.App{
Version: version,
}
Expand Down
10 changes: 5 additions & 5 deletions collect/collect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,14 @@ func TestCacheSizeReload(t *testing.T) {
coll.AddSpan(&types.Span{TraceID: "2", Event: event})

expectedEvents := 1
wait := 2 * time.Millisecond
wait := 1 * time.Second
check := func() bool {
transmission.Mux.RLock()
defer transmission.Mux.RUnlock()

return len(transmission.Events) == expectedEvents
}
assert.Eventually(t, check, 10*wait, wait, "expected one trace evicted and sent")
assert.Eventually(t, check, 60*wait, wait, "expected one trace evicted and sent")

conf.Mux.Lock()
conf.GetInMemoryCollectorCacheCapacityVal.CacheCapacity = 2
Expand All @@ -339,7 +339,7 @@ func TestCacheSizeReload(t *testing.T) {
defer coll.mutex.RUnlock()

return coll.cache.(*cache.DefaultInMemCache).GetCacheSize() == 2
}, 10*wait, wait, "cache size to change")
}, 60*wait, wait, "cache size to change")

coll.AddSpan(&types.Span{TraceID: "3", Event: event})
time.Sleep(5 * conf.SendTickerVal)
Expand All @@ -351,7 +351,7 @@ func TestCacheSizeReload(t *testing.T) {
conf.ReloadConfig()

expectedEvents = 2
assert.Eventually(t, check, 10*wait, wait, "expected another trace evicted and sent")
assert.Eventually(t, check, 60*wait, wait, "expected another trace evicted and sent")
}

func TestSampleConfigReload(t *testing.T) {
Expand All @@ -361,7 +361,7 @@ func TestSampleConfigReload(t *testing.T) {

conf := &config.MockConfig{
GetSendDelayVal: 0,
GetTraceTimeoutVal: 10 * time.Millisecond,
GetTraceTimeoutVal: 60 * time.Second,
GetSamplerTypeVal: &config.DeterministicSamplerConfig{SampleRate: 1},
SendTickerVal: 2 * time.Millisecond,
GetInMemoryCollectorCacheCapacityVal: config.InMemoryCollectorCacheCapacity{CacheCapacity: 10},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/hashicorp/golang-lru v0.5.4
github.com/honeycombio/dynsampler-go v0.2.1
github.com/honeycombio/husky v0.1.0
github.com/honeycombio/libhoney-go v1.15.5
github.com/honeycombio/libhoney-go v1.15.6
github.com/jessevdk/go-flags v1.5.0
github.com/json-iterator/go v1.1.12
github.com/klauspost/compress v1.13.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ github.com/honeycombio/dynsampler-go v0.2.1 h1:IbhjbdB0IbLSZn7xVYuk6jjk/ZDk/EO+D
github.com/honeycombio/dynsampler-go v0.2.1/go.mod h1:BOeTUPT6fCRH5X/+QqF6Kza3IyLp9uSq/rWgEtI4aZI=
github.com/honeycombio/husky v0.1.0 h1:fCeWc5kGCYkhQTCsQ29ALrbvcVGVMZhWkyAQQWkWd2M=
github.com/honeycombio/husky v0.1.0/go.mod h1:+e0RRI7VbEowBLwC6dnjBFvjJx1GuIu3YoyUzLtf/a4=
github.com/honeycombio/libhoney-go v1.15.5 h1:Djren7ovq6pnPljEow3F1uu3FCc9ailigm9qtTPpEWA=
github.com/honeycombio/libhoney-go v1.15.5/go.mod h1:8NyBoM746bz+nw3yQzQF8gtJO/z4mkr/MD5C4r4uC2Y=
github.com/honeycombio/libhoney-go v1.15.6 h1:zbwfdo74Gsedmu6OT/oAHv4pfKNoseTXRMA/4e5XWew=
github.com/honeycombio/libhoney-go v1.15.6/go.mod h1:8NyBoM746bz+nw3yQzQF8gtJO/z4mkr/MD5C4r4uC2Y=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
Expand Down

0 comments on commit aaf4190

Please sign in to comment.