{"id":21558087,"url":"https://github.com/koopjs/koop-provider-redshift-analytics","last_synced_at":"2025-03-18T03:28:07.353Z","repository":{"id":56356760,"uuid":"290828282","full_name":"koopjs/koop-provider-redshift-analytics","owner":"koopjs","description":"Translate analytics from Amazon Redshift","archived":false,"fork":false,"pushed_at":"2022-12-09T21:32:00.000Z","size":254,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-02-24T18:40:05.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/koopjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-27T16:36:46.000Z","updated_at":"2021-01-27T17:51:52.000Z","dependencies_parsed_at":"2023-01-25T16:30:48.890Z","dependency_job_id":null,"html_url":"https://github.com/koopjs/koop-provider-redshift-analytics","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-provider-redshift-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-provider-redshift-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-provider-redshift-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fkoop-provider-redshift-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koopjs","download_url":"https://codeload.github.com/koopjs/koop-provider-redshift-analytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244149187,"owners_count":20406328,"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":[],"created_at":"2024-11-24T08:13:58.178Z","updated_at":"2025-03-18T03:28:07.334Z","avatar_url":"https://github.com/koopjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Koop Redshift Analytics Provider\n\nA provider for querying and aggregating a telemetry data stored in Amazon Redshift.\n\n## Environment Variables\nThe following environment variable must be set in order to connect to your Redshift instance:\n```bash\nKOOP_REDSHIFT_HOST\nKOOP_REDSHIFT_PORT\nKOOP_REDSHIFT_USER\nKOOP_REDSHIFT_PASSWORD\nKOOP_REDSHIFT_DATABASE\nKOOP_REDSHIFT_SCHEMA\nKOOP_REDSHIFT_TABLE\nKOOP_REDSHIFT_COLUMN_EVENT\nKOOP_REDSHIFT_COLUMN_SESSION\nKOOP_REDSHIFT_TIMESTAMP_COLUMN\n```\n\nYou can set different table/view sources for event and session queries by setting these additional environment variables:\n```bash\nKOOP_REDSHIFT_SCHEMA_EVENT\nKOOP_REDSHIFT_TABLE_EVENT\nKOOP_REDSHIFT_COLUMN_EVENT_TIMESTAMP\n\nKOOP_REDSHIFT_SCHEMA_SESSION\nKOOP_REDSHIFT_TABLE_SESSION\nKOOP_REDSHIFT_COLUMN_SESSION_TIMESTAMP\n```\n\n## Configuration settings\nThe provider requires some configuration settings.  The code block below shows an example of these settings.\n\n```json\n{\n  \"koopProviderRedshiftAnalytics\": {\n    \"dimensions\": [\"day\"],\n    \"metrics\": [\"pageViews\", \"sessions\", \"avgSessionDuration\"],\n    \"defaultTimeRangeStart\": {\n      \"interval\": \"day\",\n      \"count\": 30\n    },\n    \"eventLookup\": {\n      \"pageViews\": \"page_view\"\n    }\n  }\n}\n```\n\n| Key   | Type | Description | Example |\n|-|-|-|-|\n| dimensions | string[] | An array of attributes that you will allow your analytics to be dimensioned by. These can include database time intervals (day, month, year, etc that get represented as `timestamp`) as well as any columns in your database table. | `[\"day\", \"month\", \"hostname\", \"org\"]` |\n| metrics | string[] | An array of metric types that your data supports. | `[\"pageViews\", \"sessions\"]` |\n| defaultTimeRangeStart |  object | A wrapper for settings related to defining a default start date for the time range of queries. The date will be a number of time intervals before the present. | |\n| defaultTimeRangeStart.interval| string | A database time interval (e.g., day, month, year). | 30 |\n| defaultTimeRangeStart.count| integer | The number of time intervals before the present to set the start of the time range. | 30 |\n| eventLookup | object | Non-session metrics will likely be related to specific \"event types\" such as page-views, downloads, etc. The eventLookup translates the metric name (e.g., `pageViews`) to the actual event-type value (e.g. `page_view`)| |\n| dimensionLookup | object | A map for application values for dimensions that are stored in columns with non-matched column names.  Example: telemetry data for `timeElapsed` is stored in column named `metric1`. Use this object to map queries for `userType` to column `dimension1`.| `{ \"userType\": \"dimension1\" }`|\n| metricLookup | object | A map for application values for metrics that are stored in columns with non-matched column names.  Example: telemetry data for `timeElapsed` is stored in column named `metric1`. Use this object to map queries for `timeElapsed` to column `metric1`.| `{ \"timeElapsed\": \"metric1\" }`|\n\n## Usage\n\n### Path parameter\nThe provider is configured to have a single `:id` parameter. e.g.:\n\n`/redshift-analytics/:id/FeatureServer/0/query`\n\nThe `:id` parameter can be delimited to hold values for the request's **metric**, **dimensions**, and **options**:\n\n`\u003cmetric\u003e:\u003cdimensions\u003e~\u003coptions\u003e`\n\nThe table below explains the components of the `:id` parameter:\n\n| `:id` component | delimiter | Description | Required? | Example |\n|-|-|-|-|-|\n| metric | N/A | The requested metric. | Yes | `pageView` |\n| dimensions | `:` | Values of the requested dimensions. Request multiple dimensions by delimiting with a `,`. | No | `pageView:org,day` |\n| options | `~` | Any provider specific options not representable with Geoservices API query parameters. Multiple options can submitted by delimiting with a `,`. | No | `pageView:org,day~transposeAndAggregate,otherOption` |\n\nSo if you want to request the `pageView` metric, dimensioned by `org` and by `day`, with the `transposeAndAggregate` option, your request would look like:\n\n`/redshift-analytics/pageView:org,day~transposeAndAggregate/FeatureServer/0/query`\n\n### Query Parameters\n\n#### `time`\nThe `time` parameter adheres to the Geoservices API specification. It expects a comma delimited string that represent start and end times. `null` for either value will result in defaults.  Non-null values can be in the following formats: Unix epoch time, YYYY-MM-DD, or an ISO8601 date string.  If the request uses epoch time or YYYY-MM-DD, they should be in UTC.\n\n#### `where`\nThe `where` parameter also adheres to the Geoservices API specification.  It allows users to limit the result set to those that have specific dimension values. For example, `where=hostname='koop.com'` would remove all records that do not have a `hostname` dimension with value `koop.com`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fkoop-provider-redshift-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoopjs%2Fkoop-provider-redshift-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fkoop-provider-redshift-analytics/lists"}