mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-04 22:10:12 +01:00
Add runtime metric to Telemetry
This commit is contained in:
parent
09a0fe1c81
commit
171b1dd9aa
@ -28,11 +28,22 @@ const Telemetry = {
|
||||
return new PostHog(this.pubkey);
|
||||
},
|
||||
|
||||
sendTelemetry: async function (event, properties = {}, subUserId = null) {
|
||||
runtime: function () {
|
||||
if (process.env.ANYTHING_LLM_RUNTIME === "docker") return "docker";
|
||||
if (process.env.NODE_ENV === "production") return "production";
|
||||
return "other";
|
||||
},
|
||||
|
||||
sendTelemetry: async function (
|
||||
event,
|
||||
eventProperties = {},
|
||||
subUserId = null
|
||||
) {
|
||||
try {
|
||||
const { client, distinctId: systemId } = await this.connect();
|
||||
if (!client) return;
|
||||
const distinctId = !!subUserId ? `${systemId}::${subUserId}` : systemId;
|
||||
const properties = { ...eventProperties, runtime: this.runtime() };
|
||||
console.log(`\x1b[32m[TELEMETRY SENT]\x1b[0m`, {
|
||||
event,
|
||||
distinctId,
|
||||
|
Loading…
Reference in New Issue
Block a user