Skip to content

Commit ddea7f6

Browse files
authored
docs(opa): update of metrics and security content (#11307)
Signed-off-by: prmellor <[email protected]>
1 parent 80b1e8b commit ddea7f6

File tree

6 files changed

+45
-58
lines changed

6 files changed

+45
-58
lines changed

documentation/assemblies/metrics/assembly-metrics.adoc

+12-28
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,23 @@
66
= Introducing metrics
77

88
[role="_abstract"]
9-
Collecting metrics is critical for understanding the health and performance of your Kafka deployment.
10-
By monitoring metrics, you can actively identify issues before they become critical and make informed decisions about resource allocation and capacity planning. Without metrics, you may be left with limited visibility into the behavior of your Kafka deployment, which can make troubleshooting more difficult and time-consuming. Setting up metrics can save you time and resources in the long run, and help ensure the reliability of your Kafka deployment.
9+
Collecting metrics is essential for understanding the health and performance of your Kafka deployment.
10+
By monitoring metrics, you can actively identify issues before they become critical and make informed decisions about resource allocation and capacity planning.
11+
Without metrics, you may be left with limited visibility into the behavior of your Kafka deployment, which can make troubleshooting more difficult and time-consuming.
12+
Setting up metrics can save you time and resources, and help ensure the reliability of your Kafka deployment.
1113

12-
Metrics are available for each component in Strimzi, providing valuable insights into their individual performance.
13-
While other components require configuration to expose metrics, Strimzi operators automatically expose Prometheus metrics by default.
14-
These metrics include:
15-
16-
* Reconciliation count
17-
* Custom Resource count being processed
18-
* Reconciliation duration
19-
* JVM metrics
20-
21-
You can also collect metrics specific to `oauth` authentication and `opa` or `keycloak` authorization by enabling the `enableMetrics` property in the listener or authorization configuration of the `Kafka` resource.
22-
Similarly, you can enable metrics for `oauth` authentication in custom resources such as `KafkaBridge`, `KafkaConnect`, and `KafkaMirrorMaker2`.
23-
24-
You can use Prometheus and Grafana to monitor Strimzi.
25-
Prometheus consumes metrics from the running pods in your cluster when configured with Prometheus rules.
14+
Metrics can be collected from Strimzi components using Prometheus and visualized in Grafana.
15+
Prometheus collects metrics from running pods in your cluster when configured with appropriate rules.
2616
Grafana visualizes these metrics on dashboards, providing an intuitive interface for monitoring.
2717

28-
To facilitate metrics integration, Strimzi provides example Prometheus rules and Grafana dashboards for Strimzi components.
29-
You can customize the example Grafana dashboards to suit your specific deployment requirements.
30-
You can use rules to define conditions that trigger alerts based on specific metrics.
31-
32-
Depending on your monitoring requirements, you can do the following:
33-
34-
* xref:assembly-metrics-setup-{context}[Set up and deploy Prometheus to expose metrics]
35-
* xref:proc-metrics-kafka-deploy-options-{context}[Deploy Kafka Exporter to provide additional metrics]
36-
* xref:proc-metrics-grafana-dashboard-{context}[Use Grafana to present the Prometheus metrics]
18+
While the Strimzi operators expose their own Prometheus metrics by default, such as reconciliation counts and durations, JVM data, and resource processing statistics, other Strimzi components and features that support metrics, including OAuth 2.0 integration, require configuration to expose them.
3719

20+
Strimzi provides example Prometheus rules and Grafana dashboards, which you can customize to fit your deployment.
21+
These tools help visualize metrics and define alerts based on specific conditions.
3822
Additionally, you can configure your deployment to track messages end-to-end by xref:assembly-distributed-tracing-str[setting up distributed tracing].
3923

40-
NOTE: Strimzi provides example installation files for Prometheus and Grafana, which can serve as a starting point for monitoring your Strimzi deployment.
41-
For further support, try engaging with the Prometheus and Grafana developer communities.
24+
NOTE: Strimzi provides example installation files for Prometheus and Grafana to help get you started.
25+
For further support, refer to the Prometheus and Grafana developer communities.
4226

4327
.Supporting documentation for metrics and monitoring tools
4428
For more information on the metrics and monitoring tools, refer to the supporting documentation:
@@ -47,7 +31,7 @@ For more information on the metrics and monitoring tools, refer to the supportin
4731
* {PrometheusConfig}
4832
* {kafka-exporter-project}
4933
* {GrafanaHome}
50-
* link:http://kafka.apache.org/documentation/#monitoring[Apache Kafka Monitoring] describes JMX metrics exposed by Apache Kafka
34+
* link:http://kafka.apache.org/documentation/#monitoring[Apache Kafka Monitoring^] describes JMX metrics exposed by Apache Kafka
5135

5236
//what is Consumer lag?
5337
include::../../modules/metrics/con_kafka-exporter-lag.adoc[leveloffset=+1]

documentation/modules/con-common-configuration-properties.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ tls:
115115
trustedCertificates: []
116116
----
117117

118-
Similarly, you can use the `tlstrustedCertificates` property in the configuration for `oauth`, `keycloak`, and `opa` authentication and authorization types that integrate with authorization servers.
118+
Similarly, you can use the `tlsTrustedCertificates` property in the configuration for `oauth` and `keycloak` authentication and authorization types that integrate with authorization servers.
119119
The configuration sets up encrypted TLS connections to the authorization server.
120120

121121
.Example TLS encryption configuration for authentication types

documentation/modules/configuring/con-config-kafka-kraft.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ spec:
172172
<15> Healthchecks to know when to restart a container (liveness) and when a container can accept traffic (readiness).
173173
<16> JVM configuration options to optimize performance for the Virtual Machine (VM) running Kafka.
174174
<17> ADVANCED OPTION: Container image configuration, which is recommended only in special situations.
175-
<18> Authorization enables simple, OAUTH 2.0, or OPA authorization on the Kafka broker. Simple authorization uses the `AclAuthorizer` and `StandardAuthorizer` Kafka plugins.
175+
<18> Authorization enables simple, OAuth 2.0, custom, or OPA (deprecated) authorization on the Kafka broker. Simple authorization uses the `StandardAuthorizer` Kafka plugin.
176176
<19> Rack awareness configuration to spread replicas across different racks, data centers, or availability zones. The `topologyKey` must match a node label containing the rack ID. The example used in this configuration specifies a zone using the standard `{K8sZoneLabel}` label.
177177
<20> Prometheus metrics enabled. In this example, metrics are configured for the Prometheus JMX Exporter (the default metrics exporter).
178178
<21> Rules for exporting metrics in Prometheus format to a Grafana dashboard through the Prometheus JMX Exporter, which are enabled by referencing a ConfigMap containing configuration for the Prometheus JMX exporter. You can enable metrics without further configuration using a reference to a ConfigMap containing an empty file under `metricsConfig.valueFrom.configMapKeyRef.key`.

documentation/modules/metrics/proc-metrics-kafka-deploy-options.adoc

+29-25
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,31 @@
66
= Enabling Prometheus metrics through configuration
77

88
[role="_abstract"]
9-
To enable and expose metrics in Strimzi for Prometheus, use metrics configuration properties.
9+
To enable and expose metrics in Strimzi for Prometheus, configure the appropriate properties in the custom resources for the components you want to monitor.
1010

11-
The following components require `metricsConfig` configuration to expose metrics:
11+
Use `metricsConfig` to expose metrics for these components:
1212

1313
* Kafka
14-
* KafkaConnect
14+
* Kafka Connect
1515
* MirrorMaker
1616
* Cruise Control
1717

18-
This configuration enables the {JMXExporter} to expose metrics through an HTTP endpoint.
19-
The port for the JMX exporter HTTP endpoint is 9404.
18+
This enables the {JMXExporter}, which exposes metrics on port 9404 through an HTTP endpoint.
2019
Prometheus scrapes this endpoint to collect Kafka metrics.
2120

22-
Set the `enableMetrics` property to `true` in order to expose metrics for these components:
21+
Set `enableMetrics` to `true` to expose metrics for the following:
2322

24-
* Kafka Bridge
25-
* OAuth 2.0 authentication and authorization framework
26-
* Open Policy Agent (OPA) for authorization
23+
* Kafka Bridge
24+
* OAuth 2.0
25+
** Configure in the `Kafka` resource for `oauth` or `keycloak` cluster authorization, or `oauth` listener authentication.
26+
** Configure in the `KafkaBridge`, `KafkaConnect`, or `KafkaMirrorMaker2` resources for `oauth` authentication.
2727

28-
To deploy Prometheus metrics configuration in Strimzi, you can use your own configuration or the xref:ref-metrics-prometheus-metrics-config-{context}[example custom resource configuration files] provided with Strimzi:
28+
To include xref:con-metrics-kafka-exporter-lag-str[Kafka Exporter] metrics, add `kafkaExporter` configuration to the `Kafka` resource.
29+
30+
IMPORTANT: Kafka Exporter provides additional metrics for consumer lag and offsets only.
31+
You still need to configure Prometheus metrics in the `Kafka` resource to collect standard Kafka metrics.
32+
33+
You can create your own Prometheus configuration or use the xref:ref-metrics-prometheus-metrics-config-{context}[example custom resource files] provided with Strimzi:
2934

3035
* `kafka-metrics.yaml`
3136
* `kafka-connect-metrics.yaml`
@@ -34,16 +39,10 @@ To deploy Prometheus metrics configuration in Strimzi, you can use your own conf
3439
* `kafka-cruise-control-metrics.yaml`
3540
* `oauth-metrics.yaml`
3641

37-
These files contain the necessary relabeling rules and configuration to enable Prometheus metrics.
38-
They are a good starting point for trying Prometheus with Strimzi.
39-
40-
This procedure shows how to deploy example Prometheus metrics configuration in the `Kafka` resource.
41-
The process is the same when deploying the example files for other resources.
42+
These files include relabeling rules and example metrics configuration, and are a good starting point for trying Prometheus with Strimzi.
4243

43-
If you wish to include xref:con-metrics-kafka-exporter-lag-str[Kafka Exporter] metrics, add `kafkaExporter` configuration to your `Kafka` resource.
44-
45-
IMPORTANT: Kafka Exporter only provides additional metrics related to consumer lag and consumer offsets.
46-
For regular Kafka metrics, configure Prometheus metrics in the `Kafka` resource.
44+
This procedure shows how to deploy example Prometheus metrics configuration to the `Kafka` resource.
45+
The same steps apply when deploying the example files for other resources.
4746

4847
.Procedure
4948

@@ -180,17 +179,18 @@ spec:
180179
# ...
181180
----
182181

183-
.Enabling metrics for OAuth 2.0 and OPA
182+
.Enabling metrics for OAuth 2.0
184183

185-
To expose metrics for OAuth 2.0 or OPA, set the `enableMetrics` property to `true` in the appropriate custom resource.
184+
To expose metrics for OAuth 2.0, set the `enableMetrics` property to `true` in the appropriate custom resource.
186185

187-
OAuth 2.0 metrics:: Enable metrics for Kafka cluster authorization and Kafka listener authentication in the `Kafka` resource.
188-
You can also enable metrics for OAuth 2.0 authentication in the custom resource of other xref:proc-oauth-kafka-config-{context}[supported components].
189-
OPA metrics:: Enable metrics for Kafka cluster authorization in the `Kafka` resource similar to OAuth 2.0.
186+
* In the Kafka resource for:
187+
** Cluster authorization (`oauth` or `keycloak`)
188+
** Listener authentication (`oauth` only)
189+
* In the `KafkaBridge`, `KafkaConnect`, or `KafkaMirrorMaker2` resources for `oauth` authentication
190190

191191
In the following example, metrics are enabled for OAuth 2.0 listener authentication and OAuth 2.0 (`keycloak`) cluster authorization.
192192

193-
.Example cluster configuration with metrics enabled for OAuth 2.0
193+
.Example configuration with OAuth 2.0 metrics enabled
194194
[source,yaml,subs="+quotes,attributes"]
195195
----
196196
apiVersion: {KafkaApiVersion}
@@ -219,4 +219,8 @@ spec:
219219

220220
To use OAuth 2.0 metrics with Prometheus, copy the `ConfigMap` configuration from the `oauth-metrics.yaml` file to the same `Kafka` resource configuration file where you enabled metrics for OAuth 2.0 and then apply the configuration.
221221

222+
NOTE: You can also enable metrics for the `type: opa` authorization option in the same way as for OAuth 2.0 authorization.
223+
However, `type: opa` is deprecated and will be removed in a future release.
224+
To continue using the Open Policy Agent authorizer, use the `type: custom` authorization configuration.
225+
222226

documentation/modules/overview/con-security-overview.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Supported authorization mechanisms:
3232
+
3333
* Simple authorization using ACL rules
3434
* OAuth 2.0 authorization (if you are using OAuth 2.0 token-based authentication)
35-
* Open Policy Agent (OPA) authorization
35+
* Open Policy Agent (OPA) authorization (deprecated)
3636
* Custom authorization (supported by Kafka)
3737

3838
Federal Information Processing Standards (FIPS):: Strimzi is designed to run on FIPS-enabled Kubernetes clusters to ensure data security and system interoperability.

documentation/modules/security/con-securing-client-authorization.adoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ The simple authorization uses the Kafka Admin API to manage the ACL rules inside
1515
Whether ACL management in the User Operator is enabled or not depends on your authorization configuration in the Kafka cluster.
1616

1717
* For simple authorization, ACL management is always enabled.
18-
* For OPA authorization, ACL management is always disabled.
19-
Authorization rules are configured in the OPA server.
18+
* For OPA authorization (deprecated), ACL management is always disabled.
2019
* For Keycloak authorization, you can manage the ACL rules directly in Keycloak.
2120
You can also delegate authorization to the simple authorizer as a fallback option in the configuration.
2221
When delegation to the simple authorizer is enabled, the User Operator will enable management of ACL rules as well.

0 commit comments

Comments
 (0)