Skip to content

Commit

Permalink
Create additional pdata packages separated by type for further split
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryax committed Mar 21, 2022
1 parent 7f0dbff commit 971a734
Show file tree
Hide file tree
Showing 18 changed files with 547 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
- `pdata.AttributeValueType...` constants are deprecated in favor of `pdata.ValueType...`
- `pdata.NewAttributeValue...` funcs are deprecated in favor of `pdata.NewValue...`

### 💡 Enhancements 💡

- Create additional pdata packages separated by type for further split of pdata (#4918)

## v0.47.0 Beta

### 🛑 Breaking changes 🛑
Expand Down
31 changes: 18 additions & 13 deletions model/internal/cmd/pdatagen/internal/files.go

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

2 changes: 1 addition & 1 deletion model/internal/cmd/pdatagen/internal/log_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal"

var logFile = &File{
Name: "log",
Name: "logs",
imports: []string{
`"sort"`,
``,
Expand Down
2 changes: 1 addition & 1 deletion model/internal/cmd/pdatagen/internal/trace_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal"

var traceFile = &File{
Name: "trace",
Name: "traces",
imports: []string{
`"sort"`,
``,
Expand Down
9 changes: 8 additions & 1 deletion model/internal/cmd/pdatagen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,15 @@ func main() {
check(f.Close())
f, err = os.Create("./model/pdata/generated_" + fp.Name + "_alias.go")
check(err)
_, err = f.WriteString(fp.GenerateAliasFile())
_, err = f.WriteString(fp.GenerateAliasFile("pdata"))
check(err)
check(f.Close())
if !fp.IsCommon() {
f, err = os.Create("./model/pdata/" + fp.Name + "/generated_" + fp.Name + "_alias.go")
check(err)
_, err = f.WriteString(fp.GenerateAliasFile(fp.Name))
check(err)
check(f.Close())
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions model/pdata/logs/generated_logs_alias.go

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

65 changes: 65 additions & 0 deletions model/pdata/logs/log_alias.go
Original file line number Diff line number Diff line change
@@ -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 logs // import "go.opentelemetry.io/collector/model/pdata/logs"

// This file contains aliases for logs data structures.

import "go.opentelemetry.io/collector/model/internal/pdata"

// Marshaler is an alias for pdata.LogsMarshaler interface.
type Marshaler = pdata.LogsMarshaler

// Unmarshaler is an alias for pdata.LogsUnmarshaler interface.
type Unmarshaler = pdata.LogsUnmarshaler

// Sizer is an alias for pdata.LogsSizer interface.
type Sizer = 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 New = 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
)
164 changes: 164 additions & 0 deletions model/pdata/metrics/generated_metrics_alias.go

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

Loading

0 comments on commit 971a734

Please sign in to comment.