diff --git a/CHANGELOG.md b/CHANGELOG.md index f47d098a0a7f..b4cfea7e99bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ instance for consistency with other OneOf field accessors (#5034) - Update OTLP to v0.15.0 (#5064) - Adding support for transition from older versions of OTLP to OTLP v0.15.0 (#5085) +- Split pdata package separated by telemetry signal type (#5087) ### 🧰 Bug fixes 🧰 diff --git a/model/internal/cmd/pdatagen/internal/base_slices.go b/model/internal/cmd/pdatagen/internal/base_slices.go index ca0a25ab8282..6acd7c4cb353 100644 --- a/model/internal/cmd/pdatagen/internal/base_slices.go +++ b/model/internal/cmd/pdatagen/internal/base_slices.go @@ -112,10 +112,10 @@ func fillTest${structName}(tv ${structName}) { }` const commonSliceAliasTemplate = `// ${structName} is an alias for pdata.${structName} struct. -type ${structName} = pdata.${structName} +${extraStructComment}type ${structName} = pdata.${structName} // New${structName} is an alias for a function to create ${structName}. -var New${structName} = pdata.New${structName}` +${extraNewComment}var New${structName} = pdata.New${structName}` const slicePtrTemplate = `// ${structName} logically represents a slice of ${elementName}. // @@ -477,11 +477,21 @@ func (ss *sliceOfPtrs) templateFields() func(name string) string { } } -func (ss *sliceOfPtrs) generateAlias(sb *strings.Builder) { +func (ss *sliceOfPtrs) generateAlias(sb *strings.Builder, deprecatedInFavor string) { sb.WriteString(os.Expand(commonSliceAliasTemplate, func(name string) string { switch name { case "structName": return ss.structName + case "extraStructComment": + if deprecatedInFavor != "" { + return "// Deprecated: [v0.49.0] Use " + deprecatedInFavor + "." + ss.structName + " instead.\n" + } + return "" + case "extraNewComment": + if deprecatedInFavor != "" { + return "// Deprecated: [v0.49.0] Use " + deprecatedInFavor + ".New" + ss.structName + " instead.\n" + } + return "" default: panic(name) } @@ -530,11 +540,21 @@ func (ss *sliceOfValues) templateFields() func(name string) string { } } -func (ss *sliceOfValues) generateAlias(sb *strings.Builder) { +func (ss *sliceOfValues) generateAlias(sb *strings.Builder, deprecatedInFavor string) { sb.WriteString(os.Expand(commonSliceAliasTemplate, func(name string) string { switch name { case "structName": return ss.structName + case "extraStructComment": + if deprecatedInFavor != "" { + return "// Deprecated: [v0.49.0] Use " + deprecatedInFavor + "." + ss.structName + " instead.\n" + } + return "" + case "extraNewComment": + if deprecatedInFavor != "" { + return "// Deprecated: [v0.49.0] Use " + deprecatedInFavor + ".New" + ss.structName + " instead.\n" + } + return "" default: panic(name) } diff --git a/model/internal/cmd/pdatagen/internal/base_structs.go b/model/internal/cmd/pdatagen/internal/base_structs.go index aed6e312dfe3..878623dfddb7 100644 --- a/model/internal/cmd/pdatagen/internal/base_structs.go +++ b/model/internal/cmd/pdatagen/internal/base_structs.go @@ -79,10 +79,10 @@ const messageValueFillTestHeaderTemplate = `func fillTest${structName}(tv ${stru const messageValueFillTestFooterTemplate = `}` const messageValueAliasTemplate = `// ${structName} is an alias for pdata.${structName} struct. -type ${structName} = pdata.${structName} +${extraStructComment}type ${structName} = pdata.${structName} // New${structName} is an alias for a function to create a new empty ${structName}. -var New${structName} = pdata.New${structName}` +${extraNewComment}var New${structName} = pdata.New${structName}` const newLine = "\n" @@ -97,7 +97,7 @@ type baseStruct interface { } type aliasGenerator interface { - generateAlias(sb *strings.Builder) + generateAlias(sb *strings.Builder, deprecatedInFavor string) } type messageValueStruct struct { @@ -196,11 +196,21 @@ func (ms *messageValueStruct) generateTestValueHelpers(sb *strings.Builder) { })) } -func (ms *messageValueStruct) generateAlias(sb *strings.Builder) { +func (ms *messageValueStruct) generateAlias(sb *strings.Builder, deprecatedInFavor string) { sb.WriteString(os.Expand(messageValueAliasTemplate, func(name string) string { switch name { case "structName": return ms.structName + case "extraStructComment": + if deprecatedInFavor != "" { + return "// Deprecated: [v0.49.0] Use " + deprecatedInFavor + "." + ms.structName + " instead.\n" + } + return "" + case "extraNewComment": + if deprecatedInFavor != "" { + return "// Deprecated: [v0.49.0] Use " + deprecatedInFavor + ".New" + ms.structName + " instead.\n" + } + return "" default: panic(name) } diff --git a/model/internal/cmd/pdatagen/internal/files.go b/model/internal/cmd/pdatagen/internal/files.go index ec851363073b..e9729dc1c913 100644 --- a/model/internal/cmd/pdatagen/internal/files.go +++ b/model/internal/cmd/pdatagen/internal/files.go @@ -31,9 +31,7 @@ const header = `// Copyright The OpenTelemetry Authors // limitations under the License. // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". - -package pdata` +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go".` // AllFiles is a list of all files that needs to be generated. var AllFiles = []*File{ @@ -57,9 +55,8 @@ type File struct { func (f *File) GenerateFile() string { var sb strings.Builder - // Write headers - sb.WriteString(header) - sb.WriteString(newLine + newLine) + generateHeader(&sb, "pdata") + // Add imports sb.WriteString("import (" + newLine) for _, imp := range f.imports { @@ -83,9 +80,8 @@ func (f *File) GenerateFile() string { func (f *File) GenerateTestFile() string { var sb strings.Builder - // Write headers - sb.WriteString(header) - sb.WriteString(newLine + newLine) + generateHeader(&sb, "pdata") + // Add imports sb.WriteString("import (" + newLine) for _, imp := range f.testImports { @@ -111,12 +107,10 @@ func (f *File) GenerateTestFile() string { } // GenerateFile generates the aliases for data structures for this File. -func (f *File) GenerateAliasFile() string { +func (f *File) GenerateAliasFile(packageName string, deprecatedInFavor string) string { var sb strings.Builder - // Write headers - sb.WriteString(header) - sb.WriteString(newLine + newLine) + generateHeader(&sb, packageName) // Add import sb.WriteString("import \"go.opentelemetry.io/collector/model/internal/pdata\"" + newLine + newLine) @@ -124,9 +118,20 @@ func (f *File) GenerateAliasFile() string { // Write all types and funcs for _, s := range f.structs { if ag, ok := s.(aliasGenerator); ok { - ag.generateAlias(&sb) + ag.generateAlias(&sb, deprecatedInFavor) } } sb.WriteString(newLine) return sb.String() } + +func (f *File) IsCommon() bool { + return f.Name == "resource" || f.Name == "common" +} + +func generateHeader(sb *strings.Builder, packageName string) { + sb.WriteString(header) + sb.WriteString(newLine + newLine) + sb.WriteString("package " + packageName) + sb.WriteString(newLine + newLine) +} diff --git a/model/internal/cmd/pdatagen/internal/log_structs.go b/model/internal/cmd/pdatagen/internal/log_structs.go index d743cbcaa596..b4acc24d0c2c 100644 --- a/model/internal/cmd/pdatagen/internal/log_structs.go +++ b/model/internal/cmd/pdatagen/internal/log_structs.go @@ -15,7 +15,7 @@ package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" var logFile = &File{ - Name: "log", + Name: "plog", imports: []string{ `"sort"`, ``, diff --git a/model/internal/cmd/pdatagen/internal/metrics_structs.go b/model/internal/cmd/pdatagen/internal/metrics_structs.go index 37c3be39f096..4794276e421d 100644 --- a/model/internal/cmd/pdatagen/internal/metrics_structs.go +++ b/model/internal/cmd/pdatagen/internal/metrics_structs.go @@ -15,7 +15,7 @@ package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" var metricsFile = &File{ - Name: "metrics", + Name: "pmetric", imports: []string{ `"sort"`, ``, diff --git a/model/internal/cmd/pdatagen/internal/trace_structs.go b/model/internal/cmd/pdatagen/internal/trace_structs.go index b88fe7a8e5d2..4b794eedeed8 100644 --- a/model/internal/cmd/pdatagen/internal/trace_structs.go +++ b/model/internal/cmd/pdatagen/internal/trace_structs.go @@ -15,7 +15,7 @@ package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" var traceFile = &File{ - Name: "trace", + Name: "ptrace", imports: []string{ `"sort"`, ``, diff --git a/model/internal/cmd/pdatagen/main.go b/model/internal/cmd/pdatagen/main.go index b65b9e4077da..d552db765ecb 100644 --- a/model/internal/cmd/pdatagen/main.go +++ b/model/internal/cmd/pdatagen/main.go @@ -16,6 +16,7 @@ package main import ( "os" + "path/filepath" "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" ) @@ -40,7 +41,18 @@ func main() { check(f.Close()) f, err = os.Create("./model/pdata/generated_" + fp.Name + "_alias.go") check(err) - _, err = f.WriteString(fp.GenerateAliasFile()) + fileName := "generated_alias.go" + packageName := fp.Name + if fp.IsCommon() { + fileName = "generated_" + fp.Name + "_alias.go" + packageName = "pcommon" + } + _, err = f.WriteString(fp.GenerateAliasFile("pdata", packageName)) + check(err) + check(f.Close()) + f, err = os.Create(filepath.Clean("./model/" + packageName + "/" + fileName)) + check(err) + _, err = f.WriteString(fp.GenerateAliasFile(packageName, "")) check(err) check(f.Close()) } diff --git a/model/internal/pdata/generated_log.go b/model/internal/pdata/generated_plog.go similarity index 100% rename from model/internal/pdata/generated_log.go rename to model/internal/pdata/generated_plog.go diff --git a/model/internal/pdata/generated_log_test.go b/model/internal/pdata/generated_plog_test.go similarity index 100% rename from model/internal/pdata/generated_log_test.go rename to model/internal/pdata/generated_plog_test.go diff --git a/model/internal/pdata/generated_metrics.go b/model/internal/pdata/generated_pmetric.go similarity index 100% rename from model/internal/pdata/generated_metrics.go rename to model/internal/pdata/generated_pmetric.go diff --git a/model/internal/pdata/generated_metrics_test.go b/model/internal/pdata/generated_pmetric_test.go similarity index 100% rename from model/internal/pdata/generated_metrics_test.go rename to model/internal/pdata/generated_pmetric_test.go diff --git a/model/internal/pdata/generated_trace.go b/model/internal/pdata/generated_ptrace.go similarity index 100% rename from model/internal/pdata/generated_trace.go rename to model/internal/pdata/generated_ptrace.go diff --git a/model/internal/pdata/generated_trace_test.go b/model/internal/pdata/generated_ptrace_test.go similarity index 100% rename from model/internal/pdata/generated_trace_test.go rename to model/internal/pdata/generated_ptrace_test.go diff --git a/model/pcommon/alias.go b/model/pcommon/alias.go new file mode 100644 index 000000000000..72929c3ead92 --- /dev/null +++ b/model/pcommon/alias.go @@ -0,0 +1,68 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pcommon // import "go.opentelemetry.io/collector/model/pcommon" + +// This file contains aliases to data structures that are common for all +// signal types, such as timestamps, attributes, etc. + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// ValueType is an alias for pdata.ValueType type. +type ValueType = pdata.ValueType + +// AttributeValueType is an alias for pdata.ValueType type. +// Deprecated: [v0.48.0] Use ValueType instead. +type AttributeValueType = pdata.ValueType + +const ( + ValueTypeEmpty = pdata.ValueTypeEmpty + ValueTypeString = pdata.ValueTypeString + ValueTypeInt = pdata.ValueTypeInt + ValueTypeDouble = pdata.ValueTypeDouble + ValueTypeBool = pdata.ValueTypeBool + ValueTypeMap = pdata.ValueTypeMap + ValueTypeSlice = pdata.ValueTypeSlice + ValueTypeBytes = pdata.ValueTypeBytes +) + +// Value is an alias for pdata.Value struct. +type Value = pdata.Value + +// Deprecated: [v0.48.0] Use Value instead. +type AttributeValue = pdata.Value + +// Aliases for functions to create pdata.Value. +var ( + NewValueEmpty = pdata.NewValueEmpty + NewValueString = pdata.NewValueString + NewValueInt = pdata.NewValueInt + NewValueDouble = pdata.NewValueDouble + NewValueBool = pdata.NewValueBool + NewValueMap = pdata.NewValueMap + NewValueSlice = pdata.NewValueSlice + NewValueBytes = pdata.NewValueBytes +) + +// Map is an alias for pdata.Map struct. +type Map = pdata.Map + +// Deprecated: [v0.48.0] Use Map instead. +type AttributeMap = pdata.Map + +// Aliases for functions to create pdata.Map. +var ( + NewMap = pdata.NewMap + NewMapFromRaw = pdata.NewMapFromRaw +) diff --git a/model/pcommon/generated_common_alias.go b/model/pcommon/generated_common_alias.go new file mode 100644 index 000000000000..cd8ac8a6b2bd --- /dev/null +++ b/model/pcommon/generated_common_alias.go @@ -0,0 +1,32 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package pcommon + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// InstrumentationScope is an alias for pdata.InstrumentationScope struct. +type InstrumentationScope = pdata.InstrumentationScope + +// NewInstrumentationScope is an alias for a function to create a new empty InstrumentationScope. +var NewInstrumentationScope = pdata.NewInstrumentationScope + +// Slice is an alias for pdata.Slice struct. +type Slice = pdata.Slice + +// NewSlice is an alias for a function to create Slice. +var NewSlice = pdata.NewSlice diff --git a/model/pcommon/generated_resource_alias.go b/model/pcommon/generated_resource_alias.go new file mode 100644 index 000000000000..80f69b456f2c --- /dev/null +++ b/model/pcommon/generated_resource_alias.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package pcommon + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// Resource is an alias for pdata.Resource struct. +type Resource = pdata.Resource + +// NewResource is an alias for a function to create a new empty Resource. +var NewResource = pdata.NewResource diff --git a/model/pcommon/spanid_alias.go b/model/pcommon/spanid_alias.go new file mode 100644 index 000000000000..c35dce3c7d57 --- /dev/null +++ b/model/pcommon/spanid_alias.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pcommon // import "go.opentelemetry.io/collector/model/pcommon" + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// SpanID is an alias for pdata.SpanID struct. +type SpanID = pdata.SpanID + +// InvalidSpanID is an alias for pdata.InvalidSpanID function. +var InvalidSpanID = pdata.InvalidSpanID + +// NewSpanID is an alias for a function to create new SpanID. +var NewSpanID = pdata.NewSpanID diff --git a/model/pcommon/timestamp_alias.go b/model/pcommon/timestamp_alias.go new file mode 100644 index 000000000000..d6549d8b412d --- /dev/null +++ b/model/pcommon/timestamp_alias.go @@ -0,0 +1,23 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pcommon // import "go.opentelemetry.io/collector/model/pcommon" + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// Timestamp is a an alias for pdata.Timestamp. +type Timestamp = pdata.Timestamp + +// NewTimestampFromTime is an alias for pdata.NewTimestampFromTime function. +var NewTimestampFromTime = pdata.NewTimestampFromTime diff --git a/model/pcommon/traceid_alias.go b/model/pcommon/traceid_alias.go new file mode 100644 index 000000000000..de1c890b3cc0 --- /dev/null +++ b/model/pcommon/traceid_alias.go @@ -0,0 +1,26 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pcommon // import "go.opentelemetry.io/collector/model/pcommon" + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// TraceID is an alias for pdata.TraceID struct. +type TraceID = pdata.TraceID + +// InvalidTraceID is an alias for pdata.InvalidTraceID function. +var InvalidTraceID = pdata.InvalidTraceID + +// NewTraceID is an alias for a function to create new TraceID. +var NewTraceID = pdata.NewTraceID diff --git a/model/pdata/generated_common_alias.go b/model/pdata/generated_common_alias.go index 3d3e64a6878a..38364940dcfa 100644 --- a/model/pdata/generated_common_alias.go +++ b/model/pdata/generated_common_alias.go @@ -20,13 +20,17 @@ package pdata import "go.opentelemetry.io/collector/model/internal/pdata" // InstrumentationScope is an alias for pdata.InstrumentationScope struct. +// Deprecated: [v0.49.0] Use pcommon.InstrumentationScope instead. type InstrumentationScope = pdata.InstrumentationScope // NewInstrumentationScope is an alias for a function to create a new empty InstrumentationScope. +// Deprecated: [v0.49.0] Use pcommon.NewInstrumentationScope instead. var NewInstrumentationScope = pdata.NewInstrumentationScope // Slice is an alias for pdata.Slice struct. +// Deprecated: [v0.49.0] Use pcommon.Slice instead. type Slice = pdata.Slice // NewSlice is an alias for a function to create Slice. +// Deprecated: [v0.49.0] Use pcommon.NewSlice instead. var NewSlice = pdata.NewSlice diff --git a/model/pdata/generated_plog_alias.go b/model/pdata/generated_plog_alias.go new file mode 100644 index 000000000000..cd399038406a --- /dev/null +++ b/model/pdata/generated_plog_alias.go @@ -0,0 +1,68 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package pdata + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// ResourceLogsSlice is an alias for pdata.ResourceLogsSlice struct. +// Deprecated: [v0.49.0] Use plog.ResourceLogsSlice instead. +type ResourceLogsSlice = pdata.ResourceLogsSlice + +// NewResourceLogsSlice is an alias for a function to create ResourceLogsSlice. +// Deprecated: [v0.49.0] Use plog.NewResourceLogsSlice instead. +var NewResourceLogsSlice = pdata.NewResourceLogsSlice + +// ResourceLogs is an alias for pdata.ResourceLogs struct. +// Deprecated: [v0.49.0] Use plog.ResourceLogs instead. +type ResourceLogs = pdata.ResourceLogs + +// NewResourceLogs is an alias for a function to create a new empty ResourceLogs. +// Deprecated: [v0.49.0] Use plog.NewResourceLogs instead. +var NewResourceLogs = pdata.NewResourceLogs + +// ScopeLogsSlice is an alias for pdata.ScopeLogsSlice struct. +// Deprecated: [v0.49.0] Use plog.ScopeLogsSlice instead. +type ScopeLogsSlice = pdata.ScopeLogsSlice + +// NewScopeLogsSlice is an alias for a function to create ScopeLogsSlice. +// Deprecated: [v0.49.0] Use plog.NewScopeLogsSlice instead. +var NewScopeLogsSlice = pdata.NewScopeLogsSlice + +// ScopeLogs is an alias for pdata.ScopeLogs struct. +// Deprecated: [v0.49.0] Use plog.ScopeLogs instead. +type ScopeLogs = pdata.ScopeLogs + +// NewScopeLogs is an alias for a function to create a new empty ScopeLogs. +// Deprecated: [v0.49.0] Use plog.NewScopeLogs instead. +var NewScopeLogs = pdata.NewScopeLogs + +// LogRecordSlice is an alias for pdata.LogRecordSlice struct. +// Deprecated: [v0.49.0] Use plog.LogRecordSlice instead. +type LogRecordSlice = pdata.LogRecordSlice + +// NewLogRecordSlice is an alias for a function to create LogRecordSlice. +// Deprecated: [v0.49.0] Use plog.NewLogRecordSlice instead. +var NewLogRecordSlice = pdata.NewLogRecordSlice + +// LogRecord is an alias for pdata.LogRecord struct. +// Deprecated: [v0.49.0] Use plog.LogRecord instead. +type LogRecord = pdata.LogRecord + +// NewLogRecord is an alias for a function to create a new empty LogRecord. +// Deprecated: [v0.49.0] Use plog.NewLogRecord instead. +var NewLogRecord = pdata.NewLogRecord diff --git a/model/pdata/generated_pmetric_alias.go b/model/pdata/generated_pmetric_alias.go new file mode 100644 index 000000000000..a8620d6de2c5 --- /dev/null +++ b/model/pdata/generated_pmetric_alias.go @@ -0,0 +1,212 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package pdata + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// ResourceMetricsSlice is an alias for pdata.ResourceMetricsSlice struct. +// Deprecated: [v0.49.0] Use pmetric.ResourceMetricsSlice instead. +type ResourceMetricsSlice = pdata.ResourceMetricsSlice + +// NewResourceMetricsSlice is an alias for a function to create ResourceMetricsSlice. +// Deprecated: [v0.49.0] Use pmetric.NewResourceMetricsSlice instead. +var NewResourceMetricsSlice = pdata.NewResourceMetricsSlice + +// ResourceMetrics is an alias for pdata.ResourceMetrics struct. +// Deprecated: [v0.49.0] Use pmetric.ResourceMetrics instead. +type ResourceMetrics = pdata.ResourceMetrics + +// NewResourceMetrics is an alias for a function to create a new empty ResourceMetrics. +// Deprecated: [v0.49.0] Use pmetric.NewResourceMetrics instead. +var NewResourceMetrics = pdata.NewResourceMetrics + +// ScopeMetricsSlice is an alias for pdata.ScopeMetricsSlice struct. +// Deprecated: [v0.49.0] Use pmetric.ScopeMetricsSlice instead. +type ScopeMetricsSlice = pdata.ScopeMetricsSlice + +// NewScopeMetricsSlice is an alias for a function to create ScopeMetricsSlice. +// Deprecated: [v0.49.0] Use pmetric.NewScopeMetricsSlice instead. +var NewScopeMetricsSlice = pdata.NewScopeMetricsSlice + +// ScopeMetrics is an alias for pdata.ScopeMetrics struct. +// Deprecated: [v0.49.0] Use pmetric.ScopeMetrics instead. +type ScopeMetrics = pdata.ScopeMetrics + +// NewScopeMetrics is an alias for a function to create a new empty ScopeMetrics. +// Deprecated: [v0.49.0] Use pmetric.NewScopeMetrics instead. +var NewScopeMetrics = pdata.NewScopeMetrics + +// MetricSlice is an alias for pdata.MetricSlice struct. +// Deprecated: [v0.49.0] Use pmetric.MetricSlice instead. +type MetricSlice = pdata.MetricSlice + +// NewMetricSlice is an alias for a function to create MetricSlice. +// Deprecated: [v0.49.0] Use pmetric.NewMetricSlice instead. +var NewMetricSlice = pdata.NewMetricSlice + +// Metric is an alias for pdata.Metric struct. +// Deprecated: [v0.49.0] Use pmetric.Metric instead. +type Metric = pdata.Metric + +// NewMetric is an alias for a function to create a new empty Metric. +// Deprecated: [v0.49.0] Use pmetric.NewMetric instead. +var NewMetric = pdata.NewMetric + +// Gauge is an alias for pdata.Gauge struct. +// Deprecated: [v0.49.0] Use pmetric.Gauge instead. +type Gauge = pdata.Gauge + +// NewGauge is an alias for a function to create a new empty Gauge. +// Deprecated: [v0.49.0] Use pmetric.NewGauge instead. +var NewGauge = pdata.NewGauge + +// Sum is an alias for pdata.Sum struct. +// Deprecated: [v0.49.0] Use pmetric.Sum instead. +type Sum = pdata.Sum + +// NewSum is an alias for a function to create a new empty Sum. +// Deprecated: [v0.49.0] Use pmetric.NewSum instead. +var NewSum = pdata.NewSum + +// Histogram is an alias for pdata.Histogram struct. +// Deprecated: [v0.49.0] Use pmetric.Histogram instead. +type Histogram = pdata.Histogram + +// NewHistogram is an alias for a function to create a new empty Histogram. +// Deprecated: [v0.49.0] Use pmetric.NewHistogram instead. +var NewHistogram = pdata.NewHistogram + +// ExponentialHistogram is an alias for pdata.ExponentialHistogram struct. +// Deprecated: [v0.49.0] Use pmetric.ExponentialHistogram instead. +type ExponentialHistogram = pdata.ExponentialHistogram + +// NewExponentialHistogram is an alias for a function to create a new empty ExponentialHistogram. +// Deprecated: [v0.49.0] Use pmetric.NewExponentialHistogram instead. +var NewExponentialHistogram = pdata.NewExponentialHistogram + +// Summary is an alias for pdata.Summary struct. +// Deprecated: [v0.49.0] Use pmetric.Summary instead. +type Summary = pdata.Summary + +// NewSummary is an alias for a function to create a new empty Summary. +// Deprecated: [v0.49.0] Use pmetric.NewSummary instead. +var NewSummary = pdata.NewSummary + +// NumberDataPointSlice is an alias for pdata.NumberDataPointSlice struct. +// Deprecated: [v0.49.0] Use pmetric.NumberDataPointSlice instead. +type NumberDataPointSlice = pdata.NumberDataPointSlice + +// NewNumberDataPointSlice is an alias for a function to create NumberDataPointSlice. +// Deprecated: [v0.49.0] Use pmetric.NewNumberDataPointSlice instead. +var NewNumberDataPointSlice = pdata.NewNumberDataPointSlice + +// NumberDataPoint is an alias for pdata.NumberDataPoint struct. +// Deprecated: [v0.49.0] Use pmetric.NumberDataPoint instead. +type NumberDataPoint = pdata.NumberDataPoint + +// NewNumberDataPoint is an alias for a function to create a new empty NumberDataPoint. +// Deprecated: [v0.49.0] Use pmetric.NewNumberDataPoint instead. +var NewNumberDataPoint = pdata.NewNumberDataPoint + +// HistogramDataPointSlice is an alias for pdata.HistogramDataPointSlice struct. +// Deprecated: [v0.49.0] Use pmetric.HistogramDataPointSlice instead. +type HistogramDataPointSlice = pdata.HistogramDataPointSlice + +// NewHistogramDataPointSlice is an alias for a function to create HistogramDataPointSlice. +// Deprecated: [v0.49.0] Use pmetric.NewHistogramDataPointSlice instead. +var NewHistogramDataPointSlice = pdata.NewHistogramDataPointSlice + +// HistogramDataPoint is an alias for pdata.HistogramDataPoint struct. +// Deprecated: [v0.49.0] Use pmetric.HistogramDataPoint instead. +type HistogramDataPoint = pdata.HistogramDataPoint + +// NewHistogramDataPoint is an alias for a function to create a new empty HistogramDataPoint. +// Deprecated: [v0.49.0] Use pmetric.NewHistogramDataPoint instead. +var NewHistogramDataPoint = pdata.NewHistogramDataPoint + +// ExponentialHistogramDataPointSlice is an alias for pdata.ExponentialHistogramDataPointSlice struct. +// Deprecated: [v0.49.0] Use pmetric.ExponentialHistogramDataPointSlice instead. +type ExponentialHistogramDataPointSlice = pdata.ExponentialHistogramDataPointSlice + +// NewExponentialHistogramDataPointSlice is an alias for a function to create ExponentialHistogramDataPointSlice. +// Deprecated: [v0.49.0] Use pmetric.NewExponentialHistogramDataPointSlice instead. +var NewExponentialHistogramDataPointSlice = pdata.NewExponentialHistogramDataPointSlice + +// ExponentialHistogramDataPoint is an alias for pdata.ExponentialHistogramDataPoint struct. +// Deprecated: [v0.49.0] Use pmetric.ExponentialHistogramDataPoint instead. +type ExponentialHistogramDataPoint = pdata.ExponentialHistogramDataPoint + +// NewExponentialHistogramDataPoint is an alias for a function to create a new empty ExponentialHistogramDataPoint. +// Deprecated: [v0.49.0] Use pmetric.NewExponentialHistogramDataPoint instead. +var NewExponentialHistogramDataPoint = pdata.NewExponentialHistogramDataPoint + +// Buckets is an alias for pdata.Buckets struct. +// Deprecated: [v0.49.0] Use pmetric.Buckets instead. +type Buckets = pdata.Buckets + +// NewBuckets is an alias for a function to create a new empty Buckets. +// Deprecated: [v0.49.0] Use pmetric.NewBuckets instead. +var NewBuckets = pdata.NewBuckets + +// SummaryDataPointSlice is an alias for pdata.SummaryDataPointSlice struct. +// Deprecated: [v0.49.0] Use pmetric.SummaryDataPointSlice instead. +type SummaryDataPointSlice = pdata.SummaryDataPointSlice + +// NewSummaryDataPointSlice is an alias for a function to create SummaryDataPointSlice. +// Deprecated: [v0.49.0] Use pmetric.NewSummaryDataPointSlice instead. +var NewSummaryDataPointSlice = pdata.NewSummaryDataPointSlice + +// SummaryDataPoint is an alias for pdata.SummaryDataPoint struct. +// Deprecated: [v0.49.0] Use pmetric.SummaryDataPoint instead. +type SummaryDataPoint = pdata.SummaryDataPoint + +// NewSummaryDataPoint is an alias for a function to create a new empty SummaryDataPoint. +// Deprecated: [v0.49.0] Use pmetric.NewSummaryDataPoint instead. +var NewSummaryDataPoint = pdata.NewSummaryDataPoint + +// ValueAtQuantileSlice is an alias for pdata.ValueAtQuantileSlice struct. +// Deprecated: [v0.49.0] Use pmetric.ValueAtQuantileSlice instead. +type ValueAtQuantileSlice = pdata.ValueAtQuantileSlice + +// NewValueAtQuantileSlice is an alias for a function to create ValueAtQuantileSlice. +// Deprecated: [v0.49.0] Use pmetric.NewValueAtQuantileSlice instead. +var NewValueAtQuantileSlice = pdata.NewValueAtQuantileSlice + +// ValueAtQuantile is an alias for pdata.ValueAtQuantile struct. +// Deprecated: [v0.49.0] Use pmetric.ValueAtQuantile instead. +type ValueAtQuantile = pdata.ValueAtQuantile + +// NewValueAtQuantile is an alias for a function to create a new empty ValueAtQuantile. +// Deprecated: [v0.49.0] Use pmetric.NewValueAtQuantile instead. +var NewValueAtQuantile = pdata.NewValueAtQuantile + +// ExemplarSlice is an alias for pdata.ExemplarSlice struct. +// Deprecated: [v0.49.0] Use pmetric.ExemplarSlice instead. +type ExemplarSlice = pdata.ExemplarSlice + +// NewExemplarSlice is an alias for a function to create ExemplarSlice. +// Deprecated: [v0.49.0] Use pmetric.NewExemplarSlice instead. +var NewExemplarSlice = pdata.NewExemplarSlice + +// Exemplar is an alias for pdata.Exemplar struct. +// Deprecated: [v0.49.0] Use pmetric.Exemplar instead. +type Exemplar = pdata.Exemplar + +// NewExemplar is an alias for a function to create a new empty Exemplar. +// Deprecated: [v0.49.0] Use pmetric.NewExemplar instead. +var NewExemplar = pdata.NewExemplar diff --git a/model/pdata/generated_ptrace_alias.go b/model/pdata/generated_ptrace_alias.go new file mode 100644 index 000000000000..3503fbe1b87b --- /dev/null +++ b/model/pdata/generated_ptrace_alias.go @@ -0,0 +1,108 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". + +package pdata + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// ResourceSpansSlice is an alias for pdata.ResourceSpansSlice struct. +// Deprecated: [v0.49.0] Use ptrace.ResourceSpansSlice instead. +type ResourceSpansSlice = pdata.ResourceSpansSlice + +// NewResourceSpansSlice is an alias for a function to create ResourceSpansSlice. +// Deprecated: [v0.49.0] Use ptrace.NewResourceSpansSlice instead. +var NewResourceSpansSlice = pdata.NewResourceSpansSlice + +// ResourceSpans is an alias for pdata.ResourceSpans struct. +// Deprecated: [v0.49.0] Use ptrace.ResourceSpans instead. +type ResourceSpans = pdata.ResourceSpans + +// NewResourceSpans is an alias for a function to create a new empty ResourceSpans. +// Deprecated: [v0.49.0] Use ptrace.NewResourceSpans instead. +var NewResourceSpans = pdata.NewResourceSpans + +// ScopeSpansSlice is an alias for pdata.ScopeSpansSlice struct. +// Deprecated: [v0.49.0] Use ptrace.ScopeSpansSlice instead. +type ScopeSpansSlice = pdata.ScopeSpansSlice + +// NewScopeSpansSlice is an alias for a function to create ScopeSpansSlice. +// Deprecated: [v0.49.0] Use ptrace.NewScopeSpansSlice instead. +var NewScopeSpansSlice = pdata.NewScopeSpansSlice + +// ScopeSpans is an alias for pdata.ScopeSpans struct. +// Deprecated: [v0.49.0] Use ptrace.ScopeSpans instead. +type ScopeSpans = pdata.ScopeSpans + +// NewScopeSpans is an alias for a function to create a new empty ScopeSpans. +// Deprecated: [v0.49.0] Use ptrace.NewScopeSpans instead. +var NewScopeSpans = pdata.NewScopeSpans + +// SpanSlice is an alias for pdata.SpanSlice struct. +// Deprecated: [v0.49.0] Use ptrace.SpanSlice instead. +type SpanSlice = pdata.SpanSlice + +// NewSpanSlice is an alias for a function to create SpanSlice. +// Deprecated: [v0.49.0] Use ptrace.NewSpanSlice instead. +var NewSpanSlice = pdata.NewSpanSlice + +// Span is an alias for pdata.Span struct. +// Deprecated: [v0.49.0] Use ptrace.Span instead. +type Span = pdata.Span + +// NewSpan is an alias for a function to create a new empty Span. +// Deprecated: [v0.49.0] Use ptrace.NewSpan instead. +var NewSpan = pdata.NewSpan + +// SpanEventSlice is an alias for pdata.SpanEventSlice struct. +// Deprecated: [v0.49.0] Use ptrace.SpanEventSlice instead. +type SpanEventSlice = pdata.SpanEventSlice + +// NewSpanEventSlice is an alias for a function to create SpanEventSlice. +// Deprecated: [v0.49.0] Use ptrace.NewSpanEventSlice instead. +var NewSpanEventSlice = pdata.NewSpanEventSlice + +// SpanEvent is an alias for pdata.SpanEvent struct. +// Deprecated: [v0.49.0] Use ptrace.SpanEvent instead. +type SpanEvent = pdata.SpanEvent + +// NewSpanEvent is an alias for a function to create a new empty SpanEvent. +// Deprecated: [v0.49.0] Use ptrace.NewSpanEvent instead. +var NewSpanEvent = pdata.NewSpanEvent + +// SpanLinkSlice is an alias for pdata.SpanLinkSlice struct. +// Deprecated: [v0.49.0] Use ptrace.SpanLinkSlice instead. +type SpanLinkSlice = pdata.SpanLinkSlice + +// NewSpanLinkSlice is an alias for a function to create SpanLinkSlice. +// Deprecated: [v0.49.0] Use ptrace.NewSpanLinkSlice instead. +var NewSpanLinkSlice = pdata.NewSpanLinkSlice + +// SpanLink is an alias for pdata.SpanLink struct. +// Deprecated: [v0.49.0] Use ptrace.SpanLink instead. +type SpanLink = pdata.SpanLink + +// NewSpanLink is an alias for a function to create a new empty SpanLink. +// Deprecated: [v0.49.0] Use ptrace.NewSpanLink instead. +var NewSpanLink = pdata.NewSpanLink + +// SpanStatus is an alias for pdata.SpanStatus struct. +// Deprecated: [v0.49.0] Use ptrace.SpanStatus instead. +type SpanStatus = pdata.SpanStatus + +// NewSpanStatus is an alias for a function to create a new empty SpanStatus. +// Deprecated: [v0.49.0] Use ptrace.NewSpanStatus instead. +var NewSpanStatus = pdata.NewSpanStatus diff --git a/model/pdata/generated_resource_alias.go b/model/pdata/generated_resource_alias.go index 4c4d32a87b00..58c8a2d61a9c 100644 --- a/model/pdata/generated_resource_alias.go +++ b/model/pdata/generated_resource_alias.go @@ -20,7 +20,9 @@ package pdata import "go.opentelemetry.io/collector/model/internal/pdata" // Resource is an alias for pdata.Resource struct. +// Deprecated: [v0.49.0] Use pcommon.Resource instead. type Resource = pdata.Resource // NewResource is an alias for a function to create a new empty Resource. +// Deprecated: [v0.49.0] Use pcommon.NewResource instead. var NewResource = pdata.NewResource diff --git a/model/plog/alias.go b/model/plog/alias.go new file mode 100644 index 000000000000..ffc1c04945b0 --- /dev/null +++ b/model/plog/alias.go @@ -0,0 +1,65 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package plog // import "go.opentelemetry.io/collector/model/plog" + +// This file contains aliases for logs data structures. + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// LogsMarshaler is an alias for pdata.LogsMarshaler interface. +type LogsMarshaler = pdata.LogsMarshaler + +// LogsUnmarshaler is an alias for pdata.LogsUnmarshaler interface. +type LogsUnmarshaler = pdata.LogsUnmarshaler + +// LogsSizer is an alias for pdata.LogsSizer interface. +type LogsSizer = pdata.LogsSizer + +// Logs is an alias for pdata.Logs struct. +type Logs = pdata.Logs + +// New is an alias for a function to create new Logs. +var NewLogs = pdata.NewLogs + +// SeverityNumber is an alias for pdata.SeverityNumber type. +type SeverityNumber = pdata.SeverityNumber + +const ( + SeverityNumberUNDEFINED = pdata.SeverityNumberUNDEFINED + SeverityNumberTRACE = pdata.SeverityNumberTRACE + SeverityNumberTRACE2 = pdata.SeverityNumberTRACE2 + SeverityNumberTRACE3 = pdata.SeverityNumberTRACE3 + SeverityNumberTRACE4 = pdata.SeverityNumberTRACE4 + SeverityNumberDEBUG = pdata.SeverityNumberDEBUG + SeverityNumberDEBUG2 = pdata.SeverityNumberDEBUG2 + SeverityNumberDEBUG3 = pdata.SeverityNumberDEBUG3 + SeverityNumberDEBUG4 = pdata.SeverityNumberDEBUG4 + SeverityNumberINFO = pdata.SeverityNumberINFO + SeverityNumberINFO2 = pdata.SeverityNumberINFO2 + SeverityNumberINFO3 = pdata.SeverityNumberINFO3 + SeverityNumberINFO4 = pdata.SeverityNumberINFO4 + SeverityNumberWARN = pdata.SeverityNumberWARN + SeverityNumberWARN2 = pdata.SeverityNumberWARN2 + SeverityNumberWARN3 = pdata.SeverityNumberWARN3 + SeverityNumberWARN4 = pdata.SeverityNumberWARN4 + SeverityNumberERROR = pdata.SeverityNumberERROR + SeverityNumberERROR2 = pdata.SeverityNumberERROR2 + SeverityNumberERROR3 = pdata.SeverityNumberERROR3 + SeverityNumberERROR4 = pdata.SeverityNumberERROR4 + SeverityNumberFATAL = pdata.SeverityNumberFATAL + SeverityNumberFATAL2 = pdata.SeverityNumberFATAL2 + SeverityNumberFATAL3 = pdata.SeverityNumberFATAL3 + SeverityNumberFATAL4 = pdata.SeverityNumberFATAL4 +) diff --git a/model/pdata/generated_log_alias.go b/model/plog/generated_alias.go similarity index 99% rename from model/pdata/generated_log_alias.go rename to model/plog/generated_alias.go index bafbbff59d48..1eb9e84de66f 100644 --- a/model/pdata/generated_log_alias.go +++ b/model/plog/generated_alias.go @@ -15,7 +15,7 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package pdata +package plog import "go.opentelemetry.io/collector/model/internal/pdata" diff --git a/model/pmetric/alias.go b/model/pmetric/alias.go new file mode 100644 index 000000000000..4a9a7a36c058 --- /dev/null +++ b/model/pmetric/alias.go @@ -0,0 +1,81 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pmetric // import "go.opentelemetry.io/collector/model/pmetric" + +// This file contains aliases for metric data structures. + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// MetricsMarshaler is an alias for pdata.MetricsMarshaler interface. +type MetricsMarshaler = pdata.MetricsMarshaler + +// MetricsUnmarshaler is an alias for pdata.MetricsUnmarshaler interface. +type MetricsUnmarshaler = pdata.MetricsUnmarshaler + +// MetricsSizer is an alias for pdata.MetricsSizer interface. +type MetricsSizer = pdata.MetricsSizer + +// Metrics is an alias for pdata.Metrics structure. +type Metrics = pdata.Metrics + +// NewMetrics is an alias for a function to create new Metrics. +var NewMetrics = pdata.NewMetrics + +// MetricDataType is an alias for pdata.MetricDataType type. +type MetricDataType = pdata.MetricDataType + +const ( + MetricDataTypeNone = pdata.MetricDataTypeNone + MetricDataTypeGauge = pdata.MetricDataTypeGauge + MetricDataTypeSum = pdata.MetricDataTypeSum + MetricDataTypeHistogram = pdata.MetricDataTypeHistogram + MetricDataTypeExponentialHistogram = pdata.MetricDataTypeExponentialHistogram + MetricDataTypeSummary = pdata.MetricDataTypeSummary +) + +// MetricAggregationTemporality is an alias for pdata.MetricAggregationTemporality type. +type MetricAggregationTemporality = pdata.MetricAggregationTemporality + +const ( + MetricAggregationTemporalityUnspecified = pdata.MetricAggregationTemporalityUnspecified + MetricAggregationTemporalityDelta = pdata.MetricAggregationTemporalityDelta + MetricAggregationTemporalityCumulative = pdata.MetricAggregationTemporalityCumulative +) + +// MetricDataPointFlags is an alias for pdata.MetricDataPointFlags type. +type MetricDataPointFlags = pdata.MetricDataPointFlags + +const ( + MetricDataPointFlagsNone = pdata.MetricDataPointFlagsNone +) + +// NewMetricDataPointFlags is an alias for a function to create new MetricDataPointFlags. +var NewMetricDataPointFlags = pdata.NewMetricDataPointFlags + +// MetricDataPointFlag is an alias for pdata.MetricDataPointFlag type. +type MetricDataPointFlag = pdata.MetricDataPointFlag + +const ( + MetricDataPointFlagNoRecordedValue = pdata.MetricDataPointFlagNoRecordedValue +) + +// MetricValueType is an alias for pdata.MetricValueType type. +type MetricValueType = pdata.MetricValueType + +const ( + MetricValueTypeNone = pdata.MetricValueTypeNone + MetricValueTypeInt = pdata.MetricValueTypeInt + MetricValueTypeDouble = pdata.MetricValueTypeDouble +) diff --git a/model/pdata/generated_metrics_alias.go b/model/pmetric/generated_alias.go similarity index 99% rename from model/pdata/generated_metrics_alias.go rename to model/pmetric/generated_alias.go index 282dcc9a22f5..73cc75da6fe8 100644 --- a/model/pdata/generated_metrics_alias.go +++ b/model/pmetric/generated_alias.go @@ -15,7 +15,7 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package pdata +package pmetric import "go.opentelemetry.io/collector/model/internal/pdata" diff --git a/model/ptrace/alias.go b/model/ptrace/alias.go new file mode 100644 index 000000000000..fd29f02770b6 --- /dev/null +++ b/model/ptrace/alias.go @@ -0,0 +1,62 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ptrace // import "go.opentelemetry.io/collector/model/ptrace" + +// This file contains aliases for trace data structures. + +import "go.opentelemetry.io/collector/model/internal/pdata" + +// TracesMarshaler is an alias for pdata.TracesMarshaler interface. +type TracesMarshaler = pdata.TracesMarshaler + +// TracesUnmarshaler is an alias for pdata.TracesUnmarshaler interface. +type TracesUnmarshaler = pdata.TracesUnmarshaler + +// TracesSizer is an alias for pdata.TracesSizer interface. +type TracesSizer = pdata.TracesSizer + +// Traces is an alias for pdata.Traces struct. +type Traces = pdata.Traces + +// NewTraces is an alias for a function to create new Traces. +var NewTraces = pdata.NewTraces + +// TraceState is an alias for pdata.TraceState type. +type TraceState = pdata.TraceState + +const ( + TraceStateEmpty = pdata.TraceStateEmpty +) + +// SpanKind is an alias for pdata.SpanKind type. +type SpanKind = pdata.SpanKind + +const ( + SpanKindUnspecified = pdata.SpanKindUnspecified + SpanKindInternal = pdata.SpanKindInternal + SpanKindServer = pdata.SpanKindServer + SpanKindClient = pdata.SpanKindClient + SpanKindProducer = pdata.SpanKindProducer + SpanKindConsumer = pdata.SpanKindConsumer +) + +// StatusCode is an alias for pdata.StatusCode type. +type StatusCode = pdata.StatusCode + +const ( + StatusCodeUnset = pdata.StatusCodeUnset + StatusCodeOk = pdata.StatusCodeOk + StatusCodeError = pdata.StatusCodeError +) diff --git a/model/pdata/generated_trace_alias.go b/model/ptrace/generated_alias.go similarity index 99% rename from model/pdata/generated_trace_alias.go rename to model/ptrace/generated_alias.go index 4b3bf5d399b7..c96c5db51639 100644 --- a/model/pdata/generated_trace_alias.go +++ b/model/ptrace/generated_alias.go @@ -15,7 +15,7 @@ // Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. // To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". -package pdata +package ptrace import "go.opentelemetry.io/collector/model/internal/pdata"