diff --git a/.chloggen/otlp-receiver-add-http-signal-url-paths.yaml b/.chloggen/otlp-receiver-add-http-signal-url-paths.yaml new file mode 100755 index 00000000000..69040836138 --- /dev/null +++ b/.chloggen/otlp-receiver-add-http-signal-url-paths.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: otlpreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add http url paths per signal config options to otlpreceiver + +# One or more tracking issues or pull requests related to the change +issues: [7511] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/receiver/otlpreceiver/README.md b/receiver/otlpreceiver/README.md index 6ea9b674714..54cb9f81efd 100644 --- a/receiver/otlpreceiver/README.md +++ b/receiver/otlpreceiver/README.md @@ -45,9 +45,15 @@ The OTLP receiver can receive trace export calls via HTTP/JSON in addition to gRPC. The HTTP/JSON address is the same as gRPC as the protocol is recognized and processed accordingly. Note the serialization format needs to be [protobuf JSON](https://developers.google.com/protocol-buffers/docs/proto3#json). -To write traces with HTTP/JSON, `POST` to `[address]/v1/traces` for traces, -to `[address]/v1/metrics` for metrics, to `[address]/v1/logs` for logs. The default -port is `4318`. +The HTTP/JSON configuration also provides `traces_url_path`, `metrics_url_path`, and `logs_url_path` +configuration to allow the URL paths that signal data needs to be sent to be modified per signal type. These default to +`/v1/traces`, `/v1/metrics`, and `/v1/logs` respectively. + +To write traces with HTTP/JSON, `POST` to `[address]/[traces_url_path]` for traces, +to `[address]/[metrics_url_path]` for metrics, to `[address]/[logs_url_path]` for logs. +The default port is `4318`. When using the `otlphttpexporter` peer to communicate with this component, +use the `traces_endpoint`, `metrics_endpoint`, and `logs_endpoint` settings in the `otlphttpexporter` to set the +proper URL to match the address and URL signal path on the `otlpreceiver`. ### CORS (Cross-origin resource sharing) diff --git a/receiver/otlpreceiver/config.go b/receiver/otlpreceiver/config.go index a9c99138a23..8cc3e301fd8 100644 --- a/receiver/otlpreceiver/config.go +++ b/receiver/otlpreceiver/config.go @@ -5,6 +5,9 @@ package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlprecei import ( "errors" + "fmt" + "net/url" + "path" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configgrpc" @@ -18,10 +21,23 @@ const ( protoHTTP = "protocols::http" ) +type httpServerSettings struct { + *confighttp.HTTPServerSettings `mapstructure:",squash"` + + // The URL path to receive traces on. If omitted "/v1/traces" will be used. + TracesURLPath string `mapstructure:"traces_url_path,omitempty"` + + // The URL path to receive metrics on. If omitted "/v1/metrics" will be used. + MetricsURLPath string `mapstructure:"metrics_url_path,omitempty"` + + // The URL path to receive logs on. If omitted "/v1/logs" will be used. + LogsURLPath string `mapstructure:"logs_url_path,omitempty"` +} + // Protocols is the configuration for the supported protocols. type Protocols struct { GRPC *configgrpc.GRPCServerSettings `mapstructure:"grpc"` - HTTP *confighttp.HTTPServerSettings `mapstructure:"http"` + HTTP *httpServerSettings `mapstructure:"http"` } // Config defines configuration for OTLP receiver. @@ -55,7 +71,32 @@ func (cfg *Config) Unmarshal(conf *confmap.Conf) error { if !conf.IsSet(protoHTTP) { cfg.HTTP = nil + } else { + var err error + + if cfg.HTTP.TracesURLPath, err = sanitizeURLPath(cfg.HTTP.TracesURLPath); err != nil { + return err + } + if cfg.HTTP.MetricsURLPath, err = sanitizeURLPath(cfg.HTTP.MetricsURLPath); err != nil { + return err + } + if cfg.HTTP.LogsURLPath, err = sanitizeURLPath(cfg.HTTP.LogsURLPath); err != nil { + return err + } } return nil } + +// Verify signal URL path sanity +func sanitizeURLPath(urlPath string) (string, error) { + u, err := url.Parse(urlPath) + if err != nil { + return "", fmt.Errorf("invalid HTTP URL path set for signal: %w", err) + } + + if !path.IsAbs(u.Path) { + u.Path = "/" + u.Path + } + return u.Path, nil +} diff --git a/receiver/otlpreceiver/config_test.go b/receiver/otlpreceiver/config_test.go index 4c2e384619b..927f52d4805 100644 --- a/receiver/otlpreceiver/config_test.go +++ b/receiver/otlpreceiver/config_test.go @@ -115,18 +115,23 @@ func TestUnmarshalConfig(t *testing.T) { }, }, }, - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: "0.0.0.0:4318", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ - CertFile: "test.crt", - KeyFile: "test.key", + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: "0.0.0.0:4318", + TLSSetting: &configtls.TLSServerSetting{ + TLSSetting: configtls.TLSSetting{ + CertFile: "test.crt", + KeyFile: "test.key", + }, + }, + CORS: &confighttp.CORSSettings{ + AllowedOrigins: []string{"https://*.test.com", "https://test.com"}, + MaxAge: 7200, }, }, - CORS: &confighttp.CORSSettings{ - AllowedOrigins: []string{"https://*.test.com", "https://test.com"}, - MaxAge: 7200, - }, + TracesURLPath: "/traces", + MetricsURLPath: "/v2/metrics", + LogsURLPath: "/log/ingest", }, }, }, cfg) @@ -149,9 +154,13 @@ func TestUnmarshalConfigUnix(t *testing.T) { }, ReadBufferSize: 512 * 1024, }, - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: "/tmp/http_otlp.sock", - // Transport: "unix", + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: "/tmp/http_otlp.sock", + }, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, }, }, }, cfg) @@ -182,6 +191,36 @@ func TestUnmarshalConfigEmptyProtocols(t *testing.T) { assert.EqualError(t, component.ValidateConfig(cfg), "must specify at least one protocol when using the OTLP receiver") } +func TestUnmarshalConfigInvalidSignalPath(t *testing.T) { + tests := []struct { + name string + testDataFn string + }{ + { + name: "Invalid traces URL path", + testDataFn: "invalid_traces_path.yaml", + }, + { + name: "Invalid metrics URL path", + testDataFn: "invalid_metrics_path.yaml", + }, + { + name: "Invalid logs URL path", + testDataFn: "invalid_logs_path.yaml", + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", test.testDataFn)) + require.NoError(t, err) + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.EqualError(t, component.UnmarshalConfig(cm, cfg), "invalid HTTP URL path set for signal: parse \":invalid\": missing protocol scheme") + }) + } +} + func TestUnmarshalConfigEmpty(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() diff --git a/receiver/otlpreceiver/factory.go b/receiver/otlpreceiver/factory.go index b9c3884002a..72eb6988bb1 100644 --- a/receiver/otlpreceiver/factory.go +++ b/receiver/otlpreceiver/factory.go @@ -20,6 +20,10 @@ const ( defaultGRPCEndpoint = "0.0.0.0:4317" defaultHTTPEndpoint = "0.0.0.0:4318" + + defaultTracesURLPath = "/v1/traces" + defaultMetricsURLPath = "/v1/metrics" + defaultLogsURLPath = "/v1/logs" ) // NewFactory creates a new OTLP receiver factory. @@ -44,8 +48,13 @@ func createDefaultConfig() component.Config { // We almost write 0 bytes, so no need to tune WriteBufferSize. ReadBufferSize: 512 * 1024, }, - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: defaultHTTPEndpoint, + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: defaultHTTPEndpoint, + }, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, }, }, } diff --git a/receiver/otlpreceiver/factory_test.go b/receiver/otlpreceiver/factory_test.go index 1a235092ea7..fc5f7deb802 100644 --- a/receiver/otlpreceiver/factory_test.go +++ b/receiver/otlpreceiver/factory_test.go @@ -51,8 +51,13 @@ func TestCreateTracesReceiver(t *testing.T) { Transport: "tcp", }, } - defaultHTTPSettings := &confighttp.HTTPServerSettings{ - Endpoint: testutil.GetAvailableLocalAddress(t), + defaultHTTPSettings := &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: testutil.GetAvailableLocalAddress(t), + }, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, } tests := []struct { @@ -89,8 +94,11 @@ func TestCreateTracesReceiver(t *testing.T) { cfg: &Config{ Protocols: Protocols{ GRPC: defaultGRPCSettings, - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: "localhost:112233", + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: "localhost:112233", + }, + TracesURLPath: defaultTracesURLPath, }, }, }, @@ -124,8 +132,13 @@ func TestCreateMetricReceiver(t *testing.T) { Transport: "tcp", }, } - defaultHTTPSettings := &confighttp.HTTPServerSettings{ - Endpoint: testutil.GetAvailableLocalAddress(t), + defaultHTTPSettings := &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: testutil.GetAvailableLocalAddress(t), + }, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, } tests := []struct { @@ -162,8 +175,11 @@ func TestCreateMetricReceiver(t *testing.T) { cfg: &Config{ Protocols: Protocols{ GRPC: defaultGRPCSettings, - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: "327.0.0.1:1122", + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: "327.0.0.1:1122", + }, + MetricsURLPath: defaultMetricsURLPath, }, }, }, @@ -196,8 +212,13 @@ func TestCreateLogReceiver(t *testing.T) { Transport: "tcp", }, } - defaultHTTPSettings := &confighttp.HTTPServerSettings{ - Endpoint: testutil.GetAvailableLocalAddress(t), + defaultHTTPSettings := &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: testutil.GetAvailableLocalAddress(t), + }, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, } tests := []struct { @@ -238,8 +259,11 @@ func TestCreateLogReceiver(t *testing.T) { cfg: &Config{ Protocols: Protocols{ GRPC: defaultGRPCSettings, - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: "327.0.0.1:1122", + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: "327.0.0.1:1122", + }, + LogsURLPath: defaultLogsURLPath, }, }, }, @@ -251,8 +275,10 @@ func TestCreateLogReceiver(t *testing.T) { cfg: &Config{ Protocols: Protocols{ GRPC: defaultGRPCSettings, - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: "327.0.0.1:1122", + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: "127.0.0.1:1122", + }, }, }, }, diff --git a/receiver/otlpreceiver/otlp.go b/receiver/otlpreceiver/otlp.go index 71d48e39d8e..bc00c34413e 100644 --- a/receiver/otlpreceiver/otlp.go +++ b/receiver/otlpreceiver/otlp.go @@ -151,7 +151,7 @@ func (r *otlpReceiver) startProtocolServers(host component.Host) error { return err } - err = r.startHTTPServer(r.cfg.HTTP, host) + err = r.startHTTPServer(r.cfg.HTTP.HTTPServerSettings, host) if err != nil { return err } @@ -189,7 +189,7 @@ func (r *otlpReceiver) registerTraceConsumer(tc consumer.Traces) error { r.tracesReceiver = trace.New(tc, r.obsrepGRPC) httpTracesReceiver := trace.New(tc, r.obsrepHTTP) if r.httpMux != nil { - r.httpMux.HandleFunc("/v1/traces", func(resp http.ResponseWriter, req *http.Request) { + r.httpMux.HandleFunc(r.cfg.HTTP.TracesURLPath, func(resp http.ResponseWriter, req *http.Request) { if req.Method != http.MethodPost { handleUnmatchedMethod(resp) return @@ -214,7 +214,7 @@ func (r *otlpReceiver) registerMetricsConsumer(mc consumer.Metrics) error { r.metricsReceiver = metrics.New(mc, r.obsrepGRPC) httpMetricsReceiver := metrics.New(mc, r.obsrepHTTP) if r.httpMux != nil { - r.httpMux.HandleFunc("/v1/metrics", func(resp http.ResponseWriter, req *http.Request) { + r.httpMux.HandleFunc(r.cfg.HTTP.MetricsURLPath, func(resp http.ResponseWriter, req *http.Request) { if req.Method != http.MethodPost { handleUnmatchedMethod(resp) return @@ -239,7 +239,7 @@ func (r *otlpReceiver) registerLogsConsumer(lc consumer.Logs) error { r.logsReceiver = logs.New(lc, r.obsrepGRPC) httpLogsReceiver := logs.New(lc, r.obsrepHTTP) if r.httpMux != nil { - r.httpMux.HandleFunc("/v1/logs", func(resp http.ResponseWriter, req *http.Request) { + r.httpMux.HandleFunc(r.cfg.HTTP.LogsURLPath, func(resp http.ResponseWriter, req *http.Request) { if req.Method != http.MethodPost { handleUnmatchedMethod(resp) return diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 99f4c9ae720..a42d382c9a1 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -173,10 +173,13 @@ func TestJsonHttp(t *testing.T) { }, } addr := testutil.GetAvailableLocalAddress(t) + tracesURLPath := "/v1/traceingest" + metricsURLPath := "/v1/metricingest" + logsURLPath := "/v1/logingest" // Set the buffer count to 1 to make it flush the test span immediately. sink := &errOrSinkConsumer{TracesSink: new(consumertest.TracesSink)} - ocr := newHTTPReceiver(t, addr, sink, nil) + ocr := newHTTPReceiver(t, addr, tracesURLPath, metricsURLPath, logsURLPath, sink, nil) require.NoError(t, ocr.Start(context.Background(), componenttest.NewNopHost()), "Failed to start trace receiver") t.Cleanup(func() { require.NoError(t, ocr.Shutdown(context.Background())) }) @@ -187,7 +190,7 @@ func TestJsonHttp(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - url := fmt.Sprintf("http://%s/v1/traces", addr) + url := fmt.Sprintf("http://%s%s", addr, tracesURLPath) sink.Reset() testHTTPJSONRequest(t, url, sink, test.encoding, test.contentType, test.err) }) @@ -197,7 +200,16 @@ func TestJsonHttp(t *testing.T) { func TestHandleInvalidRequests(t *testing.T) { endpoint := testutil.GetAvailableLocalAddress(t) cfg := &Config{ - Protocols: Protocols{HTTP: &confighttp.HTTPServerSettings{Endpoint: endpoint}}, + Protocols: Protocols{ + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: endpoint, + }, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, + }, + }, } // Traces @@ -457,7 +469,7 @@ func TestProtoHttp(t *testing.T) { // Set the buffer count to 1 to make it flush the test span immediately. tSink := &errOrSinkConsumer{TracesSink: new(consumertest.TracesSink)} - ocr := newHTTPReceiver(t, addr, tSink, consumertest.NewNop()) + ocr := newHTTPReceiver(t, addr, defaultTracesURLPath, defaultMetricsURLPath, defaultLogsURLPath, tSink, consumertest.NewNop()) require.NoError(t, ocr.Start(context.Background(), componenttest.NewNopHost()), "Failed to start trace receiver") t.Cleanup(func() { require.NoError(t, ocr.Shutdown(context.Background())) }) @@ -473,7 +485,7 @@ func TestProtoHttp(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - url := fmt.Sprintf("http://%s/v1/traces", addr) + url := fmt.Sprintf("http://%s%s", addr, defaultTracesURLPath) tSink.Reset() testHTTPProtobufRequest(t, url, tSink, test.encoding, traceBytes, test.err, td) }) @@ -605,12 +617,12 @@ func TestOTLPReceiverInvalidContentEncoding(t *testing.T) { // Set the buffer count to 1 to make it flush the test span immediately. tSink := new(consumertest.TracesSink) mSink := new(consumertest.MetricsSink) - ocr := newHTTPReceiver(t, addr, tSink, mSink) + ocr := newHTTPReceiver(t, addr, defaultTracesURLPath, defaultMetricsURLPath, defaultLogsURLPath, tSink, mSink) require.NoError(t, ocr.Start(context.Background(), componenttest.NewNopHost()), "Failed to start trace receiver") t.Cleanup(func() { require.NoError(t, ocr.Shutdown(context.Background())) }) - url := fmt.Sprintf("http://%s/v1/traces", addr) + url := fmt.Sprintf("http://%s%s", addr, defaultTracesURLPath) // Wait for the servers to start <-time.After(10 * time.Millisecond) @@ -664,7 +676,7 @@ func TestHTTPNewPortAlreadyUsed(t *testing.T) { assert.NoError(t, ln.Close()) }) - r := newHTTPReceiver(t, addr, consumertest.NewNop(), consumertest.NewNop()) + r := newHTTPReceiver(t, addr, defaultTracesURLPath, defaultMetricsURLPath, defaultLogsURLPath, consumertest.NewNop(), consumertest.NewNop()) require.NotNil(t, r) require.Error(t, r.Start(context.Background(), componenttest.NewNopHost())) @@ -775,7 +787,7 @@ func TestOTLPReceiverHTTPTracesIngestTest(t *testing.T) { sink := &errOrSinkConsumer{TracesSink: new(consumertest.TracesSink)} - ocr := newHTTPReceiver(t, addr, sink, nil) + ocr := newHTTPReceiver(t, addr, defaultTracesURLPath, defaultMetricsURLPath, defaultLogsURLPath, sink, nil) require.NotNil(t, ocr) require.NoError(t, ocr.Start(context.Background(), componenttest.NewNopHost())) t.Cleanup(func() { require.NoError(t, ocr.Shutdown(context.Background())) }) @@ -790,7 +802,7 @@ func TestOTLPReceiverHTTPTracesIngestTest(t *testing.T) { pbMarshaler := ptrace.ProtoMarshaler{} pbBytes, err := pbMarshaler.MarshalTraces(td) require.NoError(t, err) - req, err := http.NewRequest(http.MethodPost, "http://"+addr+"/v1/traces", bytes.NewReader(pbBytes)) + req, err := http.NewRequest(http.MethodPost, "http://"+addr+defaultTracesURLPath, bytes.NewReader(pbBytes)) require.NoError(t, err) req.Header.Set("Content-Type", pbContentType) resp, err := http.DefaultClient.Do(req) @@ -888,13 +900,18 @@ func TestGRPCMaxRecvSize(t *testing.T) { func TestHTTPInvalidTLSCredentials(t *testing.T) { cfg := &Config{ Protocols: Protocols{ - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: testutil.GetAvailableLocalAddress(t), - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ - CertFile: "willfail", + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: testutil.GetAvailableLocalAddress(t), + TLSSetting: &configtls.TLSServerSetting{ + TLSSetting: configtls.TLSSetting{ + CertFile: "willfail", + }, }, }, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, }, }, } @@ -916,9 +933,14 @@ func testHTTPMaxRequestBodySizeJSON(t *testing.T, payload []byte, size int, expe url := fmt.Sprintf("http://%s/v1/traces", endpoint) cfg := &Config{ Protocols: Protocols{ - HTTP: &confighttp.HTTPServerSettings{ - Endpoint: endpoint, - MaxRequestBodySize: int64(size), + HTTP: &httpServerSettings{ + HTTPServerSettings: &confighttp.HTTPServerSettings{ + Endpoint: endpoint, + MaxRequestBodySize: int64(size), + }, + TracesURLPath: defaultTracesURLPath, + MetricsURLPath: defaultMetricsURLPath, + LogsURLPath: defaultLogsURLPath, }, }, } @@ -962,10 +984,13 @@ func newGRPCReceiver(t *testing.T, endpoint string, tc consumer.Traces, mc consu return newReceiver(t, factory, cfg, otlpReceiverID, tc, mc) } -func newHTTPReceiver(t *testing.T, endpoint string, tc consumer.Traces, mc consumer.Metrics) component.Component { +func newHTTPReceiver(t *testing.T, endpoint string, tracesURLPath string, metricsURLPath string, logsURLPath string, tc consumer.Traces, mc consumer.Metrics) component.Component { factory := NewFactory() cfg := factory.CreateDefaultConfig().(*Config) cfg.HTTP.Endpoint = endpoint + cfg.HTTP.TracesURLPath = tracesURLPath + cfg.HTTP.MetricsURLPath = metricsURLPath + cfg.HTTP.LogsURLPath = logsURLPath cfg.GRPC = nil return newReceiver(t, factory, cfg, otlpReceiverID, tc, mc) } diff --git a/receiver/otlpreceiver/testdata/config.yaml b/receiver/otlpreceiver/testdata/config.yaml index 84c658d4f28..018f8d664d8 100644 --- a/receiver/otlpreceiver/testdata/config.yaml +++ b/receiver/otlpreceiver/testdata/config.yaml @@ -39,3 +39,8 @@ protocols: - https://*.test.com # Wildcard subdomain. Allows domains like https://www.test.com and https://foo.test.com but not https://wwwtest.com. - https://test.com # Fully qualified domain name. Allows https://test.com only. max_age: 7200 + + # The following shows URL paths for endpoints where signals are listened for bt the OTLP receiver + traces_url_path: traces + metrics_url_path: /v2/metrics + logs_url_path: log/ingest diff --git a/receiver/otlpreceiver/testdata/invalid_logs_path.yaml b/receiver/otlpreceiver/testdata/invalid_logs_path.yaml new file mode 100644 index 00000000000..21dc5df98d2 --- /dev/null +++ b/receiver/otlpreceiver/testdata/invalid_logs_path.yaml @@ -0,0 +1,3 @@ +protocols: + http: + logs_url_path: ":invalid" diff --git a/receiver/otlpreceiver/testdata/invalid_metrics_path.yaml b/receiver/otlpreceiver/testdata/invalid_metrics_path.yaml new file mode 100644 index 00000000000..49a3134e8ef --- /dev/null +++ b/receiver/otlpreceiver/testdata/invalid_metrics_path.yaml @@ -0,0 +1,3 @@ +protocols: + http: + metrics_url_path: ":invalid" diff --git a/receiver/otlpreceiver/testdata/invalid_traces_path.yaml b/receiver/otlpreceiver/testdata/invalid_traces_path.yaml new file mode 100644 index 00000000000..041c2031c0a --- /dev/null +++ b/receiver/otlpreceiver/testdata/invalid_traces_path.yaml @@ -0,0 +1,3 @@ +protocols: + http: + traces_url_path: ":invalid"