Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[postgres] make the relation metrics aware of schemas #1496

Closed
clofresh opened this issue Mar 31, 2015 · 2 comments
Closed

[postgres] make the relation metrics aware of schemas #1496

clofresh opened this issue Mar 31, 2015 · 2 comments
Milestone

Comments

@clofresh
Copy link
Contributor

Currently the postgres check can collect relation metrics from pg_stat_user_tables and pg_stat_user_indexes, but they don't specify the schema, so it could mixing up be metrics from tables with the same name in different schemas. I'd like to update the check to tag the relation metrics by schema as well as support specifying the schema in config.

So if you have the following db:

create schema prod;
create table prod.foo(id int);

create schema staging;
create table staging.foo(id int);

And you're running the old check:

    relations:
        - foo

You'd submit two rows of data, but the same set of tags, so one of the metrics would win.

In the new version, you'd get two rows of data, but one tagged with schema:prod and schema:staging.

You'd also be able to specify the schema:

    relations:
        - prod.foo

Which would only query for the prod schema's foo table.

@remh remh added this to the 5.4.0 milestone Apr 15, 2015
@yannmh
Copy link
Member

yannmh commented Jun 5, 2015

Thanks for the detailed explanations @clofresh.

We didn't have time to do it for the 5.4.0 agent release. I am pushing back to 5.5.0.

@yannmh
Copy link
Member

yannmh commented Jul 27, 2015

Fixed with #1771.

Thanks @kostas0

@yannmh yannmh closed this as completed Jul 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants