Skip to content

Commit

Permalink
Avoid exposing internal implementation public in OC/OTEL receivers
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Jun 3, 2021
1 parent 9e240bc commit e6a108e
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 8 deletions.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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

0 comments on commit e6a108e

Please sign in to comment.