|
5 | 5 | :_mod-docs-content-type: PROCEDURE
|
6 | 6 | [id="network-observability-configuring-custom-metrics_{context}"]
|
7 | 7 | = Configuring custom metrics by using FlowMetric API
|
| 8 | + |
8 | 9 | You can configure the `FlowMetric` API to create custom metrics by using flowlogs data fields as Prometheus labels. You can add multiple `FlowMetric` resources to a project to see multiple dashboard views.
|
9 | 10 |
|
10 | 11 | .Procedure
|
11 | 12 |
|
12 | 13 | . In the web console, navigate to *Operators* -> *Installed Operators*.
|
13 | 14 | . In the *Provided APIs* heading for the *NetObserv Operator*, select *FlowMetric*.
|
14 |
| -. In the *Project:* dropdown list, select the project of the Network Observability Operator instance. |
| 15 | +. In the *Project:* dropdown list, select the project of the Network Observability Operator instance. |
15 | 16 | . Click *Create FlowMetric*.
|
16 | 17 | . Configure the `FlowMetric` resource, similar to the following sample configurations:
|
17 | 18 | +
|
|
36 | 37 | matchType: Absence
|
37 | 38 | ----
|
38 | 39 | <1> The `FlowMetric` resources need to be created in the namespace defined in the `FlowCollector` `spec.namespace`, which is `netobserv` by default.
|
39 |
| -<2> The name of the Prometheus metric, which in the web console appears with the prefix `netobserv-<metricName>`. |
| 40 | +<2> The name of the Prometheus metric, which in the web console appears with the prefix `netobserv-<metricName>`. |
40 | 41 | <3> The `type` specifies the type of metric. The `Counter` `type` is useful for counting bytes or packets.
|
41 |
| -<4> The direction of traffic to capture. If not specified, both ingress and egress are captured, which can lead to duplicated counts. |
| 42 | +<4> The direction of traffic to capture. If not specified, both ingress and egress are captured, which can lead to duplicated counts. |
42 | 43 | <5> Labels define what the metrics look like and the relationship between the different entities and also define the metrics cardinality. For example, `SrcK8S_Name` is a high cardinality metric.
|
43 | 44 | <6> Refines results based on the listed criteria. In this example, selecting only the cluster external traffic is done by matching only flows where `SrcSubnetLabel` is absent. This assumes the subnet labels feature is enabled (via `spec.processor.subnetLabels`), which is done by default.
|
44 | 45 |
|
|
78 | 79 |
|
79 | 80 | .Verification
|
80 | 81 | . Once the pods refresh, navigate to *Observe* -> *Metrics*.
|
81 |
| -. In the *Expression* field, you can type the metric name to view the corresponding result. |
| 82 | +. In the *Expression* field, you can type the metric name to view the corresponding result. |
82 | 83 | ====
|
83 | 84 |
|
84 | 85 |
|
|
0 commit comments