I have found the fix. When you create our own OTLPMetricExporter or OTLPSpanExporter, the endpoint has to be postfixed with v1/metrics and v1/traces, respectively.
SigNoz is an open-source APM. It helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc.