-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate Export[Logs|Metrics|Traces]PartialSuccess, plugin into the R…
…esponse Signed-off-by: Bogdan <[email protected]>
- Loading branch information
1 parent
79d5c62
commit aeb4102
Showing
32 changed files
with
911 additions
and
157 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// 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 internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" | ||
import ( | ||
"path/filepath" | ||
) | ||
|
||
var logOtlpFile = &File{ | ||
Path: filepath.Join("pdata", "plog"), | ||
Name: "logs_otlp", | ||
PackageName: "plogotlp", | ||
imports: []string{ | ||
`"sort"`, | ||
``, | ||
`"go.opentelemetry.io/collector/pdata/internal"`, | ||
`otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1"`, | ||
}, | ||
testImports: []string{ | ||
`"testing"`, | ||
``, | ||
`"github.com/stretchr/testify/assert"`, | ||
``, | ||
`"go.opentelemetry.io/collector/pdata/internal"`, | ||
`otlpcollectorlog "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1"`, | ||
}, | ||
structs: []baseStruct{ | ||
exportLogsPartialSuccess, | ||
}, | ||
} | ||
|
||
var exportLogsPartialSuccess = &messageValueStruct{ | ||
structName: "ExportLogsPartialSuccess", | ||
description: "// ExportLogsPartialSuccess represents the details of a partially successful export request.", | ||
originFullName: "otlpcollectorlog.ExportLogsPartialSuccess", | ||
fields: []baseField{ | ||
&primitiveField{ | ||
fieldName: "RejectedLogRecords", | ||
returnType: "int64", | ||
defaultVal: `int64(0)`, | ||
testVal: `int64(13)`, | ||
}, | ||
&primitiveField{ | ||
fieldName: "ErrorMessage", | ||
returnType: "string", | ||
defaultVal: `""`, | ||
testVal: `"error message"`, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
pdata/internal/cmd/pdatagen/internal/pmetricotlp_structs.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" | ||
|
||
import ( | ||
"path/filepath" | ||
) | ||
|
||
var metricsOtlpFile = &File{ | ||
Path: filepath.Join("pdata", "pmetric"), | ||
Name: "metrics_otlp", | ||
PackageName: "pmetricotlp", | ||
imports: []string{ | ||
`"sort"`, | ||
``, | ||
`"go.opentelemetry.io/collector/pdata/internal"`, | ||
`otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1"`, | ||
}, | ||
testImports: []string{ | ||
`"testing"`, | ||
``, | ||
`"github.com/stretchr/testify/assert"`, | ||
``, | ||
`"go.opentelemetry.io/collector/pdata/internal"`, | ||
`otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1"`, | ||
}, | ||
structs: []baseStruct{ | ||
exportMetricsPartialSuccess, | ||
}, | ||
} | ||
|
||
var exportMetricsPartialSuccess = &messageValueStruct{ | ||
structName: "ExportMetricsPartialSuccess", | ||
description: "// ExportMetricsPartialSuccess represents the details of a partially successful export request.", | ||
originFullName: "otlpcollectormetrics.ExportMetricsPartialSuccess", | ||
fields: []baseField{ | ||
&primitiveField{ | ||
fieldName: "RejectedDataPoints", | ||
returnType: "int64", | ||
defaultVal: `int64(0)`, | ||
testVal: `int64(13)`, | ||
}, | ||
&primitiveField{ | ||
fieldName: "ErrorMessage", | ||
returnType: "string", | ||
defaultVal: `""`, | ||
testVal: `"error message"`, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
pdata/internal/cmd/pdatagen/internal/ptraceotlp_structs.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 internal // import "go.opentelemetry.io/collector/pdata/internal/cmd/pdatagen/internal" | ||
|
||
import ( | ||
"path/filepath" | ||
) | ||
|
||
var traceOtlpFile = &File{ | ||
Path: filepath.Join("pdata", "ptrace"), | ||
Name: "traces_otlp", | ||
PackageName: "ptraceotlp", | ||
imports: []string{ | ||
`"sort"`, | ||
``, | ||
`"go.opentelemetry.io/collector/pdata/internal"`, | ||
`otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1"`, | ||
}, | ||
testImports: []string{ | ||
`"testing"`, | ||
``, | ||
`"github.com/stretchr/testify/assert"`, | ||
``, | ||
`"go.opentelemetry.io/collector/pdata/internal"`, | ||
`otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1"`, | ||
}, | ||
structs: []baseStruct{ | ||
exportTracePartialSuccess, | ||
}, | ||
} | ||
|
||
var exportTracePartialSuccess = &messageValueStruct{ | ||
structName: "ExportTracePartialSuccess", | ||
description: "// ExportTracePartialSuccess represents the details of a partially successful export request.", | ||
originFullName: "otlpcollectortrace.ExportTracePartialSuccess", | ||
fields: []baseField{ | ||
&primitiveField{ | ||
fieldName: "RejectedSpans", | ||
returnType: "int64", | ||
defaultVal: `int64(0)`, | ||
testVal: `int64(13)`, | ||
}, | ||
&primitiveField{ | ||
fieldName: "ErrorMessage", | ||
returnType: "string", | ||
defaultVal: `""`, | ||
testVal: `"error message"`, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.