mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-11-03 02:20:04 +00:00
- Go module: github.com/SigNoz/signoz-otel-collector → github.com/hanzoai/otel-collector - All signoz-prefixed packages → o11y-prefixed - Docker: signoz/* → ghcr.io/hanzoai/otel-collector - ClickHouse exporter → Hanzo Datastore - Env vars: SIGNOZ_* → HANZO_* - Directory renames for all processor/receiver/exporter packages
64 lines
1.3 KiB
Go
64 lines
1.3 KiB
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package o11ykafkareceiver
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestDefaultTracesUnMarshaler(t *testing.T) {
|
|
expectedEncodings := []string{
|
|
"otlp_proto",
|
|
"jaeger_proto",
|
|
"jaeger_json",
|
|
"zipkin_proto",
|
|
"zipkin_json",
|
|
"zipkin_thrift",
|
|
}
|
|
marshalers := defaultTracesUnmarshalers()
|
|
assert.Equal(t, len(expectedEncodings), len(marshalers))
|
|
for _, e := range expectedEncodings {
|
|
t.Run(e, func(t *testing.T) {
|
|
m, ok := marshalers[e]
|
|
require.True(t, ok)
|
|
assert.NotNil(t, m)
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestDefaultMetricsUnMarshaler(t *testing.T) {
|
|
expectedEncodings := []string{
|
|
"otlp_proto",
|
|
}
|
|
marshalers := defaultMetricsUnmarshalers()
|
|
assert.Equal(t, len(expectedEncodings), len(marshalers))
|
|
for _, e := range expectedEncodings {
|
|
t.Run(e, func(t *testing.T) {
|
|
m, ok := marshalers[e]
|
|
require.True(t, ok)
|
|
assert.NotNil(t, m)
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestDefaultLogsUnMarshaler(t *testing.T) {
|
|
expectedEncodings := []string{
|
|
"otlp_proto",
|
|
"raw",
|
|
"text",
|
|
}
|
|
marshalers := defaultLogsUnmarshalers()
|
|
assert.Equal(t, len(expectedEncodings), len(marshalers))
|
|
for _, e := range expectedEncodings {
|
|
t.Run(e, func(t *testing.T) {
|
|
m, ok := marshalers[e]
|
|
require.True(t, ok)
|
|
assert.NotNil(t, m)
|
|
})
|
|
}
|
|
}
|