Skip to content

Latest commit

 

History

History
450 lines (397 loc) · 14.7 KB

FlowMetric.md

File metadata and controls

450 lines (397 loc) · 14.7 KB

API Reference

Packages:

flows.netobserv.io/v1alpha1

Resource Types:

FlowMetric

↩ Parent

FlowMetric is the API allowing to create custom metrics from the collected flow logs.

Name Type Description Required
apiVersion string flows.netobserv.io/v1alpha1 true
kind string FlowMetric true
metadata object Refer to the Kubernetes API documentation for the fields of the `metadata` field. true
spec object FlowMetricSpec defines the desired state of FlowMetric The provided API allows you to customize these metrics according to your needs.
When adding new metrics or modifying existing labels, you must carefully monitor the memory usage of Prometheus workloads as this could potentially have a high impact. Cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric
To check the cardinality of all NetObserv metrics, run as `promql`: `count({__name__=~"netobserv.*"}) by (__name__)`.
false
status object FlowMetricStatus defines the observed state of FlowMetric
false

FlowMetric.spec

↩ Parent

FlowMetricSpec defines the desired state of FlowMetric The provided API allows you to customize these metrics according to your needs.
When adding new metrics or modifying existing labels, you must carefully monitor the memory usage of Prometheus workloads as this could potentially have a high impact. Cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric
To check the cardinality of all NetObserv metrics, run as promql: count({__name__=~"netobserv.*"}) by (__name__).

Name Type Description Required
metricName string Name of the metric. In Prometheus, it is automatically prefixed with "netobserv_".
true
type enum Metric type: "Counter" or "Histogram". Use "Counter" for any value that increases over time and on which you can compute a rate, such as Bytes or Packets. Use "Histogram" for any value that must be sampled independently, such as latencies.

Enum: Counter, Histogram
true
buckets []string A list of buckets to use when `type` is "Histogram". The list must be parsable as floats. When not set, Prometheus default buckets are used.
false
charts []object Charts configuration, for the OpenShift Console in the administrator view, Dashboards menu.
false
direction enum Filter for ingress, egress or any direction flows. When set to `Ingress`, it is equivalent to adding the regular expression filter on `FlowDirection`: `0|2`. When set to `Egress`, it is equivalent to adding the regular expression filter on `FlowDirection`: `1|2`.

Enum: Any, Egress, Ingress
Default: Any
false
divider string When nonzero, scale factor (divider) of the value. Metric value = Flow value / Divider.
false
filters []object `filters` is a list of fields and values used to restrict which flows are taken into account. Oftentimes, these filters must be used to eliminate duplicates: `Duplicate != "true"` and `FlowDirection = "0"`. Refer to the documentation for the list of available fields: https://docs.openshift.com/container-platform/latest/observability/network_observability/json-flows-format-reference.html.
false
labels []string `labels` is a list of fields that should be used as Prometheus labels, also known as dimensions. From choosing labels results the level of granularity of this metric, and the available aggregations at query time. It must be done carefully as it impacts the metric cardinality (cf https://rhobs-handbook.netlify.app/products/openshiftmonitoring/telemetry.md/#what-is-the-cardinality-of-a-metric). In general, avoid setting very high cardinality labels such as IP or MAC addresses. "SrcK8S_OwnerName" or "DstK8S_OwnerName" should be preferred over "SrcK8S_Name" or "DstK8S_Name" as much as possible. Refer to the documentation for the list of available fields: https://docs.openshift.com/container-platform/latest/observability/network_observability/json-flows-format-reference.html.
false
remap map[string]string Set the `remap` property to use different names for the generated metric labels than the flow fields. Use the origin flow fields as keys, and the desired label names as values.
false
valueField string `valueField` is the flow field that must be used as a value for this metric. This field must hold numeric values. Leave empty to count flows rather than a specific value per flow. Refer to the documentation for the list of available fields: https://docs.openshift.com/container-platform/latest/observability/network_observability/json-flows-format-reference.html.
false

FlowMetric.spec.charts[index]

↩ Parent

Configures charts / dashboard generation associated to a metric

Name Type Description Required
dashboardName string Name of the containing dashboard. If this name does not refer to an existing dashboard, a new dashboard is created.

Default: Main
true
queries []object List of queries to be displayed on this chart. If `type` is `SingleStat` and multiple queries are provided, this chart is automatically expanded in several panels (one per query).
true
title string Title of the chart.
true
type enum Type of the chart.

Enum: SingleStat, Line, StackArea
true
sectionName string Name of the containing dashboard section. If this name does not refer to an existing section, a new section is created. If `sectionName` is omitted or empty, the chart is placed in the global top section.
false
unit enum Unit of this chart. Only a few units are currently supported. Leave empty to use generic number.

Enum: bytes, seconds, Bps, pps, percent,
false

FlowMetric.spec.charts[index].queries[index]

↩ Parent

Configures PromQL queries

Name Type Description Required
legend string The query legend that applies to each timeseries represented in this chart. When multiple timeseries are displayed, you should set a legend that distinguishes each of them. It can be done with the following format: `{{ Label }}`. For example, if the `promQL` groups timeseries per label such as: `sum(rate($METRIC[2m])) by (Label1, Label2)`, you may write as the legend: `Label1={{ Label1 }}, Label2={{ Label2 }}`.
true
promQL string The `promQL` query to be run against Prometheus. If the chart `type` is `SingleStat`, this query should only return a single timeseries. For other types, a top 7 is displayed. You can use `$METRIC` to refer to the metric defined in this resource. For example: `sum(rate($METRIC[2m]))`. To learn more about `promQL`, refer to the Prometheus documentation: https://prometheus.io/docs/prometheus/latest/querying/basics/
true
top integer Top N series to display per timestamp. Does not apply to `SingleStat` chart type.

Default: 7
Minimum: 1
true

FlowMetric.spec.filters[index]

↩ Parent

Name Type Description Required
field string Name of the field to filter on
true
matchType enum Type of matching to apply

Enum: Equal, NotEqual, Presence, Absence, MatchRegex, NotMatchRegex
Default: Equal
true
value string Value to filter on. When `matchType` is `Equal` or `NotEqual`, you can use field injection with `$(SomeField)` to refer to any other field of the flow.
false

FlowMetric.status

↩ Parent

FlowMetricStatus defines the observed state of FlowMetric

Name Type Description Required
conditions []object `conditions` represent the latest available observations of an object's state
true

FlowMetric.status.conditions[index]

↩ Parent

Condition contains details for one aspect of the current state of this API Resource.

Name Type Description Required
lastTransitionTime string lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.

Format: date-time
true
message string message is a human readable message indicating details about the transition. This may be an empty string.
true
reason string reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
true
status enum status of the condition, one of True, False, Unknown.

Enum: True, False, Unknown
true
type string type of condition in CamelCase or in foo.example.com/CamelCase.
true
observedGeneration integer observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.

Format: int64
Minimum: 0
false