Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Adapter triggers "CREATE TABLE metrics_labels" every start #90

@r0b2g1t

Description

@r0b2g1t

If I start an adapter that should use an existing database, there is the following error message in the Postgres Log.

2019-09-06 12:44:31.230 UTC [16399] ERROR:  relation "metrics_labels" already exists
2019-09-06 12:44:31.230 UTC [16399] CONTEXT:  SQL statement "
                    CREATE TABLE metrics_labels (
                          id SERIAL PRIMARY KEY,
                          metric_name TEXT NOT NULL,
                          labels jsonb,
                          UNIQUE(metric_name, labels)
                    )
                    "
        PL/pgSQL function create_prometheus_table(name,name,name,name,name,boolean,boolean,interval) line 45 at EXECUTE
2019-09-06 12:44:31.230 UTC [16399] STATEMENT:  SELECT create_prometheus_table($1, normalized_tables => $2, chunk_time_interval => $3,  use_timescaledb=> $4)

This could be solved with a simple function that checks if the database already exists before setup.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions