How to export from OpenTelemetry to Observability APM

I was able to get my traces exported to elastic without using the config file. All I did was remove the line

.AddConsoleExporter()

and it worked.