Skip to content

Commit

Permalink
Update core to latest, fix breaking change [Start|End]Time -> [Start|…
Browse files Browse the repository at this point in the history
…End]Timestamp (#2954)

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Mar 31, 2021
1 parent 7b87813 commit 92c8edd
Show file tree
Hide file tree
Showing 181 changed files with 324 additions and 326 deletions.
2 changes: 1 addition & 1 deletion exporter/alibabacloudlogserviceexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15
go.uber.org/zap v1.16.0
gopkg.in/ini.v1 v1.57.0 // indirect
)
4 changes: 2 additions & 2 deletions exporter/alibabacloudlogserviceexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d h1:dKUPQciOVKguQyhUUZ8h0Jw1LtrNOeDUh5DY05rX398=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15 h1:3U6eZM3+ZZ87T1i6vbvo3g0DpbhMiwp1o3KSm+O7qxM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func resourceSpansToLogServiceData(resourceSpans pdata.ResourceSpans) []*sls.Log
}

func spanToLogServiceData(span pdata.Span, resourceContents, instrumentationLibraryContents []*sls.LogContent) *sls.Log {
timeNano := int64(span.EndTime())
timeNano := int64(span.EndTimestamp())
if timeNano == 0 {
timeNano = time.Now().UnixNano()
}
Expand Down Expand Up @@ -124,15 +124,15 @@ func spanToLogServiceData(span pdata.Span, resourceContents, instrumentationLibr
})
contentsBuffer = append(contentsBuffer, sls.LogContent{
Key: proto.String(startTimeField),
Value: proto.String(strconv.FormatUint(uint64(span.StartTime()/1000), 10)),
Value: proto.String(strconv.FormatUint(uint64(span.StartTimestamp()/1000), 10)),
})
contentsBuffer = append(contentsBuffer, sls.LogContent{
Key: proto.String(endTimeField),
Value: proto.String(strconv.FormatUint(uint64(span.EndTime()/1000), 10)),
Value: proto.String(strconv.FormatUint(uint64(span.EndTimestamp()/1000), 10)),
})
contentsBuffer = append(contentsBuffer, sls.LogContent{
Key: proto.String(durationField),
Value: proto.String(strconv.FormatUint(uint64((span.EndTime()-span.StartTime())/1000), 10)),
Value: proto.String(strconv.FormatUint(uint64((span.EndTimestamp()-span.StartTimestamp())/1000), 10)),
})
attributeMap := tracetranslator.AttributeMapToMap(span.Attributes())
attributeJSONBytes, _ := json.Marshal(attributeMap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func fillHTTPClientSpan(span pdata.Span) {
span.SetParentSpanID(newSegmentID())
span.SetName("/users/junit")
span.SetKind(pdata.SpanKindCLIENT)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))
span.SetTraceState("x:y")

span.Events().Resize(1)
Expand Down Expand Up @@ -158,8 +158,8 @@ func fillHTTPServerSpan(span pdata.Span) {
span.SetParentSpanID(newSegmentID())
span.SetName("/users/junit")
span.SetKind(pdata.SpanKindSERVER)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))

status := span.Status()
status.SetCode(2)
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws v0.0.0-00010101000000-000000000000
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15
go.uber.org/zap v1.16.0
google.golang.org/protobuf v1.26.0
gopkg.in/ini.v1 v1.57.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions exporter/awsemfexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d h1:dKUPQciOVKguQyhUUZ8h0Jw1LtrNOeDUh5DY05rX398=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15 h1:3U6eZM3+ZZ87T1i6vbvo3g0DpbhMiwp1o3KSm+O7qxM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng=
go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg=
go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc=
Expand Down
2 changes: 1 addition & 1 deletion exporter/awskinesisexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/signalfx/opencensus-go-exporter-kinesis v0.6.3
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15
go.uber.org/zap v1.16.0
gopkg.in/ini.v1 v1.57.0 // indirect
)
4 changes: 2 additions & 2 deletions exporter/awskinesisexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1077,8 +1077,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d h1:dKUPQciOVKguQyhUUZ8h0Jw1LtrNOeDUh5DY05rX398=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15 h1:3U6eZM3+ZZ87T1i6vbvo3g0DpbhMiwp1o3KSm+O7qxM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsprometheusremotewriteexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/onsi/gomega v1.10.2 // indirect
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15
go.uber.org/zap v1.16.0
gopkg.in/ini.v1 v1.57.0 // indirect
)
4 changes: 2 additions & 2 deletions exporter/awsprometheusremotewriteexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d h1:dKUPQciOVKguQyhUUZ8h0Jw1LtrNOeDUh5DY05rX398=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15 h1:3U6eZM3+ZZ87T1i6vbvo3g0DpbhMiwp1o3KSm+O7qxM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand Down
8 changes: 4 additions & 4 deletions exporter/awsxrayexporter/awsxray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ func constructHTTPClientSpan() pdata.Span {
span.SetParentSpanID(newSegmentID())
span.SetName("/users/junit")
span.SetKind(pdata.SpanKindCLIENT)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))

status := pdata.NewSpanStatus()
status.SetCode(0)
Expand All @@ -141,8 +141,8 @@ func constructHTTPServerSpan() pdata.Span {
span.SetParentSpanID(newSegmentID())
span.SetName("/users/junit")
span.SetKind(pdata.SpanKindSERVER)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))

status := pdata.NewSpanStatus()
status.SetCode(0)
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray v0.0.0-00010101000000-000000000000
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15
go.uber.org/zap v1.16.0
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
gopkg.in/ini.v1 v1.57.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions exporter/awsxrayexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d h1:dKUPQciOVKguQyhUUZ8h0Jw1LtrNOeDUh5DY05rX398=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15 h1:3U6eZM3+ZZ87T1i6vbvo3g0DpbhMiwp1o3KSm+O7qxM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand Down
4 changes: 2 additions & 2 deletions exporter/awsxrayexporter/translator/cause_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ func constructExceptionServerSpan(attributes map[string]interface{}, statuscode
span.SetParentSpanID(newSegmentID())
span.SetName("/widgets")
span.SetKind(pdata.SpanKindSERVER)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))

status := pdata.NewSpanStatus()
status.SetCode(statuscode)
Expand Down
12 changes: 6 additions & 6 deletions exporter/awsxrayexporter/translator/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func TestServerSpanWithSchemeNamePortTargetAttributes(t *testing.T) {
attributes[semconventions.AttributeHTTPClientIP] = "192.168.15.32"
attributes[semconventions.AttributeHTTPStatusCode] = 200
span := constructHTTPServerSpan(attributes)
timeEvents := constructTimedEventsWithReceivedMessageEvent(span.EndTime())
timeEvents := constructTimedEventsWithReceivedMessageEvent(span.EndTimestamp())
timeEvents.CopyTo(span.Events())

filtered, httpData := makeHTTP(span)
Expand Down Expand Up @@ -275,7 +275,7 @@ func TestSpanWithNotEnoughHTTPRequestURLAttributes(t *testing.T) {
attributes[semconventions.AttributeNetPeerPort] = 8080
attributes[semconventions.AttributeHTTPStatusCode] = 200
span := constructHTTPServerSpan(attributes)
timeEvents := constructTimedEventsWithReceivedMessageEvent(span.EndTime())
timeEvents := constructTimedEventsWithReceivedMessageEvent(span.EndTimestamp())
timeEvents.CopyTo(span.Events())

filtered, httpData := makeHTTP(span)
Expand All @@ -301,8 +301,8 @@ func constructHTTPClientSpan(attributes map[string]interface{}) pdata.Span {
span.SetParentSpanID(newSegmentID())
span.SetName("/users/junit")
span.SetKind(pdata.SpanKindCLIENT)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))

status := pdata.NewSpanStatus()
status.SetCode(0)
Expand All @@ -324,8 +324,8 @@ func constructHTTPServerSpan(attributes map[string]interface{}) pdata.Span {
span.SetParentSpanID(newSegmentID())
span.SetName("/users/junit")
span.SetKind(pdata.SpanKindSERVER)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))

status := pdata.NewSpanStatus()
status.SetCode(0)
Expand Down
4 changes: 2 additions & 2 deletions exporter/awsxrayexporter/translator/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func MakeSegment(span pdata.Span, resource pdata.Resource, indexedAttrs []string
}

var (
startTime = timestampToFloatSeconds(span.StartTime())
endTime = timestampToFloatSeconds(span.EndTime())
startTime = timestampToFloatSeconds(span.StartTimestamp())
endTime = timestampToFloatSeconds(span.EndTimestamp())
httpfiltered, http = makeHTTP(span)
isError, isFault, causefiltered, cause = makeCause(span, httpfiltered, resource)
origin = determineAwsOrigin(resource)
Expand Down
22 changes: 11 additions & 11 deletions exporter/awsxrayexporter/translator/segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestServerSpanWithInternalServerError(t *testing.T) {
attributes[semconventions.AttributeEnduserID] = enduser
resource := constructDefaultResource()
span := constructServerSpan(parentSpanID, spanName, pdata.StatusCodeError, errorMessage, attributes)
timeEvents := constructTimedEventsWithSentMessageEvent(span.StartTime())
timeEvents := constructTimedEventsWithSentMessageEvent(span.StartTimestamp())
timeEvents.CopyTo(span.Events())

segment, _ := MakeSegment(span, resource, nil, false)
Expand Down Expand Up @@ -137,8 +137,8 @@ func TestSpanNoParentId(t *testing.T) {
span.SetSpanID(newSegmentID())
span.SetParentSpanID(pdata.InvalidSpanID())
span.SetKind(pdata.SpanKindPRODUCER)
span.SetStartTime(pdata.TimestampFromTime(time.Now()))
span.SetEndTime(pdata.TimestampFromTime(time.Now().Add(10)))
span.SetStartTimestamp(pdata.TimestampFromTime(time.Now()))
span.SetEndTimestamp(pdata.TimestampFromTime(time.Now().Add(10)))
resource := pdata.NewResource()
segment, _ := MakeSegment(span, resource, nil, false)

Expand All @@ -152,8 +152,8 @@ func TestSpanWithNoStatus(t *testing.T) {
span.SetSpanID(newSegmentID())
span.SetParentSpanID(newSegmentID())
span.SetKind(pdata.SpanKindSERVER)
span.SetStartTime(pdata.TimestampFromTime(time.Now()))
span.SetEndTime(pdata.TimestampFromTime(time.Now().Add(10)))
span.SetStartTimestamp(pdata.TimestampFromTime(time.Now()))
span.SetEndTimestamp(pdata.TimestampFromTime(time.Now().Add(10)))

resource := pdata.NewResource()
segment, _ := MakeSegment(span, resource, nil, false)
Expand Down Expand Up @@ -272,7 +272,7 @@ func TestSpanWithInvalidTraceId(t *testing.T) {
attributes[semconventions.AttributeHTTPTarget] = spanName
resource := constructDefaultResource()
span := constructClientSpan(pdata.InvalidSpanID(), spanName, pdata.StatusCodeUnset, "OK", attributes)
timeEvents := constructTimedEventsWithSentMessageEvent(span.StartTime())
timeEvents := constructTimedEventsWithSentMessageEvent(span.StartTimestamp())
timeEvents.CopyTo(span.Events())
traceID := span.TraceID().Bytes()
traceID[0] = 0x11
Expand Down Expand Up @@ -322,7 +322,7 @@ func TestServerSpanWithNilAttributes(t *testing.T) {
attributes := make(map[string]interface{})
resource := constructDefaultResource()
span := constructServerSpan(parentSpanID, spanName, pdata.StatusCodeError, "OK", attributes)
timeEvents := constructTimedEventsWithSentMessageEvent(span.StartTime())
timeEvents := constructTimedEventsWithSentMessageEvent(span.StartTimestamp())
timeEvents.CopyTo(span.Events())
pdata.NewAttributeMap().CopyTo(span.Attributes())

Expand Down Expand Up @@ -635,8 +635,8 @@ func constructClientSpan(parentSpanID pdata.SpanID, name string, code pdata.Stat
span.SetParentSpanID(parentSpanID)
span.SetName(name)
span.SetKind(pdata.SpanKindCLIENT)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))

status := pdata.NewSpanStatus()
status.SetCode(code)
Expand All @@ -662,8 +662,8 @@ func constructServerSpan(parentSpanID pdata.SpanID, name string, code pdata.Stat
span.SetParentSpanID(parentSpanID)
span.SetName(name)
span.SetKind(pdata.SpanKindSERVER)
span.SetStartTime(pdata.TimestampFromTime(startTime))
span.SetEndTime(pdata.TimestampFromTime(endTime))
span.SetStartTimestamp(pdata.TimestampFromTime(startTime))
span.SetEndTimestamp(pdata.TimestampFromTime(endTime))

status := pdata.NewSpanStatus()
status.SetCode(code)
Expand Down
2 changes: 1 addition & 1 deletion exporter/azuremonitorexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/tedsuo/ifrit v0.0.0-20191009134036-9a97d0632f00 // indirect
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15
go.uber.org/zap v1.16.0
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
gopkg.in/ini.v1 v1.57.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions exporter/azuremonitorexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1057,8 +1057,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d h1:dKUPQciOVKguQyhUUZ8h0Jw1LtrNOeDUh5DY05rX398=
go.opentelemetry.io/collector v0.23.1-0.20210331155714-fe86ab5cba6d/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15 h1:3U6eZM3+ZZ87T1i6vbvo3g0DpbhMiwp1o3KSm+O7qxM=
go.opentelemetry.io/collector v0.23.1-0.20210331231428-f8bdcf682f15/go.mod h1:2mL8mFNp96idZ7zW/7IpKBaLryUBlfPs9nBrGcOeioM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand Down
6 changes: 3 additions & 3 deletions exporter/azuremonitorexporter/trace_to_envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func spanToEnvelope(

envelope := contracts.NewEnvelope()
envelope.Tags = make(map[string]string)
envelope.Time = toTime(span.StartTime()).Format(time.RFC3339Nano)
envelope.Time = toTime(span.StartTimestamp()).Format(time.RFC3339Nano)
envelope.Tags[contracts.OperationId] = span.TraceID().HexString()
envelope.Tags[contracts.OperationParentId] = span.ParentSpanID().HexString()

Expand Down Expand Up @@ -577,8 +577,8 @@ func copyAndExtractMessagingAttributes(
}

func formatSpanDuration(span pdata.Span) string {
startTime := toTime(span.StartTime())
endTime := toTime(span.EndTime())
startTime := toTime(span.StartTimestamp())
endTime := toTime(span.EndTimestamp())
return formatDuration(endTime.Sub(startTime))
}

Expand Down
Loading

0 comments on commit 92c8edd

Please sign in to comment.