Skip to content
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

ROX-27695: Collector runtime configuration should be logged #2012

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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: 2 additions & 0 deletions collector/lib/CollectorConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "CollectionMethod.h"
#include "HostConfig.h"
#include "Logging.h"
#include "NetworkConnection.h"
#include "TlsConfig.h"
#include "json/value.h"
Expand Down Expand Up @@ -146,6 +147,7 @@ class CollectorConfig {

void ResetRuntimeConfig() {
auto lock = WriteLock();
CLOG(INFO) << "Resetting runtime configuration";
runtime_config_.reset();
}

Expand Down
4 changes: 2 additions & 2 deletions collector/lib/ConfigLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ bool ConfigLoader::LoadConfiguration(CollectorConfig& config, const YAML::Node&

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

CLOG(DEBUG) << "Runtime configuration:\n"
<< config.GetRuntimeConfigStr();
CLOG(INFO) << "Runtime configuration:\n"
<< config.GetRuntimeConfigStr();
return true;
}

Expand Down
1 change: 1 addition & 0 deletions integration-tests/pkg/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Manager interface {
IsRunning() (bool, error)
ContainerID() string
TestName() string
SetTestName(string)
}

func New(e executor.Executor, name string) Manager {
Expand Down
4 changes: 4 additions & 0 deletions integration-tests/pkg/collector/collector_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,7 @@ func (c *DockerCollectorManager) ContainerID() string {
func (c *DockerCollectorManager) TestName() string {
return c.testName
}

func (c *DockerCollectorManager) SetTestName(testName string) {
c.testName = testName
}
3 changes: 3 additions & 0 deletions integration-tests/suites/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ func (s *IntegrationTestSuiteBase) StopCollector() {
func (s *IntegrationTestSuiteBase) Collector() collector.Manager {
if s.collector == nil {
s.collector = collector.New(s.Executor(), s.T().Name())
} else {
// Otherwise the test name does not get set when subsequent tests are run
s.collector.SetTestName(s.T().Name())
}
return s.collector
}
Expand Down
Loading