-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Collector return "invalid length for ID" for trace reporting #3195
Comments
the trace/span ID need to be hex encoded not base64 |
Do you need someone to work this? If so, would I be able to pick this up? |
According to this, Is this a bug of the http exporter? |
What http exporter do you use? Seems like a bug there if they send JSON data (which seems to be the case based on the payload) |
I am using the exporter from "go.opentelemetry.io/otel/exporters/otlp/otlphttp" func (s *Service) Start(ctx context.Context) {
var err error
if !viper.GetBool(EnableConfigPath) {
log.SugaredLogger.Infof("trace is disable, no exporter will start.")
return
}
s.driverOps = []otlphttp.Option{
otlphttp.WithEndpoint(strings.Join([]string{reportHost, reportPort}, ":")),
otlphttp.WithInsecure(),
otlphttp.WithMarshal(otlphttp.MarshalJSON),
}
s.traceDriver = otlphttp.NewDriver(s.driverOps...)
if s.Exporter, err = otlp.NewExporter(ctx, s.traceDriver); err != nil {
log.SugaredLogger.Errorf("failed to config tracing exporter for err->[%s]", err)
return
}
s.wg.Add(1)
bsp := sdktrace.NewBatchSpanProcessor(s.Exporter)
tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(bsp))
otel.SetTracerProvider(tp)
propagator := propagation.NewCompositeTextMapPropagator(propagation.Baggage{}, propagation.TraceContext{})
otel.SetTextMapPropagator(propagator)
s.ctx, s.cancelFunc = context.WithCancel(ctx)
log.SugaredLogger.Infof("trace exporter start success.")
} |
Oh, so you are using golang sdk. Just change for the moment:
|
Created a bug in the golang SDK, closing this since we implement the specs. |
It works after change the code to |
Actually I think the marshaled output is correct, base64 according to the spec: https://github.com/open-telemetry/oteps/blob/main/text/0122-otlp-http-json.md#json-mapping |
Describe the bug
I am using opentelemetry-collector with otlphttp exporter. But when data report to the collector, it return HTTP status code 400 with the message "invalid length for ID"
Steps to reproduce
Here is the tcp traffic
What did you expect to see?
Report success.
What did you see instead?
Report failed with 400 status code
What version did you use?
Version: c1e3d47
What config did you use?
Environment
OS: centos-release-7-8.2003.0.el7.centos.x86_64
Compiler(if manually compiled): go version go1.14 linux/amd64
The text was updated successfully, but these errors were encountered: