{"id":15137051,"url":"https://github.com/igor-suhorukov/postgresjsonlogwatcher","last_synced_at":"2026-01-20T14:07:40.197Z","repository":{"id":251659326,"uuid":"837952038","full_name":"igor-suhorukov/PostgresJsonLogWatcher","owner":"igor-suhorukov","description":"The PostgresJsonLogWatcher provides a tool for monitoring PostgreSQL logs in JSON format and sending the logs to an OpenTelemetry collector","archived":false,"fork":false,"pushed_at":"2025-02-15T15:57:19.000Z","size":14710,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T03:45:37.898Z","etag":null,"topics":["log","opentelemetry","postgresql"],"latest_commit_sha":null,"homepage":"https://igor-suhorukov.github.io/PostgresJsonLogWatcher/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igor-suhorukov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-04T14:29:19.000Z","updated_at":"2025-02-15T15:52:33.000Z","dependencies_parsed_at":"2024-08-13T23:41:23.345Z","dependency_job_id":"b08c61f6-ffd9-486a-b8c8-cd7f82e96fb1","html_url":"https://github.com/igor-suhorukov/PostgresJsonLogWatcher","commit_stats":{"total_commits":66,"total_committers":1,"mean_commits":66.0,"dds":0.0,"last_synced_commit":"1f43e7af2ba9701fea12fc746e6527dd0bee5f43"},"previous_names":["igor-suhorukov/postgresjsonlogwatcher"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igor-suhorukov%2FPostgresJsonLogWatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igor-suhorukov%2FPostgresJsonLogWatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igor-suhorukov%2FPostgresJsonLogWatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igor-suhorukov%2FPostgresJsonLogWatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igor-suhorukov","download_url":"https://codeload.github.com/igor-suhorukov/PostgresJsonLogWatcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430835,"owners_count":20937873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["log","opentelemetry","postgresql"],"created_at":"2024-09-26T06:43:08.515Z","updated_at":"2026-01-20T14:07:40.152Z","avatar_url":"https://github.com/igor-suhorukov.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgresJsonLogWatcher\n\nThe **PostgresJsonLogWatcher** project provides a tool for monitoring PostgreSQL logs in JSON format and sending the logs to an OpenTelemetry collector. This tool can also enrich logs with additional information fetched from the PostgreSQL database.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n\n## Features\n\n- Monitors PostgreSQL logs in JSON format.\n- Enriches logs with additional information from the PostgreSQL database.\n- Sends enriched logs to an OpenTelemetry collector.\n- Configurable via command line arguments.\n\n## Installation\n\n### Prerequisites\n\n- Java 11 or later\n- PostgreSQL database with `pg_stat_statements` extension enabled\n- OpenTelemetry collector\n\n### Downloading the Release\n\nYou can download the latest release from the [GitHub Releases](https://github.com/igor-suhorukov/PostgresJsonLogWatcher/releases) page.\n\n1. Navigate to the [Releases](https://github.com/igor-suhorukov/PostgresJsonLogWatcher/releases) page.\n2. Click on the latest release.\n3. Download the relevant binary or source code archive for your system.\n\n### Reading GitHub Pages Documentation\n\nDetailed documentation for the project is available on GitHub Pages.\n\n- Navigate to the [Project Documentation](https://igor-suhorukov.github.io/PostgresJsonLogWatcher/) page on GitHub Pages.\n\n\n### Build\n\nTo build the project, run the following Maven command:\n\n```bash\nmvn clean install\n```\nThis will generate the executable JAR file in the target directory.\n\n## Usage\nTo execute the program, run:\n\n```bash\njava -jar target/postgres_log_parser.jar -h\n```\n\n```\nThis program reads PostgreSQL DBMS logs in JSON format and sends them to\nOpenTelemetry collector\nUsage: postgres_log_parser [-hV] [--password[=\u003cposgreSqlPassword\u003e]]\n                           [-c=\u003cmaximumQueryCacheSize\u003e]\n                           [-d=\u003cposgreSqlDatabase\u003e] [-H=\u003cposgreSqlHost\u003e]\n                           [-i=\u003csaveInterval\u003e] [-lp=\u003ccurrentLogPositionFile\u003e]\n                           [-p=\u003cposgreSqlPort\u003e] [-u=\u003cposgreSqlUserName\u003e]\n                           \u003cwatchDir\u003e\n      \u003cwatchDir\u003e   Path to PostgreSQL log directory in JSON format\n  -c, --max_cache_size=\u003cmaximumQueryCacheSize\u003e\n                   Database query cache size\n  -d, --database=\u003cposgreSqlDatabase\u003e\n                   The database name\n  -h, --help       Show this help message and exit.\n  -H, --host=\u003cposgreSqlHost\u003e\n                   The host name of the PostgreSQL server\n  -i, --save_interval=\u003csaveInterval\u003e\n                   Interval of saving (in second) of the current read position\n                     in the log files. The value must be within a range from 1\n                     till 1000 second\n      -lp, --log_pos_file=\u003ccurrentLogPositionFile\u003e\n                   Path to file to save current processed position in log\n                     files. Required write capability for this program\n  -p, --port=\u003cposgreSqlPort\u003e\n                   The port number the PostgreSQL server is listening on\n      --password[=\u003cposgreSqlPassword\u003e]\n\n  -u, --user=\u003cposgreSqlUserName\u003e\n                   The database user on whose behalf the connection is being\n                     made\n  -V, --version    Print version information and exit.\n```\n\nExecute program with OTEL java agent:\n```bash\njava -Dotel.resource.attributes=service.name=PostgreSQL_Logs -Dotel.exporter.otlp.protocol=grpc -Dotel.exporter.otlp.endpoint=http://127.0.0.1:4317 -Dotel.logs.exporter=otlp -Dotel.instrumentation.logback-appender.experimental.capture-key-value-pair-attributes=true -Dotel.instrumentation.logback-appender.experimental.capture-logger-context-attributes=true -javaagent:opentelemetry-javaagent-2.7.0.jar -jar postgres_log_parser.jar ~/database/log\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figor-suhorukov%2Fpostgresjsonlogwatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figor-suhorukov%2Fpostgresjsonlogwatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figor-suhorukov%2Fpostgresjsonlogwatcher/lists"}