Skip to content

Conversation

@thc1006
Copy link
Contributor

@thc1006 thc1006 commented Sep 29, 2025

Description

This PR fixes the invalid configuration example in the PostgreSQL receiver README that was causing configuration validation errors.

Problem

The max_rows_per_query parameter was incorrectly placed under the events section, causing the error: 'events' has invalid keys: max_rows_per_query

Solution

Moved max_rows_per_query to the correct location at the root level of the receiver configuration, aligning with the actual implementation.

Related Issues

Fixes #42838

Note

This is a re-opened version of #43035. The previous PR was accidentally closed after misunderstanding the review feedback. The changelog file has been removed as requested since this is a documentation-only change.

cc @paulojmdias - Sorry for the confusion on the previous PR. I've removed the changelog file as requested.

The max_rows_per_query parameter was incorrectly placed at the
metrics.postgresql.max_rows_per_query level, but it should be at
the root level as per the actual implementation.

Fixes open-telemetry#42838
@thc1006 thc1006 requested a review from a team as a code owner September 29, 2025 09:06
@thc1006 thc1006 requested a review from songy23 September 29, 2025 09:06
@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Sep 29, 2025
@github-actions
Copy link
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@paulojmdias
Copy link
Member

/label skip-changelog

@thc1006
Copy link
Contributor Author

thc1006 commented Sep 29, 2025

Verification of the fix

I've double-checked that this PR correctly addresses issue #42838:

Problem:

  • The example had max_rows_per_query incorrectly placed under the events section
  • This caused the error: 'events' has invalid keys: max_rows_per_query

Solution:

  • Moved max_rows_per_query to the correct locations based on the actual struct definitions in config.go:
    • Line 41: QuerySampleCollection has MaxRowsPerQuery → maps to query_sample_collection.max_rows_per_query
    • Line 31: TopQueryCollection has MaxRowsPerQuery → maps to top_query_collection.max_rows_per_query

The configuration now correctly shows:

query_sample_collection:
  max_rows_per_query: 100
top_query_collection:
  max_rows_per_query: 100
  top_n_query: 100

This aligns with the actual implementation and will no longer cause validation errors.

@songy23 songy23 added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Sep 29, 2025
@github-actions
Copy link
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@songy23 songy23 merged commit 192bd6f into open-telemetry:main Sep 29, 2025
175 of 176 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 29, 2025
@otelbot
Copy link
Contributor

otelbot bot commented Sep 29, 2025

Thank you for your contribution @thc1006! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor PRs made by new contributors receiver/postgresql Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/postgresqlreceiver] Invalid configuration example in readme

4 participants