Is there a way to make the tracer fail early if the endpoint is not reachable? Right now it waits for a span to be over to communicate, which means it fails after an unit of work rather than failing before. Something like:
tracer.span_processor.force_flush()Would have been a good way to fail early out but it's not implemented.
This is how we do it now:
requests.get(tracer.span_processor._span_processors[0].span_exporter._endpoint)very brittle but achieves the early failure
for my understanding, what exactly does “fail early” imply? does it halt the whole process besides spans?
in other words, what’s the drawback of “failing late” (i.e. if the span is generated but can’t be exported)?
technically you can also temporarily store the spans elsewhere and re-export them when the endpoint is back
the second is the idea behavior so we detect the failure early rather than compute and then fail
since the main thread doesn't fail, the current way is also OK usually so it's not high importance or urgent
i see. well, if the operation is long enough, the endpoint can still be gone by the time the operation is finished, so it’s not guaranteed either
you can attache a second and local exporter as a backup
if the export is successful you can erase the backup
if export fails you can try again later
it's ok if networking is off or sluggish in the end, the issue is that we might have a machine that cannot connect to the exporter at all, the other alternative would be to export a fake trace but then we have fake traces everywhere
machine that cannot connect to the exporter at all
i see. alternatively you can also write the spans to a file
the protobuf format is serializable to strings
