Skip to content

Commit e5a3178

Browse files
ROX-27695: Collector runtime configuration should be logged (#2012)
1 parent 419ceb4 commit e5a3178

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

collector/lib/CollectorConfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "CollectionMethod.h"
1818
#include "HostConfig.h"
19+
#include "Logging.h"
1920
#include "NetworkConnection.h"
2021
#include "TlsConfig.h"
2122
#include "json/value.h"
@@ -146,6 +147,7 @@ class CollectorConfig {
146147

147148
void ResetRuntimeConfig() {
148149
auto lock = WriteLock();
150+
CLOG(INFO) << "Resetting runtime configuration";
149151
runtime_config_.reset();
150152
}
151153

collector/lib/ConfigLoader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ bool ConfigLoader::LoadConfiguration(CollectorConfig& config, const YAML::Node&
9696

9797
config.SetRuntimeConfig(std::move(runtime_config));
9898

99-
CLOG(DEBUG) << "Runtime configuration:\n"
100-
<< config.GetRuntimeConfigStr();
99+
CLOG(INFO) << "Runtime configuration:\n"
100+
<< config.GetRuntimeConfigStr();
101101
return true;
102102
}
103103

integration-tests/pkg/collector/collector.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type Manager interface {
1818
IsRunning() (bool, error)
1919
ContainerID() string
2020
TestName() string
21+
SetTestName(string)
22+
GetTestName() string
2123
}
2224

2325
func New(e executor.Executor, name string) Manager {

integration-tests/pkg/collector/collector_docker.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,11 @@ func (c *DockerCollectorManager) ContainerID() string {
188188
func (c *DockerCollectorManager) TestName() string {
189189
return c.testName
190190
}
191+
192+
func (c *DockerCollectorManager) SetTestName(testName string) {
193+
c.testName = testName
194+
}
195+
196+
func (c *DockerCollectorManager) GetTestName() string {
197+
return c.testName
198+
}

integration-tests/suites/base.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ func (s *IntegrationTestSuiteBase) StopCollector() {
128128
func (s *IntegrationTestSuiteBase) Collector() collector.Manager {
129129
if s.collector == nil {
130130
s.collector = collector.New(s.Executor(), s.T().Name())
131+
} else if s.collector.GetTestName() != s.T().Name() {
132+
// Otherwise the test name does not get set when subsequent tests are run
133+
s.collector.SetTestName(s.T().Name())
131134
}
132135
return s.collector
133136
}

0 commit comments

Comments
 (0)