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

Autodiscovery of postgres databases? #1670

Open
justinmchase opened this issue Jan 14, 2025 · 3 comments
Open

Autodiscovery of postgres databases? #1670

justinmchase opened this issue Jan 14, 2025 · 3 comments

Comments

@justinmchase
Copy link

We have multiple postgres databases and there isn't necessarily a good way to know them all up front in such a way that we can hard code them into the datadog.confd values.

Ideally there would be a CustomResourceDefinition for us to create configuration for a database instance that way each namespace could report its own database configuration as it is created.

Is such a thing possible now? Are there any other mechanisms for database auto discovery?

apiVersion: datadog.com/v1
kind: PostgresMonitor
metadata:
  name: test-app
spec:
  instance:
    host: example.com
    username: example
    password: example
@fanny-jiang
Copy link
Contributor

Hey @justinmchase, this is more of a question for https://github.com/DataDog/integrations-core as that's where the postgres agent integration is maintained. I did a quick check over there and it sounds like you're looking for the database_autodiscovery feature, which was added in v14.1.0 of the postgres check.

Here's the example config.

You should be able to configure this in the datadog helm values with datadog.confd as well. If you have specific questions about the postgres check itself and the database_autodiscovery feature, please open a support ticket or GH issue in the integrations-core repo. 🙂

@justinmchase
Copy link
Author

Complete this section if you want to auto-discover databases on this host

Hmm, that appears to be for auto discovering databases within a single host?

I am actually looking more for a way to autodiscover hosts. We have many, and they are dynamically provisioned and I don't have a good way to know about all of them statically.

I'm writing it here in this repository because it would be more of a kubernetes specific feature.

Its very common for kubernetes applications to support features like this by means of a CustomResourceDefinition, where you then have a daemonset which watches the entire cluster for these resource definitions and then you would configure the agent dynamically as these custom resources are created/updated/deleted. Having to provision datadog through the helm values for example, will not be sufficient for use cases like this.

That is what I'm asking about specifically, I looked in the code but its complex enough to need to ask about it first.

Is there anyway for me to configure the agent dynamically with kubernetes resources?

For example, the kubernetes Ingress works this way. I can run nginx as an ingress controller but rather than configuring nginx in a static config file it watches the rest of Kubernetes for Ingress objects to be created and it dynamically configures nginx.

Keda and Argo also work in a similar way. I would expect datadog to operate in a similar manner.

@sebastien-prudhomme
Copy link

Coming from Prometheus Operator, I've the same need. I've opened this issue in the Datadog operator repository: DataDog/datadog-operator#1605

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