feat: example of sending metrics via `traceloop`
Thank you so much for including examples for OpenTelemetry and OpenLLMetry via traceloop. I was wondering if you'd consider adding examples of adding metrics and sending it to Cloud Metrics via metrics_exporter as well? Similar to how it's done in the OpenLLMetry docs
# ...
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
from opentelemetry.exporter.cloud_monitoring import CloudMonitoringMetricsExporter
from traceloop.sdk import Traceloop
# ...
trace_exporter = CloudTraceSpanExporter()
metrics_exporter = CloudMonitoringMetricsExporter()
Traceloop.init(
app_name='your-app-name',
exporter=trace_exporter,
metrics_exporter=metrics_exporter)
Thanks a lot for raising this. Agreed, it's something we can definitely consider. We are in the process of defining an improved contribution guide in case you want to contribute!
Sure, I mostly asked because I didn't manage to do it successfully so I wanted to see some working examples.
However, I'll see if I can get it working and would then of course happy to contribute!