Skip to content

Commit

Permalink
Rename opentelemetry-proto-gen package to protogen (#2344)
Browse files Browse the repository at this point in the history
Remove hyphens sice the idiomatic style is to not have word delimiters
at all, or have `_` as an exception.

Remove `opentelemetry-` prefix since the package is within otlp already and
there a no types in that package directly i.e. alias is not a problem.
  • Loading branch information
ozerovandrei authored Jan 8, 2021
1 parent d79843a commit 953bf83
Show file tree
Hide file tree
Showing 88 changed files with 132 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ coverage:

ignore:
- "**/*/metadata/generated_metrics.go"
- "internal/data/opentelemetry-proto-gen/**/*"
- "internal/data/protogen/**/*"
- "testbed/**/*"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ALL_SRC := $(shell find . -name '*.go' \
-not -path './cmd/schemagen/*' \
-not -path './internal/tools/*' \
-not -path './examples/demo/app/*' \
-not -path './internal/data/opentelemetry-proto-gen/*' \
-not -path './internal/data/protogen/*' \
-type f | sort)

# ALL_PKGS is the list of all packages where ALL_SRC files reside.
Expand Down Expand Up @@ -226,7 +226,7 @@ OPENTELEMETRY_PROTO_SRC_DIR=internal/data/opentelemetry-proto
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto))

# Target directory to write generated files to.
PROTO_TARGET_GEN_DIR=internal/data/opentelemetry-proto-gen
PROTO_TARGET_GEN_DIR=internal/data/protogen

# Go package name to use for generated files.
PROTO_PACKAGE=go.opentelemetry.io/collector/$(PROTO_TARGET_GEN_DIR)
Expand Down
4 changes: 2 additions & 2 deletions cmd/pdatagen/internal/common_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ package internal
var commonFile = &File{
Name: "common",
imports: []string{
`otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1"`,
`otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1"`,
},
testImports: []string{
`"testing"`,
``,
`"github.com/stretchr/testify/assert"`,
``,
`otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1"`,
`otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1"`,
},
structs: []baseStruct{
instrumentationLibrary,
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 @@ -17,15 +17,15 @@ package internal
var logFile = &File{
Name: "log",
imports: []string{
`otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1"`,
`otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1"`,
`otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1"`,
`otlplogs "go.opentelemetry.io/collector/internal/data/protogen/logs/v1"`,
},
testImports: []string{
`"testing"`,
``,
`"github.com/stretchr/testify/assert"`,
``,
`otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1"`,
`otlplogs "go.opentelemetry.io/collector/internal/data/protogen/logs/v1"`,
},
structs: []baseStruct{
resourceLogsSlice,
Expand Down
4 changes: 2 additions & 2 deletions cmd/pdatagen/internal/metrics_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ package internal
var metricsFile = &File{
Name: "metrics",
imports: []string{
`otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1"`,
`otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1"`,
},
testImports: []string{
`"testing"`,
``,
`"github.com/stretchr/testify/assert"`,
``,
`otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1"`,
`otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1"`,
},
structs: []baseStruct{
resourceMetricsSlice,
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdatagen/internal/resource_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package internal
var resourceFile = &File{
Name: "resource",
imports: []string{
`otlpresource "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1"`,
`otlpresource "go.opentelemetry.io/collector/internal/data/protogen/resource/v1"`,
},
testImports: []string{
`"testing"`,
Expand Down
6 changes: 3 additions & 3 deletions cmd/pdatagen/internal/trace_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ var traceFile = &File{
Name: "trace",
imports: []string{
`"go.opentelemetry.io/collector/internal/data"`,
`otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1"`,
`otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1"`,
`otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1"`,
`otlptrace "go.opentelemetry.io/collector/internal/data/protogen/trace/v1"`,
},
testImports: []string{
`"testing"`,
``,
`"github.com/stretchr/testify/assert"`,
``,
`otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1"`,
`otlptrace "go.opentelemetry.io/collector/internal/data/protogen/trace/v1"`,
},
structs: []baseStruct{
resourceSpansSlice,
Expand Down
2 changes: 1 addition & 1 deletion config/configgrpc/configgrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"go.opentelemetry.io/collector/config/configauth"
"go.opentelemetry.io/collector/config/confignet"
"go.opentelemetry.io/collector/config/configtls"
otelcol "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1"
otelcol "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1"
"go.opentelemetry.io/collector/testutil"
)

Expand Down
2 changes: 1 addition & 1 deletion consumer/pdata/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sort"
"time"

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

// TimestampUnixNano is a time specified as UNIX Epoch time in nanoseconds since
Expand Down
2 changes: 1 addition & 1 deletion consumer/pdata/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

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

func TestAttributeValue(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion consumer/pdata/generated_common.go

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

2 changes: 1 addition & 1 deletion consumer/pdata/generated_common_test.go

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

2 changes: 1 addition & 1 deletion consumer/pdata/generated_log.go

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

2 changes: 1 addition & 1 deletion consumer/pdata/generated_log_test.go

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

2 changes: 1 addition & 1 deletion consumer/pdata/generated_metrics.go

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

2 changes: 1 addition & 1 deletion consumer/pdata/generated_metrics_test.go

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

2 changes: 1 addition & 1 deletion consumer/pdata/generated_resource.go

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

2 changes: 1 addition & 1 deletion consumer/pdata/generated_trace.go

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

2 changes: 1 addition & 1 deletion consumer/pdata/generated_trace_test.go

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

4 changes: 2 additions & 2 deletions consumer/pdata/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package pdata

import (
"go.opentelemetry.io/collector/internal"
otlpcollectorlog "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1"
otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1"
otlpcollectorlog "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1"
otlplogs "go.opentelemetry.io/collector/internal/data/protogen/logs/v1"
)

// This file defines in-memory data structures to represent logs.
Expand Down
2 changes: 1 addition & 1 deletion consumer/pdata/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/require"

"go.opentelemetry.io/collector/internal"
otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1"
otlplogs "go.opentelemetry.io/collector/internal/data/protogen/logs/v1"
)

func TestLogRecordCount(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions consumer/pdata/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package pdata

import (
otlpcollectormetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1"
otlpcollectormetrics "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1"
)

type AggregationTemporality otlpmetrics.AggregationTemporality
Expand Down
6 changes: 3 additions & 3 deletions consumer/pdata/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
goproto "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"

otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1"
otlpresource "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1"
otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1"
otlpresource "go.opentelemetry.io/collector/internal/data/protogen/resource/v1"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions consumer/pdata/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package pdata

import (
otlpcollectortrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1"
otlpcollectortrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/protogen/trace/v1"
)

// This file defines in-memory data structures to represent traces (spans).
Expand Down
2 changes: 1 addition & 1 deletion consumer/pdata/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
goproto "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"

otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/protogen/trace/v1"
)

func TestSpanCount(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions exporter/fileexporter/file_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/internal"
otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1"
otlplogs "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1"
)

// Marshaler configuration used for marhsaling Protobuf to JSON. Use default config.
Expand Down
12 changes: 6 additions & 6 deletions exporter/fileexporter/file_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (

"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/internal"
collectorlogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1"
collectormetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1"
collectortrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1"
otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1"
logspb "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1"
otresourcepb "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1"
collectorlogs "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1"
collectormetrics "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1"
collectortrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1"
otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1"
logspb "go.opentelemetry.io/collector/internal/data/protogen/logs/v1"
otresourcepb "go.opentelemetry.io/collector/internal/data/protogen/resource/v1"
"go.opentelemetry.io/collector/internal/testdata"
"go.opentelemetry.io/collector/testutil"
)
Expand Down
2 changes: 1 addition & 1 deletion exporter/jaegerexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/internal/data"
tracev1 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1"
tracev1 "go.opentelemetry.io/collector/internal/data/protogen/trace/v1"
"go.opentelemetry.io/collector/internal/testdata"
)

Expand Down
4 changes: 2 additions & 2 deletions exporter/kafkaexporter/otlp_marshaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package kafkaexporter

import (
"go.opentelemetry.io/collector/consumer/pdata"
otlpmetric "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1"
otlpmetric "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1"
)

var _ TracesMarshaller = (*otlpTracesPbMarshaller)(nil)
Expand Down
4 changes: 2 additions & 2 deletions exporter/kafkaexporter/otlp_marshaller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"github.com/stretchr/testify/require"

"go.opentelemetry.io/collector/consumer/pdata"
otlpmetric "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1"
otlpmetric "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1"
"go.opentelemetry.io/collector/internal/testdata"
)

Expand Down
6 changes: 3 additions & 3 deletions exporter/otlpexporter/otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/exporter/exporterhelper"
"go.opentelemetry.io/collector/internal"
otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1"
otlplogs "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1"
otlptrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1"
)

type exporterImp struct {
Expand Down
6 changes: 3 additions & 3 deletions exporter/otlpexporter/otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import (
"go.opentelemetry.io/collector/config/configgrpc"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/consumer/pdata"
otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1"
otlptraces "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1"
otlplogs "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1"
otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1"
otlptraces "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1"
"go.opentelemetry.io/collector/internal/testdata"
"go.opentelemetry.io/collector/obsreport"
"go.opentelemetry.io/collector/testutil"
Expand Down
2 changes: 1 addition & 1 deletion exporter/prometheusremotewriteexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"go.opentelemetry.io/collector/component/componenterror"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/consumer/pdata"
otlp "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1"
otlp "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1"
"go.opentelemetry.io/collector/internal/version"
)

Expand Down
2 changes: 1 addition & 1 deletion exporter/prometheusremotewriteexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"go.opentelemetry.io/collector/config/configmodels"
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/exporter/exporterhelper"
otlp "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1"
otlp "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1"
"go.opentelemetry.io/collector/internal/testdata"
"go.opentelemetry.io/collector/internal/version"
)
Expand Down
4 changes: 2 additions & 2 deletions exporter/prometheusremotewriteexporter/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"github.com/prometheus/prometheus/prompb"

"go.opentelemetry.io/collector/consumer/pdata"
common "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1"
otlp "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1"
common "go.opentelemetry.io/collector/internal/data/protogen/common/v1"
otlp "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1"
)

const (
Expand Down
Loading

0 comments on commit 953bf83

Please sign in to comment.