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 <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed Jun 2, 2021
1 parent 1f7ffab commit 9e7056e
Show file tree
Hide file tree
Showing 17 changed files with 7 additions and 6 deletions.
File renamed without changes.
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 9e7056e

Please sign in to comment.