Skip to content

Can't add metric when adding PW_SOURCES as directory #884

@robinportigliatti

Description

@robinportigliatti

Hello,

Describe the bug

I can't add any metric when I provide PW_SOURCES as a directory.

It may not be a bug, but it is not clear in the doc.

In my docker-compose.yaml file I have the following for my PW_SOURCES:

[...]
  pgwatch:
    image: cybertecpostgresql/pgwatch:latest
    container_name: pgwatch
    environment:
      PW_SOURCES: "/config/pgwatch/sources/"
#      PW_METRICS: "/config/pgwatch/metrics/"
    command:
    - "--sink=postgresql://pgwatch:pgwatch@pgwatch_db:5432/pgwatch_metrics?sslmode=disable"
    - "--sink=prometheus://pgwatch:9187/metrics"
    ports:
      - "8080:8080"   # interface Web UI
      - "9187:9187"   # Prometheus exporter
    volumes:
      - "./pgwatch/sources/:/config/pgwatch/sources/"
      - "./pgwatch/metrics/:/config/pgwatch/metrics/"
    depends_on:
      pgwatch_db:
        condition: service_healthy
[...]

And when I add any metric, I get an "unsupported operation" message.

I think we should add a litle note about it, that when we use file based configuration we are not allowed to add any custom metrics from the UI. It makes sense in my opinion but not to everyone who whishes to put their hand on pgwatch.

EDIT : Using a file works, using a folder does not.

Robin,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions