-
Notifications
You must be signed in to change notification settings - Fork 20
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
MGDSTRM-10557: Expose strimzi oauth metrics prometheus in order to assist investigating a slow authentication issue #910
Conversation
… sporadic slow authentications Signed-off-by: kwall <kwall@apache.org>
@@ -554,6 +562,15 @@ private KafkaClusterTemplate buildKafkaTemplate(ManagedKafka managedKafka, int r | |||
return templateBuilder.build(); | |||
} | |||
|
|||
private List<ContainerEnvVar> buildKafkaContainerEnvVars(ManagedKafka managedKafka) { | |||
var kafkaOverride = this.overrideManager.getKafkaOverride(managedKafka.getSpec().getVersions().getStrimzi()); |
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 tried approaches introducing an env var type parameter to OperandOverride<E>
) etc but the resulting code applyEnvironmentTo
in less obvious that this list conversion in the method.
Kudos, SonarCloud Quality Gate passed! |
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.
One small comment/question, but looks good to me.
- pattern: "strimzi.oauth<type=(.+), context=(.+), kind=(.+), host=\"(.+)\", path=\"(.+)\", (.+)=(.+), (.+)=(.+), (.+)=(.+)><>(count|totalTimeMs):" | ||
name: "strimzi_oauth_$1_$12" | ||
type: COUNTER | ||
labels: | ||
context: "$2" | ||
kind: "$3" | ||
host: "$4" | ||
path: "$5" | ||
"$6": "$7" | ||
"$8": "$9" | ||
"$10": "$11" | ||
- pattern: "strimzi.oauth<type=(.+), context=(.+), kind=(.+), host=\"(.+)\", path=\"(.+)\", (.+)=(.+), (.+)=(.+)><>(count|totalTimeMs):" | ||
name: "strimzi_oauth_$1_$10" | ||
type: COUNTER | ||
labels: | ||
context: "$2" | ||
kind: "$3" | ||
host: "$4" | ||
path: "$5" | ||
"$6": "$7" | ||
"$8": "$9" | ||
- pattern: "strimzi.oauth<type=(.+), context=(.+), kind=(.+), host=\"(.+)\", path=\"(.+)\", (.+)=(.+)><>(count|totalTimeMs):" | ||
name: "strimzi_oauth_$1_$8" | ||
type: COUNTER | ||
labels: | ||
context: "$2" | ||
kind: "$3" | ||
host: "$4" | ||
path: "$5" | ||
"$6": "$7" |
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 wonder if these three entries are redundant? The 3 patterns below look like more generalised forms that would also cover these cases?
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.
No, they won't be redundant. They are matching different forms. The number of groups is different in each case.
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 had counted the number of groups in each case, and they appeared to be the same is what I meant. 🙂 It seems like the actual difference is that the above 3 entries are counters, while the below 3 are gauges. Here's a diff tool view with the above on the left, and the below on the right. Lines with differences are those in blue, with the actual differences on those lines highlighted in a slightly lighter blue:
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.
LGTM 👍
I also needed to apply the override mechanism to the kafka container in order to set kafka container environment variables, so I can actually turn on strimzi oauth metrics. The work for this part is a separate commit.
Here are screenshots showing the new metrics, demonstrating that the end to end is working.