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

Add the instance struct to handle connections #785

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

sysadmind
Copy link
Contributor

The intent is to use the instance struct to hold the connection to the database as well as metadata about the instance. Currently this metadata only includes the version of postgres for the instance which can be used in the collectors to decide what query to run. In the future this could hold more metadata but for now it keeps the Collector interface arguments to a reasonable number.

@sysadmind sysadmind requested a review from SuperQ March 30, 2023 01:27
@sysadmind
Copy link
Contributor Author

@SuperQ Let me know what you think about this. This was my first iteration but it seems like it should work for versioning queries in the collector package.

@SuperQ
Copy link
Contributor

SuperQ commented Jun 19, 2023

Seems like a good idea, care to rebase this?

The intent is to use the instance struct to hold the connection to the database as well as metadata about the instance. Currently this metadata only includes the version of postgres for the instance which can be used in the collectors to decide what query to run. In the future this could hold more metadata but for now it keeps the Collector interface arguments to a reasonable number.

Signed-off-by: Joe Adams <[email protected]>
@sysadmind sysadmind force-pushed the collector-instance branch from 2a89b67 to ab33346 Compare June 22, 2023 00:37
@sysadmind
Copy link
Contributor Author

@SuperQ Rebase complete.

Comment on lines +74 to +75
// We could also try to parse the version from the server_version field.
// This is of the format 13.3 (Debian 13.3-1.pgdg100+1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should do SHOW server_version first?

Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor question about version parsing order. Otherwise LGTM.

@SuperQ
Copy link
Contributor

SuperQ commented Jun 22, 2023

I think the version stuff is fine for now, we can iterate on it later. I'm going to merge this so I can continue some migrations of collectors out of the main package.

@SuperQ SuperQ merged commit d983d32 into prometheus-community:master Jun 22, 2023
@sysadmind sysadmind deleted the collector-instance branch June 28, 2023 23:52
s10 added a commit to s10/mysqld_exporter that referenced this pull request Aug 12, 2024
The intent is to use the instance struct to hold the connection
to the database as well as metadata about the instance

Change is similar to prometheus-community/postgres_exporter#785
s10 added a commit to s10/mysqld_exporter that referenced this pull request Aug 12, 2024
The intent is to use the instance struct to hold the connection
to the database as well as metadata about the instance

Change is similar to prometheus-community/postgres_exporter#785
s10 added a commit to s10/mysqld_exporter that referenced this pull request Aug 12, 2024
The intent is to use the instance struct to hold the connection
to the database as well as metadata about the instance:
- version
- flavor (mariadb or mysql)

Change is similar to prometheus-community/postgres_exporter#785
s10 added a commit to s10/mysqld_exporter that referenced this pull request Aug 12, 2024
The intent is to use the instance struct to hold the connection
to the database as well as metadata about the instance:
- version
- flavor (mariadb or mysql)

Change is similar to prometheus-community/postgres_exporter#785

Signed-off-by: Vlad Gusev <[email protected]>
s10 added a commit to s10/mysqld_exporter that referenced this pull request Aug 12, 2024
The intent is to use the instance struct to hold the connection
to the database as well as metadata about the instance:
- version
- flavor (mariadb or mysql)

Change is similar to prometheus-community/postgres_exporter#785

Signed-off-by: Vlad Gusev <[email protected]>
SuperQ pushed a commit to prometheus/mysqld_exporter that referenced this pull request Aug 12, 2024
The intent is to use the instance struct to hold the connection
to the database as well as metadata about the instance:
- version
- flavor (mariadb or mysql)

Change is similar to prometheus-community/postgres_exporter#785

Signed-off-by: Vlad Gusev <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants