Are there any code examples that leverage the HTTP Log Exporter (opentelemetry.exporter.otlp.proto.h...
m
Are there any code examples that leverage the HTTP Log Exporter (opentelemetry.exporter.otlp.proto.http._log_exporter) with LoggingHandler to send logs to SigNoz in Python? e.g using loggers logger.info("hello")
s
Here is the relevant example https://github.com/open-telemetry/opentelemetry-python/blob/main/docs/examples/logs/example.py. You would replace the grpc exporter with http exporter.
m
Thank you. I tried to use this but it did not work as expected (i.e no logs seem visible in the dashboard and no errors are reported by the client). Clicking in: • I deployed Signoz to a self-hosted Kubernetes cluster using Helm. Largely used the default values beyond specifying an ingress for the front-end and the OTEL HTTP collector (believe the node port is 4318) • I specified the collector endpoint in the OTLPLogExporter (i.e. signoz-collector.example.com)
Do I need to provide a path similar to traces (i.e. <domain>/v1/traces)? Do I need to enable the log collector (thought this was enabled by default) in Signoz somewhere?
s
Do I need to provide a path similar to traces
Yes
Do I need to enable the log collector (thought this was enabled by default) in Signoz somewhere?
No, the default config has OTLP receiver so nothing else needed
m
@Srikanth Chekuri I may have missed it - what is the end-point path for logs? I was just specifying the service endpoint (i.e. signoz-collector.examples.com) and no path after...
s
Just the additional suffic
/v1/logs
m
Thank you! That worked 🙂
@Srikanth Chekuri Is it possible to add custom fields to the log handler or override what is put into an existing field? Specifically the code.function only gives you the function and I would like to prepend the path (i.e. logger_name.funcName)
s
You can probably extend the OTLPHandler.