35 lines
899 B
TypeScript
35 lines
899 B
TypeScript
import { AggregationTemporality, type PushMetricExporter } from '@opentelemetry/sdk-metrics'
|
|
import { type ExportResult, ExportResultCode } from '@opentelemetry/core'
|
|
|
|
/**
|
|
* BigQuery Metrics Exporter - Stubbed
|
|
*
|
|
* This exporter is stubbed to ensure no metrics or telemetry data
|
|
* is ever transmitted to external services.
|
|
*/
|
|
export class BigQueryMetricsExporter implements PushMetricExporter {
|
|
constructor(_options: { timeout?: number } = {}) {
|
|
// No-op
|
|
}
|
|
|
|
async export(
|
|
_metrics: any,
|
|
resultCallback: (result: ExportResult) => void,
|
|
): Promise<void> {
|
|
// Always report success but do nothing
|
|
resultCallback({ code: ExportResultCode.SUCCESS })
|
|
}
|
|
|
|
async shutdown(): Promise<void> {
|
|
// No-op
|
|
}
|
|
|
|
async forceFlush(): Promise<void> {
|
|
// No-op
|
|
}
|
|
|
|
selectAggregationTemporality(): AggregationTemporality {
|
|
return AggregationTemporality.DELTA
|
|
}
|
|
}
|