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
I want to transform logs into OTel Trace and export it to OTel Exporter myself.
When I used trace.proto file to generate its go file, I found the definition of Span struct is not the same with the one in go.opentelemetry.io/otel/sdk@v1.14.0/trace/span.go.
The Span in trace.pb.go is like this:
`type Span struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
while the Span in SDK is like this:
`type recordingSpan struct {
// mu protects the contents of this span.
mu sync.Mutex
// parent holds the parent span of this span as a trace.SpanContext.
parent trace.SpanContext
// spanKind represents the kind of this span as a trace.SpanKind.
spanKind trace.SpanKind
// name is the name of this span.
name string
// startTime is the time at which this span was started.
startTime time.Time
// endTime is the time at which this span was ended. It contains the zero
// value of time.Time until the span is ended.
endTime time.Time
// status is the status of this span.
status Status
// childSpanCount holds the number of child spans created for this span.
childSpanCount int
// spanContext holds the SpanContext of this span.
spanContext trace.SpanContext
// attributes is a collection of user provided key/values. The collection
// is constrained by a configurable maximum held by the parent
// TracerProvider. When additional attributes are added after this maximum
// is reached these attributes the user is attempting to add are dropped.
// This dropped number of attributes is tracked and reported in the
// ReadOnlySpan exported when the span ends.
attributes []attribute.KeyValue
droppedAttributes int
// events are stored in FIFO queue capped by configured limit.
events evictedQueue
// links are stored in FIFO queue capped by configured limit.
links evictedQueue
// executionTracerTaskEnd ends the execution tracer span.
executionTracerTaskEnd func()
// tracer is the SDK tracer that created this span.
tracer *tracer
}`
For example, the TraceID in SpanContext is [16]byte type.
Will the OTEL exporter take it as correct?
The text was updated successfully, but these errors were encountered:
The specification in this repo explains what the payloads should look like.
recordingSpan in the SDK is an internal struct that is not intended to be used directly. If you want to know more about it you may want to ask in https://github.com/open-telemetry/opentelemetry-go but there is no expectation that it will be an exact field-by-field match for OTLP's Span ProtoBuf message.
I want to generate OTLP data in go because I can not use SDK to set my own TraceID and SpanID.
But the code generated by protobuf file is much different from codes in SDK. So I was little confused.
I want to transform logs into OTel Trace and export it to OTel Exporter myself.
When I used trace.proto file to generate its go file, I found the definition of Span struct is not the same with the one in go.opentelemetry.io/otel/sdk@v1.14.0/trace/span.go.
The Span in trace.pb.go is like this:
`type Span struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}`
while the Span in SDK is like this:
`type recordingSpan struct {
// mu protects the contents of this span.
mu sync.Mutex
}`
For example, the TraceID in SpanContext is [16]byte type.
Will the OTEL exporter take it as correct?
The text was updated successfully, but these errors were encountered: