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

Feat : Query Performance monitoring tech debt #199

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tharun0064
Copy link
Contributor

  1. Removed System queries and OHI queries filter
  2. Added more unit test cases
  3. Added QueryMonitoringOnly flag to enable only query monitoring feature
  4. usage of marshal metrics
  5. common function which is reused to fetch metrics
  6. return parameter which were expected datatype instead of nil

1. Removed System queries and OHI queries filter
2. Added more unit test cases
3. Added QueryMonitoringOnly flag to enable only query monitoring feature
4. usage of marshal metrics
5. common function which is reused to fetch metrics
6. return parameter which were expected datatype instead of nil
@tharun0064 tharun0064 requested a review from a team as a code owner February 21, 2025 02:53
* add case-insensitive like operation
* exclude explain queries in wait events
}
// For PostgreSQL versions 13 and 12, anonymization of queries does not occur for blocking sessions, so it's necessary to explicitly anonymize them.
Copy link
Contributor

Choose a reason for hiding this comment

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

could add this comment back as it would be helpful while refering in future.

}
}
}

// IngestMetric is a util by which we publish data in batches .Reason for this is to avoid publishing large data in one go and its a limitation for NewRelic.
func IngestMetric(metricList []interface{}, eventName string, pgIntegration *integration.Integration, cp *commonparameters.CommonParameters) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

unit tests for testing when this func errors out are missing.

enabledExtensions := map[string]bool{"pg_wait_sampling": false}
err := PopulateWaitEventMetrics(conn, pgIntegration, cp, enabledExtensions)
assert.Equal(t, err, commonutils.ErrNotEligible)
assert.NoError(t, mock.ExpectationsWereMet())
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this, is checking assert.Equal(t, err, commonutils.ErrNotEligible) not enough?

Copy link
Contributor

@sairaj18 sairaj18 left a comment

Choose a reason for hiding this comment

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

Thanks for working on these changes. Left few comments.

Also, I see this particular tech debt is not addressed in this PR could you look into it.

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