Skip to content
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

Rename StartTime/EndTime to StartTimestamp/EndTimestamp #2515

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## 🛑 Breaking changes 🛑

- Rename pdata.TimestampUnixNano to Timestamp, move helpers on the type itself #2514

## v0.20.0 Beta

## 🛑 Breaking changes 🛑
Expand Down
26 changes: 13 additions & 13 deletions cmd/pdatagen/internal/common_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,31 @@ var instrumentationLibraryField = &messageValueField{
returnMessage: instrumentationLibrary,
}

var startTimeField = &primitiveTypedField{
fieldName: "StartTime",
var startTimestampField = &primitiveTypedField{
fieldName: "StartTimestamp",
originFieldName: "StartTimeUnixNano",
returnType: "TimestampUnixNano",
returnType: "Timestamp",
rawType: "uint64",
defaultVal: "TimestampUnixNano(0)",
testVal: "TimestampUnixNano(1234567890)",
defaultVal: "Timestamp(0)",
testVal: "Timestamp(1234567890)",
}

var timeField = &primitiveTypedField{
fieldName: "Timestamp",
originFieldName: "TimeUnixNano",
returnType: "TimestampUnixNano",
returnType: "Timestamp",
rawType: "uint64",
defaultVal: "TimestampUnixNano(0)",
testVal: "TimestampUnixNano(1234567890)",
defaultVal: "Timestamp(0)",
testVal: "Timestamp(1234567890)",
}

var endTimeField = &primitiveTypedField{
fieldName: "EndTime",
var endTimestampField = &primitiveTypedField{
fieldName: "EndTimestamp",
originFieldName: "EndTimeUnixNano",
returnType: "TimestampUnixNano",
returnType: "Timestamp",
rawType: "uint64",
defaultVal: "TimestampUnixNano(0)",
testVal: "TimestampUnixNano(1234567890)",
defaultVal: "Timestamp(0)",
testVal: "Timestamp(1234567890)",
}

var attributes = &sliceField{
Expand Down
6 changes: 3 additions & 3 deletions cmd/pdatagen/internal/log_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ var logRecord = &messageValueStruct{
&primitiveTypedField{
fieldName: "Timestamp",
originFieldName: "TimeUnixNano",
returnType: "TimestampUnixNano",
returnType: "Timestamp",
rawType: "uint64",
defaultVal: "TimestampUnixNano(0)",
testVal: "TimestampUnixNano(1234567890)",
defaultVal: "Timestamp(0)",
testVal: "Timestamp(1234567890)",
},
traceIDField,
spanIDField,
Expand Down
10 changes: 5 additions & 5 deletions cmd/pdatagen/internal/metrics_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ var intDataPoint = &messageValueStruct{
originFullName: "otlpmetrics.IntDataPoint",
fields: []baseField{
labelsField,
startTimeField,
startTimestampField,
timeField,
valueInt64Field,
intExemplarsField,
Expand All @@ -253,7 +253,7 @@ var doubleDataPoint = &messageValueStruct{
originFullName: "otlpmetrics.DoubleDataPoint",
fields: []baseField{
labelsField,
startTimeField,
startTimestampField,
timeField,
valueFloat64Field,
doubleExemplarsField,
Expand All @@ -271,7 +271,7 @@ var intHistogramDataPoint = &messageValueStruct{
originFullName: "otlpmetrics.IntHistogramDataPoint",
fields: []baseField{
labelsField,
startTimeField,
startTimestampField,
timeField,
countField,
intSumField,
Expand All @@ -292,7 +292,7 @@ var doubleHistogramDataPoint = &messageValueStruct{
originFullName: "otlpmetrics.DoubleHistogramDataPoint",
fields: []baseField{
labelsField,
startTimeField,
startTimestampField,
timeField,
countField,
doubleSumField,
Expand All @@ -313,7 +313,7 @@ var doubleSummaryDataPoint = &messageValueStruct{
originFullName: "otlpmetrics.DoubleSummaryDataPoint",
fields: []baseField{
labelsField,
startTimeField,
startTimestampField,
timeField,
countField,
doubleSumField,
Expand Down
4 changes: 2 additions & 2 deletions cmd/pdatagen/internal/trace_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ var span = &messageValueStruct{
defaultVal: "SpanKindUNSPECIFIED",
testVal: "SpanKindSERVER",
},
startTimeField,
endTimeField,
startTimestampField,
endTimestampField,
attributes,
droppedAttributesCount,
&sliceField{
Expand Down
9 changes: 0 additions & 9 deletions consumer/pdata/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,10 @@ package pdata

import (
"sort"
"time"

otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1"
)

// TimestampUnixNano is a time specified as UNIX Epoch time in nanoseconds since
// 00:00:00 UTC on 1 January 1970.
type TimestampUnixNano uint64

func (ts TimestampUnixNano) String() string {
return time.Unix(0, int64(ts)).String()
}

// AttributeValueType specifies the type of AttributeValue.
type AttributeValueType int

Expand Down
6 changes: 3 additions & 3 deletions consumer/pdata/generated_log.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions consumer/pdata/generated_log_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading