{"id":37174487,"url":"https://github.com/destrex271/postgresexporter","last_synced_at":"2026-01-14T20:23:17.774Z","repository":{"id":266307204,"uuid":"897981168","full_name":"destrex271/postgresexporter","owner":"destrex271","description":"Unofficial Postgres Exporter for OpenTelemetry","archived":false,"fork":false,"pushed_at":"2025-04-16T05:02:10.000Z","size":30,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T06:31:53.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/destrex271.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,"zenodo":null}},"created_at":"2024-12-03T15:22:57.000Z","updated_at":"2025-04-16T05:02:13.000Z","dependencies_parsed_at":"2025-04-16T06:19:44.057Z","dependency_job_id":"7ff48bda-94f3-43b3-b78d-6b2a1b066e05","html_url":"https://github.com/destrex271/postgresexporter","commit_stats":null,"previous_names":["destrex271/postgresexporter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/destrex271/postgresexporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/destrex271%2Fpostgresexporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/destrex271%2Fpostgresexporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/destrex271%2Fpostgresexporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/destrex271%2Fpostgresexporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/destrex271","download_url":"https://codeload.github.com/destrex271/postgresexporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/destrex271%2Fpostgresexporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T20:23:17.067Z","updated_at":"2026-01-14T20:23:17.756Z","avatar_url":"https://github.com/destrex271.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unofficial Postgres Exporter for OTEL\n\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/destrex271/postgresexporter)\n![GitHub Repo stars](https://img.shields.io/github/stars/destrex271/postgresexporter)\n\n*The official development for this component is being carried out in this pull request -\u003e https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/36403*\n\u003chr/\u003e\n\nThis repository contains an unofficial implementation for an \u003ca href=\"https://opentelemetry.io/\"\u003eOpen Telemetry\u003c/a\u003e Exporter to export otel logs, traces and metrics to PostgreSQL.\nThe original issue for the development of this exporter can be found here: https://github.com/paradedb/paradedb/issues/1632\n\n## Usage\n\nTo try this exporter you can build your custom OTEL Collector.\n\n1. Clone the repository\n```\ngit clone https://github.com/destrex271/postgresexporter\n```\n\n2. In the same directory where your repository is cloned, add the following distribution config in a file named `builder_config.yml`\n\n```yaml\ndist:\n  name: otellocalcol\n  description: OpenTelemetry Collector Local for tests.\n  version: 1.0.0\n  output_path: . \n\nreceivers:\n  - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.124.0\n\nprocessors:\n  - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.124.0\n  - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.124.0\n\nexporters:\n  - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.124.0\n  - gomod: github.com/destrex271/postgresexporter main\n    path: \"./postgresexporter\" # if you have repo locally\n\nproviders:\n  - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.28.0\n  - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.28.0\n  - gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.28.0\n  - gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.28.0\n  - gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.28.0\n\nextensions:\n  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.124.0\n  - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckv2extension v0.124.0\n```\n\n3. Install the otel builder utility\n```\ngo install go.opentelemetry.io/collector/cmd/builder@latest\n```\n*NOTE*: Builder version should be same as the otel collector version i.e. 0.124.0 in this case. You can replace `latest` by the version number\n\n4. Run the builder\n```\nbuilder --config=builder-config.yml\n```\nThis will generate an executable named `otellocalcol`\n\n5. Run the collector to start collecting measurements\n\n```\n./otellocalcol --config=\"./postgresexporter/example/otel-collector-config.yml\"\n```\nHere we are using the example config provided with the exporter. The contents of this file look something like this:\n\n```yaml\nreceivers:\n  otlp:\n    protocols:\n      grpc:\n        endpoint: 0.0.0.0:4317\n      http:\n        endpoint: 0.0.0.0:4318\n\nexporters:\n  postgresexporter:\n    username: \"postgres\"\n    password: \"postgres\"\n    database: \"postgres\"\n    logs_table_name: \"otellogs\"\n    traces_table_name: \"oteltraces\"\n    metrics_table_name: \"otelmetrics\"\n    port: 5432\n    host: \"localhost\"\n  debug:\n\nservice:\n  pipelines:\n    logs:\n      receivers: [otlp]\n      exporters:\n        - debug\n        - postgresexporter\n    traces:\n      receivers: [otlp]\n      exporters:\n        - debug\n        - postgresexporter\n    # metrics:\n    #   receivers: [otlp]\n    #   exporters:\n    #     - debug\n    #     - postgresexporter\n```\n\nYou can modify the values according to your requirements\n\n6. Although the logs will clarify if the exporter worked or not, you can also check if the tables were\ncreated your in postgres database. For this you can open up psql and run the following commands:\n\n```psql\npostgres=# \\d\n                         List of relations\n Schema |           Name            |       Type        |  Owner   \n--------+---------------------------+-------------------+----------\n public | otellogs                  | table             | postgres\n public | oteltraces                | table             | postgres\n public | oteltraces_trace_id_ts    | table             | postgres\n public | oteltraces_trace_id_ts_mv | materialized view | postgres\n\n```\n\nHere we can see that otellogs and oteltraces tables were created.\n\nFor example we can see the columns in the otellogs table:\n\n```psql\npostgres=# \\d+ otellogs\n                                                                           Table \"public.otellogs\"\n       Column       |              Type              | Collation | Nullable |                 Default                  | Storage  | Compression | Stats target | Description \n--------------------+--------------------------------+-----------+----------+------------------------------------------+----------+-------------+--------------+-------------\n Timestamp          | timestamp(6) without time zone |           | not null |                                          | plain    |             |              | \n TimestampTime      | timestamp without time zone    |           | not null | generated always as (\"Timestamp\") stored | plain    |             |              | \n TraceId            | text                           |           |          |                                          | extended |             |              | \n SpanId             | text                           |           |          |                                          | extended |             |              | \n TraceFlags         | smallint                       |           |          |                                          | plain    |             |              | \n SeverityText       | text                           |           |          |                                          | extended |             |              | \n SeverityNumber     | smallint                       |           |          |                                          | plain    |             |              | \n ServiceName        | text                           |           | not null |                                          | extended |             |              | \n Body               | text                           |           |          |                                          | extended |             |              | \n ResourceSchemaUrl  | text                           |           |          |                                          | extended |             |              | \n ResourceAttributes | jsonb                          |           |          |                                          | extended |             |              | \n ScopeSchemaUrl     | text                           |           |          |                                          | extended |             |              | \n ScopeName          | text                           |           |          |                                          | extended |             |              | \n ScopeVersion       | text                           |           |          |                                          | extended |             |              | \n ScopeAttributes    | jsonb                          |           |          |                                          | extended |             |              | \n LogAttributes      | jsonb                          |           |          |                                          | extended |             |              | \nIndexes:\n    \"otellogs_pkey\" PRIMARY KEY, btree (\"ServiceName\", \"TimestampTime\")\nAccess method: heap\n\n```\n\n## Supported Functionalities\n\n - Export OTEL Logs to Postgres\n - Export OTEL Traces to Postgres\n \u003chr/\u003e\n - *Inprogress*: Export OTEL Metrics to Postgres\n\n## Contributing\nPlease check out the issues section of the repository to contribute to this project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdestrex271%2Fpostgresexporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdestrex271%2Fpostgresexporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdestrex271%2Fpostgresexporter/lists"}