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

Added LoggingExporter for AppSignals during translation time if debugging is enabled. #1148

Merged
merged 25 commits into from
Apr 29, 2024

Conversation

musa-asad
Copy link
Contributor

@musa-asad musa-asad commented Apr 24, 2024

Description of the issue

There is no LoggingExporter for AppSignals during translation time.

When debugging is enabled, we want to add the LoggingExporter with detailed verbosity to the translated yaml.

Description of changes

During translation:

  • Adds LoggingExporter as an exporter.
  • Adds LoggingExporter to AppSignals pipelines when debugging is enabled.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

  • Ran unit tests: common_test.go, logging/translator_test.go, and appsignals/translator_test.go.
    • common_test.go was just run to ensure that unit test still works for the new changes in common.go.
    • logging/translator_test.go checks to see if the logging.go is set up correctly and sees if the agent key missing throws an error and if enabling debugging provides the correct yaml configuration for the loggingexporter.
    • appsignals/translator_test.go includes a new check to see if the loggingexporter is appropriately added to the exporters when both appsignals and debugging are enabled.

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

@musa-asad musa-asad requested a review from a team as a code owner April 24, 2024 18:54
@musa-asad musa-asad self-assigned this Apr 24, 2024
@musa-asad musa-asad requested review from lisguo and jefchien April 24, 2024 20:52
translator/translate/otel/common/common.go Outdated Show resolved Hide resolved
translator/translate/otel/common/common.go Outdated Show resolved Hide resolved
translator/translate/otel/exporter/logging/translator.go Outdated Show resolved Hide resolved
translator/translate/otel/exporter/logging/translator.go Outdated Show resolved Hide resolved
translator/translate/otel/common/common.go Outdated Show resolved Hide resolved
@zhihonl
Copy link
Contributor

zhihonl commented Apr 25, 2024

In the test section, can you add info of how you verify this works in a real usage?

@musa-asad musa-asad changed the base branch from main to feature-logging April 26, 2024 19:08
@musa-asad musa-asad requested review from a team, zhihonl and jefchien and removed request for a team April 26, 2024 19:09
@@ -54,6 +55,10 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators
translators.Processors.Set(resourcedetection.NewTranslator(resourcedetection.WithDataType(t.dataType)))
translators.Processors.Set(awsappsignals.NewTranslator(awsappsignals.WithDataType(t.dataType)))

if enabled, _ := common.GetBool(conf, common.DebugLogging); enabled {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still think there's risk to enabling this level of debug logging using the existing agent/debug field. We can determine if we need to change this before we release it.

@musa-asad musa-asad merged this pull request into feature-logging Apr 29, 2024
6 checks passed
@musa-asad musa-asad deleted the logging_exporter branch April 29, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants