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

Avoid exposing internal implementation public in OC/OTEL receivers #3355

Merged
merged 1 commit into from
Jun 3, 2021
Merged
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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ issues:
linters:
# See https://github.com/golangci/golangci-lint/issues/537#issuecomment-545170007
- structcheck
- path: receiver/otlpreceiver/marshal_jsonpb\.go
- path: receiver/otlpreceiver/internal/marshal_jsonpb\.go
linters:
- gocritic
- gosimple
Expand Down
4 changes: 2 additions & 2 deletions receiver/opencensusreceiver/opencensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
"go.opentelemetry.io/collector/config"
"go.opentelemetry.io/collector/config/configgrpc"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/receiver/opencensusreceiver/ocmetrics"
"go.opentelemetry.io/collector/receiver/opencensusreceiver/octrace"
"go.opentelemetry.io/collector/receiver/opencensusreceiver/internal/ocmetrics"
"go.opentelemetry.io/collector/receiver/opencensusreceiver/internal/octrace"
)

// ocReceiver is the type that exposes Trace and Metrics reception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package otlpreceiver
package internal

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package otlpreceiver
package internal

import (
"testing"
Expand Down
9 changes: 5 additions & 4 deletions receiver/otlpreceiver/otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ import (
collectorlog "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"
"go.opentelemetry.io/collector/receiver/otlpreceiver/logs"
"go.opentelemetry.io/collector/receiver/otlpreceiver/metrics"
"go.opentelemetry.io/collector/receiver/otlpreceiver/trace"
"go.opentelemetry.io/collector/receiver/otlpreceiver/internal"
"go.opentelemetry.io/collector/receiver/otlpreceiver/internal/logs"
"go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metrics"
"go.opentelemetry.io/collector/receiver/otlpreceiver/internal/trace"
)

// otlpReceiver is the type that exposes Trace and Metrics reception.
Expand Down Expand Up @@ -64,7 +65,7 @@ func newOtlpReceiver(cfg *Config, logger *zap.Logger) *otlpReceiver {
// Use our custom JSON marshaler instead of default Protobuf JSON marshaler.
// This is needed because OTLP spec defines encoding for trace and span id
// and it is only possible to do using Gogoproto-compatible JSONPb marshaler.
jsonpb := &JSONPb{
jsonpb := &internal.JSONPb{
EmitDefaults: true,
Indent: " ",
OrigName: true,
Expand Down