-
Notifications
You must be signed in to change notification settings - Fork 84
enable default collector #1044
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
enable default collector #1044
Conversation
internal/config/config.go
Outdated
@@ -123,6 +128,60 @@ func ResolveConfig() (*Config, error) { | |||
return config, nil | |||
} | |||
|
|||
func checkCollectorConfiguration(collector *Collector, config *Config) { | |||
if len(collector.Exporters.OtlpExporters) == 0 && collector.Exporters.PrometheusExporter == nil && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some functions here to make it clearer what the if statement is doing? Like IsOTelExporterConfigured()
internal/datasource/file/file.go
Outdated
"os" | ||
) | ||
|
||
func RetrieveTokenFromFile(path string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func RetrieveTokenFromFile(path string) (string, error) { | |
func ReadFile(path string) (string, error) { |
Can the name for this function be more generic? It could be reused in the future to read other things from files.
internal/datasource/file/file.go
Outdated
|
||
func RetrieveTokenFromFile(path string) (string, error) { | ||
if path == "" { | ||
return "", errors.New("token file path is empty") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "", errors.New("token file path is empty") | |
return "", errors.New("failed to read file since file path is empty") |
Proposed changes
If valid command server block is configured in the nginx-agent.conf but no processors are found in the collector block, a collector will be created using defaults.
Default Collector Settings
Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTING
documentmake install-tools
and have attached any dependency changes to this pull requestREADME.md
)