Skip to content

Commit

Permalink
PG-1383 Record fait PG version in telemetry file
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov committed Feb 25, 2025
1 parent ad69dd0 commit e2ea392
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion percona_pg_telemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ percona_pg_telemetry_main(Datum main_arg)
FILE *fp;
char str[2048] = {0};
char buf[4096] = {0};
char *pg_version = NULL;
size_t buf_size = sizeof(buf);
bool first_time = true;

Expand Down Expand Up @@ -891,6 +892,8 @@ percona_pg_telemetry_main(Datum main_arg)
/* This is the context that we will allocate our data in */
pt_cxt = AllocSetContextCreate(TopMemoryContext, "Percona Telemetry Context", ALLOCSET_DEFAULT_SIZES);

pg_version = GetConfigOptionByName("server_version", NULL, true);

/* Should never really terminate unless... */
while (!sigterm_recvd && ptss->error_code == PT_SUCCESS)
{
Expand Down Expand Up @@ -950,7 +953,7 @@ percona_pg_telemetry_main(Datum main_arg)
write_telemetry_file(fp, buf);

/* Construct and initiate the active extensions array block. */
construct_json_block(buf, buf_size, "pillar_version", PG_VERSION, PT_JSON_KEY_VALUE, &ptss->json_file_indent);
construct_json_block(buf, buf_size, "pillar_version", pg_version, PT_JSON_KEY_VALUE, &ptss->json_file_indent);
write_telemetry_file(fp, buf);

/* Construct and initiate the active extensions array block. */
Expand Down Expand Up @@ -1088,7 +1091,9 @@ percona_pg_telemetry_worker(Datum main_arg)

/* Get the settings */
if (ptss->first_db_entry)
{
write_pg_settings();
}

extlist = get_extensions_list(&ptss->dbinfo, tmpcxt);

Expand Down

0 comments on commit e2ea392

Please sign in to comment.