Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
telemetry.h File Reference
#include <glib.h>
#include <json-glib/json-glib.h>
+ Include dependency graph for telemetry.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void dt_telemetry_init (const gboolean have_gui)
 
void dt_telemetry_shutdown (void)
 
void dt_telemetry_capture (const char *event, JsonObject *properties)
 
void dt_telemetry_record_module_usage (const char *category, const char *name)
 
void dt_telemetry_record_file_type (const struct dt_image_t *img, const char *pipeline)
 

Function Documentation

◆ dt_telemetry_capture()

void dt_telemetry_capture ( const char *  event,
JsonObject *  properties 
)

Queue one analytics event for asynchronous delivery to PostHog.

Parameters
eventevent name, e.g. "session_start".
propertiesa JsonObject of event properties, or NULL. Ownership is transferred to this function (it is unref'd internally).

Non-blocking and thread-safe. No-op (and still consumes properties) when analytics is disabled or not opted in.

Definition at line 417 of file telemetry.c.

◆ dt_telemetry_init()

void dt_telemetry_init ( const gboolean  have_gui)

Initialize opt-in usage analytics (PostHog, EU region).

This is SEPARATE from crash reporting (Sentry): it has its own consent dialog and its own preference (telemetry/enabled). On first launch with a GUI it asks the user, once, whether to share anonymous usage statistics. Analytics is started only if the user opted in and a PostHog API key was configured at build time. It sends anonymous, aggregate data (no images, file names or personal data) keyed by a random per-installation id.

Safe to call without telemetry support (USE_TELEMETRY=OFF): no-op.

Parameters
have_guiwhether a GUI is up and a consent dialog may be shown.

Definition at line 409 of file telemetry.c.

Referenced by dt_init().

◆ dt_telemetry_record_file_type()

void dt_telemetry_record_file_type ( const struct dt_image_t img,
const char *  pipeline 
)

Record the kind of an image processed during this session (extension and type flags only, never the file name or path).

De-duplicated per image+pipeline like the crash context, accumulated in-memory and sent aggregated in the "session_end" event. Thread-safe; no-op when analytics is disabled.

Parameters
imgthe image being processed.
pipelinepipeline label, e.g. "darkroom" or "export".

Definition at line 426 of file telemetry.c.

Referenced by dt_dev_pixelpipe_process().

◆ dt_telemetry_record_module_usage()

void dt_telemetry_record_module_usage ( const char *  category,
const char *  name 
)

Count one usage of a module/view/panel for the current session.

Accumulated in-memory (counts only, no order, no timing) and sent aggregated in the "session_end" event at shutdown. Thread-safe; no-op when analytics is disabled.

Parameters
categoryone of "view", "lib", "iop".
namethe module's stable operation/plugin name.

Definition at line 422 of file telemetry.c.

Referenced by _gui_off_callback(), dt_lib_gui_set_expanded(), and dt_view_manager_switch_by_view().

◆ dt_telemetry_shutdown()

void dt_telemetry_shutdown ( void  )

Flush pending analytics events and stop the background worker. No-op if analytics was never started.

Definition at line 413 of file telemetry.c.

Referenced by dt_cleanup().