Documentation
¶
Overview ¶
Command observability demonstrates lance-go's OpenTelemetry instrumentation.
Every lance operation emits a span named lance.<Type>.<Method> (e.g. lance.Write, lance.Dataset.CountRows, lance.Scanner.CountRows) plus the metrics lance.operation.count, lance.operation.duration, lance.rows.affected and lance.bytes.written. You attach your own OpenTelemetry providers at construction time. If you attach none, the OTel globals (no-op) are used.
This example wires up the OTel *stdout* exporters so you can see the spans and metrics printed to your terminal. To ship this telemetry to Datadog (or any OTLP backend), you swap ONLY the exporter: replace the stdouttrace / stdoutmetric exporters below with the OTLP exporters (go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc and .../otlpmetric/otlpmetricgrpc) pointed at your Datadog Agent's OTLP endpoint (default localhost:4317). Nothing in lance-go changes, since the library only speaks the vendor-neutral OpenTelemetry API.
Usage: go run ./examples/observability