Skip to content

Document Postgres Surfacer Table Structure #527

Answered by manugarg
theduke asked this question in Q&A
Discussion options

You must be logged in to vote

We should definitely document it. For a quick reference though, postges surfacer supports two schemas:

  • You dump all the labels in JSON format in a single column.
  • You pre-define a label to column mapping through surfacer's labelToColumn field and create schema according to that.

Here is what the schema will look like for the first option:

CREATE TABLE metrics (
    time timestamp,
    metric_name varchar(80),
    value float8,
    labels jsonb
);

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by manugarg
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
2 participants
Converted from issue

This discussion was converted from issue #511 on September 13, 2023 22:24.