-
Notifications
You must be signed in to change notification settings - Fork 77
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 a monitor for the OpenMetrics endpoint #584
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick skim.
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsMetricsMonitor.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
else { | ||
log.error(e, "Health check failed with non-retryable response. %s", e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think e.toString()
is better than e.getMessage()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnexpectedResponseException.toString()
does not print the message unfortunately. I'll open a PR in airlift to add it and temporarily log both until it is merged and we upgrade. The message contains details about any issues with missing metrics, which could be a common issue given the long names. The error logged with e.getMessage()
will be something like
2025-01-08T18:19:41.384+0000 SEVERE Health check failed with non-retryable response. Request is missing required keys:
trino_execution_name_QueryManager_RunningQueries
trino_execution_name_QueryManager_QueuedQueries
trino_metadata_name_DiscoveryNodeManager_ActiveNodeCount
in response: 'Basic authentication or X-Trino-Original-User or X-Trino-User must be sent'
UnexpectedResponseException{request=GET http://localhost:32835/metrics?name%5B%5D=trino_execution_name_QueryManager_RunningQueries&name%5B%5D=trino_execution_name_QueryManager_QueuedQueries&name%5B%5D=trino_metadata_name_DiscoveryNodeManager_ActiveNodeCount, statusCode=401, headers={Date=[Wed, 08 Jan 2025 18:19:41 GMT], Vary=[Accept-Encoding], Content-Type=[text/plain;charset=UTF-8], WWW-Authenticate=[Basic realm="Trino"], Content-Length=[74]}}
(I removed the user header to trigger an error).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsMetricsMonitor.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsMetricsMonitor.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsMetricsMonitor.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsMetricsMonitor.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsMetricsMonitor.java
Outdated
Show resolved
Hide resolved
1a4519d
to
43465b3
Compare
…g and queued query metrics for active load balancing, and allows defining health using minimum and maximum values for arbitrary metrics
43465b3
to
d9e5068
Compare
Add a monitor for the OpenMetrics endpoint. This populates the running and queued query metrics for active load balancing, and allows defining health using minimum and maximum values for arbitrary metrics.
Description
Add a monitor for the
/metrics
endpoint. These metrics are equivalent to those underv1/jmx
, however some organizations choose to standardize on OpenMetrics instead.A custom definition of backend health can be configured through the
metricMinimumValues
andmetricMaximumValues
settings inmonitorConfiguration
. Each of these takesmetricName, float
pairs. If the returned metric is below the min or greater than the max, the backend is considered unhealthy.Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x ) Release notes are required, with the following suggested text:
* Add OpenMetrics health monitor with customizable health definition