forked from open-telemetry/opentelemetry-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created dry run for collector, fixes open-telemetry#4613
Signed-off-by: Maureen <[email protected]>
- Loading branch information
1 parent
7fa47b4
commit dd53f75
Showing
8 changed files
with
426 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package service | ||
|
||
import ( | ||
"fmt" | ||
|
||
"go.opentelemetry.io/collector/config" | ||
"go.opentelemetry.io/collector/service/internal/configunmarshaler" | ||
) | ||
|
||
func printMarshalErrors(exterrs []configunmarshaler.ExtensionValidateError, experrs []configunmarshaler.ExporterValidateError, recerrs []configunmarshaler.ReceiverValidateError, procerrs []configunmarshaler.ProcessorValidateError) { | ||
count := 1 | ||
for _, exterr := range exterrs { | ||
validateErrorText(count, exterr.Component, exterr.Id, exterr.Err) | ||
count++ | ||
} | ||
for _, experr := range experrs { | ||
validateErrorText(count, experr.Component, experr.Id, experr.Err) | ||
count++ | ||
} | ||
for _, recerr := range recerrs { | ||
validateErrorText(count, recerr.Component, recerr.Id, recerr.Err) | ||
count++ | ||
} | ||
for _, procerr := range procerrs { | ||
validateErrorText(count, procerr.Component, procerr.Id, procerr.Err) | ||
count++ | ||
} | ||
} | ||
|
||
func validateErrorText(count int, idType string, id config.ComponentID, err string) { | ||
fmt.Printf("Error %d\n", count) | ||
fmt.Printf("=============\n") | ||
fmt.Printf("%s:\n", idType) | ||
fmt.Printf(" %s\n", id) | ||
fmt.Printf(" ^---^--- %s\n", err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.