These tests use the OpenTelemetry Collector Exporters to validate the different protocols
(t *testing.T)
| 37 | |
| 38 | // These tests use the OpenTelemetry Collector Exporters to validate the different protocols |
| 39 | func TestShim_integration(t *testing.T) { |
| 40 | randomTraces := testdata.GenerateTraces(5) |
| 41 | var headers configopaque.MapList |
| 42 | headers.Set(generator.NoGenerateMetricsContextKey, "true") |
| 43 | |
| 44 | testCases := []struct { |
| 45 | name string |
| 46 | receiverCfg map[string]interface{} |
| 47 | factory exporter.Factory |
| 48 | exporterCfg component.Config |
| 49 | expectedTransport string |
| 50 | }{ |
| 51 | { |
| 52 | name: "otlpexporter", |
| 53 | receiverCfg: map[string]interface{}{ |
| 54 | "otlp": map[string]interface{}{ |
| 55 | "protocols": map[string]interface{}{ |
| 56 | "grpc": nil, |
| 57 | }, |
| 58 | }, |
| 59 | }, |
| 60 | factory: otlpexporter.NewFactory(), |
| 61 | exporterCfg: &otlpexporter.Config{ |
| 62 | ClientConfig: configgrpc.ClientConfig{ |
| 63 | Endpoint: "127.0.0.1:4317", |
| 64 | TLS: configtls.ClientConfig{ |
| 65 | Insecure: true, |
| 66 | }, |
| 67 | Headers: headers, |
| 68 | }, |
| 69 | }, |
| 70 | expectedTransport: "grpc", |
| 71 | }, |
| 72 | { |
| 73 | name: "otlphttpexporter - JSON encoding", |
| 74 | receiverCfg: map[string]interface{}{ |
| 75 | "otlp": map[string]interface{}{ |
| 76 | "protocols": map[string]interface{}{ |
| 77 | "http": nil, |
| 78 | }, |
| 79 | }, |
| 80 | }, |
| 81 | factory: otlphttpexporter.NewFactory(), |
| 82 | exporterCfg: &otlphttpexporter.Config{ |
| 83 | ClientConfig: confighttp.ClientConfig{ |
| 84 | Endpoint: "http://127.0.0.1:4318", |
| 85 | Headers: headers, |
| 86 | }, |
| 87 | Encoding: otlphttpexporter.EncodingJSON, |
| 88 | }, |
| 89 | expectedTransport: "http", |
| 90 | }, |
| 91 | { |
| 92 | name: "otlphttpexporter - proto encoding", |
| 93 | receiverCfg: map[string]interface{}{ |
| 94 | "otlp": map[string]interface{}{ |
| 95 | "protocols": map[string]interface{}{ |
| 96 | "http": nil, |
nothing calls this directly
no test coverage detected