import{AsyncApiRealmCLI as r}from"@redocly/realm-asyncapi-sdk";import{TELEMETRY_ENABLED as t}from"../../server/constants/common.js";import{PACKAGE_NAME as o}from"../../config/product-gates.js";class s extends r.Telemetry{constructor(){super(),this.updateCloudEventData(()=>({organization:{id:process.env.ORGANIZATION_ID||"",slug:process.env.ORGANIZATION_SLUG||""},project:{id:process.env.PROJECT_ID||"",slug:""},productType:"cli",sourceDetails:{user:"Anonymous",object:"user",uri:""},request:{source:"cli"}}))}initialize(e){this.init({otel:{serviceName:"realm-cli",serviceVersion:`${o}@${e}`,collectorTraceUrl:process.env.OTEL_TRACES_URL||"https://otel.cloud.redocly.com/v1/traces",isProd:process.env.REDOCLY_ENV==="production",version:"1.0",tracerName:"cli-telemetry"},disabled:!t})}}const c=new s,a=c.tracer;export{c as telemetry,a as telemetryTracer};
