You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the custom collector builder fails, its error message includes an underlying error which usually is the actual content of the error. For example:
2022-11-21T09:56:12.767-0800 INFO internal/command.go:125 OpenTelemetry Collector Builder {"version": "dev", "date": "unknown"}
2022-11-21T09:56:12.771-0800 INFO internal/command.go:158 Using config file {"path": "./cmd/otelcontribcol/manifest.yaml"}
2022-11-21T09:56:12.771-0800 INFO builder/config.go:107 Using go {"go-executable": "/usr/bin/go"}
2022-11-21T09:56:12.778-0800 INFO builder/main.go:76 Sources created {"path": "./bin"}
2022-11-21T09:56:13.564-0800 INFO builder/main.go:118 Getting go modules
2022-11-21T09:56:13.800-0800 INFO builder/main.go:87 Compiling
Error: failed to compile the OpenTelemetry Collector distribution: exit status 2. Output: "# github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter/internal/translator\n../exporter/awsxrayexporter/internal/translator/segment.go:193:41: undefined: traceutil.SpanIDToHexOrEmptyString\n../exporter/awsxrayexporter/internal/translator/segment.go:198:41: undefined: traceutil.SpanIDToHexOrEmptyString\n# github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter\n../exporter/alibabacloudlogserviceexporter/logsdata_to_logservice.go:181:33: undefined: traceutil.TraceIDToHexOrEmptyString\n../exporter/alibabacloudlogserviceexporter/logsdata_to_logservice.go:186:33:
<snipped>
As you can see, the error is quoted and escaped, so it's very difficult to read.
I plan to fix this myself soon because it's quite easy, but I need to write it down because I'm working on something else first.
Steps to reproduce
An easy way to reproduce this problem is to create a manifest yaml that describes an unresoveable dependency. For example, include a replace directive that can't be evaluated.
What did you expect to see?
The error message should be formatted as intended. In the example above:
2022-11-21T09:56:12.767-0800 INFO internal/command.go:125 OpenTelemetry Collector Builder {"version": "dev", "date": "unknown"}
2022-11-21T09:56:12.771-0800 INFO internal/command.go:158 Using config file {"path": "./cmd/otelcontribcol/manifest.yaml"}
2022-11-21T09:56:12.771-0800 INFO builder/config.go:107 Using go {"go-executable": "/usr/bin/go"}
2022-11-21T09:56:12.778-0800 INFO builder/main.go:76 Sources created {"path": "./bin"}
2022-11-21T09:56:13.564-0800 INFO builder/main.go:118 Getting go modules
2022-11-21T09:56:13.800-0800 INFO builder/main.go:87 Compiling
Error: failed to compile the OpenTelemetry Collector distribution: exit status 2. Output:
# github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter/internal/translator
../exporter/awsxrayexporter/internal/translator/segment.go:193:41: undefined: traceutil.SpanIDToHexOrEmptyString
../exporter/awsxrayexporter/internal/translator/segment.go:198:41: undefined: traceutil.SpanIDToHexOrEmptyString
# github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter
../exporter/alibabacloudlogserviceexporter/logsdata_to_logservice.go:181:33: undefined: traceutil.TraceIDToHexOrEmptyString
../exporter/alibabacloudlogserviceexporter/logsdata_to_logservice.go:186:33: undefined:
<snipped>
What did you see instead?
See description, I saw \n instead of newlines, etc
Describe the bug
When the custom collector builder fails, its error message includes an underlying error which usually is the actual content of the error. For example:
As you can see, the error is quoted and escaped, so it's very difficult to read.
I plan to fix this myself soon because it's quite easy, but I need to write it down because I'm working on something else first.
Steps to reproduce
An easy way to reproduce this problem is to create a manifest yaml that describes an unresoveable dependency. For example, include a replace directive that can't be evaluated.
What did you expect to see?
The error message should be formatted as intended. In the example above:
What did you see instead?
See description, I saw
\n
instead of newlines, etcWhat version did you use?
4565692
Environment
OS: Ubuntu
Additional context
The problem is here:
opentelemetry-collector/internal/builder/main.go
Line 101 in fb510a9
The text was updated successfully, but these errors were encountered: