Skip to content

Commit

Permalink
Merge pull request #50 from pgier/bump-v2.19.2
Browse files Browse the repository at this point in the history
Bump v2.19.2
  • Loading branch information
openshift-merge-robot committed Jun 30, 2020
2 parents 8a0dc90 + 70a0f84 commit 6676e94
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 2.19.2 / 2020-06-26

* [BUGFIX] Remote Write: Fix panic when reloading config with modified queue parameters. #7452

## 2.19.1 / 2020-06-18

* [BUGFIX] TSDB: Fix m-map file truncation leading to unsequential files. #7414
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.19.1
2.19.2
1 change: 1 addition & 0 deletions docs/configuration/configuration.md
Expand Up @@ -1047,6 +1047,7 @@ The following meta labels are available on targets during [relabeling](#relabel_
* `__meta_triton_machine_id`: the UUID of the target

See below for the configuration options for Triton discovery:

```yaml
# The information to access the Triton discovery API.

Expand Down
12 changes: 8 additions & 4 deletions storage/remote/queue_manager.go
Expand Up @@ -177,8 +177,12 @@ func newQueueManagerMetrics(r prometheus.Registerer, rn, e string) *queueManager
ConstLabels: constLabels,
})

if r != nil {
r.MustRegister(
return m
}

func (m *queueManagerMetrics) register() {
if m.reg != nil {
m.reg.MustRegister(
m.succeededSamplesTotal,
m.failedSamplesTotal,
m.retriedSamplesTotal,
Expand All @@ -195,7 +199,6 @@ func newQueueManagerMetrics(r prometheus.Registerer, rn, e string) *queueManager
m.bytesSent,
)
}
return m
}

func (m *queueManagerMetrics) unregister() {
Expand Down Expand Up @@ -358,7 +361,8 @@ outer:
// Start the queue manager sending samples to the remote storage.
// Does not block.
func (t *QueueManager) Start() {
// Initialise some metrics.
// Register and initialise some metrics.
t.metrics.register()
t.metrics.shardCapacity.Set(float64(t.cfg.Capacity))
t.metrics.pendingSamples.Set(0)
t.metrics.maxNumShards.Set(float64(t.cfg.MaxShards))
Expand Down
45 changes: 44 additions & 1 deletion storage/remote/write_test.go
Expand Up @@ -20,6 +20,7 @@ import (
"testing"
"time"

"github.com/prometheus/client_golang/prometheus"
common_config "github.com/prometheus/common/config"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/config"
Expand Down Expand Up @@ -154,6 +155,48 @@ func TestRestartOnNameChange(t *testing.T) {
testutil.Ok(t, err)
}

func TestUpdateWithRegisterer(t *testing.T) {
dir, err := ioutil.TempDir("", "TestRestartWithRegisterer")
testutil.Ok(t, err)
defer os.RemoveAll(dir)

s := NewWriteStorage(nil, prometheus.NewRegistry(), dir, time.Millisecond)
c1 := &config.RemoteWriteConfig{
Name: "named",
URL: &common_config.URL{
URL: &url.URL{
Scheme: "http",
Host: "localhost",
},
},
QueueConfig: config.DefaultQueueConfig,
}
c2 := &config.RemoteWriteConfig{
URL: &common_config.URL{
URL: &url.URL{
Scheme: "http",
Host: "localhost",
},
},
QueueConfig: config.DefaultQueueConfig,
}
conf := &config.Config{
GlobalConfig: config.DefaultGlobalConfig,
RemoteWriteConfigs: []*config.RemoteWriteConfig{c1, c2},
}
testutil.Ok(t, s.ApplyConfig(conf))

c1.QueueConfig.MaxShards = 10
c2.QueueConfig.MaxShards = 10
testutil.Ok(t, s.ApplyConfig(conf))
for _, queue := range s.queues {
testutil.Equals(t, 10, queue.cfg.MaxShards)
}

err = s.Close()
testutil.Ok(t, err)
}

func TestWriteStorageLifecycle(t *testing.T) {
dir, err := ioutil.TempDir("", "TestWriteStorageLifecycle")
testutil.Ok(t, err)
Expand All @@ -178,7 +221,7 @@ func TestUpdateExternalLabels(t *testing.T) {
testutil.Ok(t, err)
defer os.RemoveAll(dir)

s := NewWriteStorage(nil, nil, dir, time.Second)
s := NewWriteStorage(nil, prometheus.NewRegistry(), dir, time.Second)

externalLabels := labels.FromStrings("external", "true")
conf := &config.Config{
Expand Down

0 comments on commit 6676e94

Please sign in to comment.