GoogleCloudPlatform / ops-agent

Apache License 2.0
141 stars 68 forks source link

Ops-Agent Repeatedly Logging into PostgreSQL container, generating a large amount of logs #1614

Open waynewaynetsai opened 9 months ago

waynewaynetsai commented 9 months ago

Describe the bug

I have installed the ops-agent(Version: 2.46.1) on my GCE instance with the following primary configuration:

metrics:
  receivers:
    postgresql:
      type: postgresql
      username: opsagent
      password: test1234
      insecure: true
      endpoint: localhost:5432
      collection_interval: 30s
  service:
    pipelines:
      postgresql:
        receivers:
        - postgresql

I followed the rest of the setup according to the official documentation: Configuring the Ops Agent for PostgreSQL.

After starting the service, I noticed that the ops-agent repeatedly logging into the PostgreSQL database container.

Is this behavior normal? Or could it potentially exhaust the database's connections and other related resources?

If it's problematic, how can I stop this behavior?

(P.S. I have already set collection_interval: 30s).

image

To Reproduce Steps to reproduce the behavior:

  1. Start a GCE VM with debian 11
  2. Setup and launch the PostgreSQL container with pgbouncer container, ensuring that the container's volume is properly configured for data persistence.
  3. Install Ops Agent version '2.46.1' with above offical document
  4. Specify include_paths for container volume log paths in /etc/google-cloud-ops-agent/config.yaml.
  5. Restart Service: sudo service google-cloud-ops-agent restart
  6. See results with Logs Explorer

Expected behavior

It will not log in indefinitely and generate a large amount of logs, occupying a significant amount of log space. It should only log in once.

Environment (please complete the following information):

github-actions[bot] commented 1 week ago

This issue was marked stale due to lack of activity. It will be closed in 14 days.