Aalexbit-codemod

mine-opentelemetry

Mine OpenTelemetry and Backstage MetricsService/TracingService usage; read-only metrics

miningmetricsopentelemetryobservabilitycode-mining
PRO
0 executions

Run locally

npx codemod mine-opentelemetry

This is a Pro codemod. Preview changes and insights for free, no login or code sharing required. Applying changes and accessing insights requires a paid plan and sign in.Learn more

mine-opentelemetry

Pro read-only mining codemod. Inventories OpenTelemetry and Backstage MetricsService / TracingService usage. Does not modify source.

Metrics

Emits observability_finding and observability_finding_summary.

Shared cardinalities (observability_finding)

CardinalityValues / meaning
categoryAlways otel
finding_typeSee table below
severityinfo or medium
automatabletrue, false, or partial
priority_hint2080
migration_lanekeep or export_to_datadog
rule_idOTEL-001OTEL-006
file, line, symbol, packageLocation and enclosing symbol

observability_finding_summary keeps only category, finding_type, severity, migration_lane.

Rules / finding_type

Rulefinding_typeWhat it means
OTEL-001otel_api_importImport/require of @opentelemetry/api
OTEL-002otel_sdk_importOther @opentelemetry/* packages (SDK, exporters, auto-instrumentations)
OTEL-003otel_get_meter_or_tracergetMeter / getTracer usage
OTEL-004metrics_or_tracing_serviceBackstage MetricsService / TracingService references
OTEL-005prometheus_exporter_setupPrometheusExporter (candidate to swap for OTLP → Datadog)
OTEL-006otel_span_apiAPIs such as createCounter, createHistogram, startActiveSpan

Ready to contribute?

Build your own codemod and share it with the community.