Skip to content

Commit

Permalink
Documenting inter-zone traffic (#1696)
Browse files Browse the repository at this point in the history
* Documenting inter-zone traffic

* reverting unwanted table autoformats

* Make vale happy

* Nikola and Sean corrections
  • Loading branch information
mariomac authored Feb 27, 2025
1 parent 2ded441 commit 241e11f
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/sources/configure/export-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Beyla uses lowercase fields for YAML configuration and uppercase names for envir
| `OTEL_EXPORTER_OTLP_PROTOCOL` | Similar to the shared endpoint, the protocol for metrics and traces. | string | Inferred from port usage |
| `insecure_skip_verify`<br>`BEYLA_OTEL_INSECURE_SKIP_VERIFY` | If `true`, Beyla skips verifying and accepts any server certificate. Only override this setting for non-production environments. | boolean | `false` |
| `interval`<br>`BEYLA_METRICS_INTERVAL` | The duration between exports. | Duration | `60s` |
| `features`<br>`BEYLA_OTEL_METRICS_FEATURES` | The list of metric groups Beyla exports data for, refer to [metrics export features](#metrics-export-features). Accepted values `application`, `application_span`, `application_service_graph`, `application_process`, and `network`. | list of strings | `["application"]` |
| `features`<br>`BEYLA_OTEL_METRICS_FEATURES` | The list of metric groups Beyla exports data for, refer to [metrics export features](#metrics-export-features). Accepted values `application`, `application_span`, `application_service_graph`, `application_process`, `network` and `network_inter_zone`. | list of strings | `["application"]` |
| `allow_service_graph_self_references`<br>`BEYLA_OTEL_ALLOW_SERVICE_GRAPH_SELF_REFERENCES` | Does Beyla include self-referencing service in service graph generation, for example a service that calls itself. Self referencing isn't useful service graphs and increases data cardinality. | boolean | `false` |
| `instrumentations`<br>`BEYLA_OTEL_METRICS_INSTRUMENTATIONS` | The list of metrics instrumentation Beyla collects data for, refer to [metrics instrumentation](#metrics-instrumentation) section. | list of strings | `["*"]` |
| `buckets` | Sets how you can override bucket boundaries of diverse histograms, refer to [override histogram buckets]({{< relref "./metrics-histograms.md" >}}). | (n/a) | Object |
Expand Down Expand Up @@ -217,7 +217,7 @@ of Beyla: application-level metrics or network metrics.
discovery is the best choice for service graph metrics.
- If the list contains `application_process`, the Beyla Prometheus exporter exports metrics about the processes that
run the instrumented application.
- If the list contains `network`, the Beyla Prometheus exporter exports network-level
- If the list contains `network` or `network_inter_zone`, the Beyla Prometheus exporter exports network-level
metrics; but only if the Prometheus `port` property is defined. For network-level metrics options visit the
[network metrics]({{< relref "../network" >}}) configuration documentation.

Expand Down
20 changes: 15 additions & 5 deletions docs/sources/network/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ To get started using Beyla networking metrics, consult the [quickstart setup doc

## Metric attributes

Network metrics provides a single metric:
Beyla provides two families of network metrics:

- `beyla.network.flow.bytes`, if it is exported via OpenTelemetry.
- `beyla_network_flow_bytes_total`, if it is exported by a Prometheus endpoint.
* **Network flow bytes** as the number of bytes observed between two network endpoints.
- `beyla.network.flow.bytes`, if it is exported via OpenTelemetry.
- `beyla_network_flow_bytes_total`, if it is exported by a Prometheus endpoint.
- To enable it, add the `network` option to the [BEYLA_OTEL_METRICS_FEATURES or BEYLA_PROMETHEUS_FEATURES]({{< relref "../configure/export-data.md" >}}) configuration option.
* **Inter-zone bytes** as the number of bytes observed between two network endpoints in different Cloud Availability Zones.
- `beyla.network.inter.zone.bytes`, if it is exported via OpenTelemetry.
- `beyla_network_inter_zone_bytes_total`, if it is exported by a Prometheus endpoint.
- More information about how to enable it in the [Measuring traffic between Cloud availability zones]({{< relref "./inter-az.md" >}}) documentation.

The metric represents a counter of the Number of bytes observed between two network endpoints, and can have the attributes in the following table.
Network metric can have the attributes in the following table.

By default, only the following attributes are reported: `k8s.src.owner.name`, `k8s.src.namespace`, `k8s.dst.owner.name`, `k8s.dst.namespace`, and `k8s.cluster.name`.
By default, only the following attributes are reported for network flow bytes: `k8s.src.owner.name`, `k8s.src.namespace`, `k8s.dst.owner.name`, `k8s.dst.namespace`, and `k8s.cluster.name`.

For the inter-zone bytes metric, the default attributes are `k8s.cluster.name`, `src.zone` and `dst.zone`.

| Attribute name (OpenTelemetry / Prometheus) | Description |
|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down Expand Up @@ -55,6 +63,8 @@ By default, only the following attributes are reported: `k8s.src.owner.name`, `k
| `k8s.src.node.name` / `k8s_src.node_name` | Name of the source Node |
| `k8s.dst.node.name` / `k8s_dst.node_name` | Name of the destination Node |
| `k8s.cluster.name` / `k8s_cluster_name` | Name of the Kubernetes cluster. Beyla can auto-detect it on Google Cloud, Microsoft Azure, and Amazon Web Services. For other providers, set the `BEYLA_KUBE_CLUSTER_NAME` property |
| `src.zone` / `src_zone` | Name of the source Cloud Availability Zone |
| `dsg.zone` / `dst_zone` | Name of the destination Cloud Availability Zone |

### How to specify reported attributes

Expand Down
94 changes: 94 additions & 0 deletions docs/sources/network/inter-az.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
title: Measure traffic between Cloud availability zones
menuTitle: Measure traffic between Cloud availability zones
description: How to measure the network traffic between different Cloud availability zones
weight: 1
keywords:
- Beyla
- eBPF
- Network
---

# Measure traffic between Cloud availability zones

{{< admonition type="note" >}}
This feature is currently only available in Kubernetes clusters.
{{< /admonition >}}

Traffic between Cloud Availability Zones might incur additional costs. Beyla is able to measure it either by
adding `src.zone` and `dst.zone` attributes to regular network metrics,
or by providing a separate `beyla.network.inter.zone.bytes` (OTEL) / `beyla_network_inter_zone_bytes_total` (Prometheus)
metric.

## Add `src.zone` and `dst.zone` attributes to regular network metrics

Source and destination availability zone attributes are disabled by default in Beyla. To enable it, explicitly add them to the list of
included network attributes in the Beyla YAML configuration:

```
attributes:
select:
beyla_network_flow_bytes:
include:
- k8s.src.owner.name
- k8s.src.namespace
- k8s.dst.owner.name
- k8s.dst.namespace
- k8s.cluster.name
- src.zone
- dst.zone
```

This configuration makes inter-zone traffic visible for each `beyla_network_flow_bytes_total` metric
with different `src_zone` and `dst_zone` attributes.

If you require higher granularity in your inter-zone traffic measurement (for example, source/destination pods or nodes),
adding zone attributes would impact the cardinality of the metric, even for traffic within the same availability zone.

## Use the `beyla.network.inter.zone` metric

Using a separate metric for inter-zone traffic reduces the metric cardinality impact of collecting this data,
because the `src.zone` and `dst.zone` attributes are not added to the regular network metrics.

To enable the `beyla.network.inter.zone` metric, add the `network_inter_zone` option to the
[BEYLA_OTEL_METRICS_FEATURES or BEYLA_PROMETHEUS_FEATURES]({{< relref "../configure/export-data.md" >}}) configuration option,
or its equivalent YAML options. For example, if Beyla is configured to export metrics via OpenTelemetry:

```yaml
otel_metrics_export:
features:
- network
- network_inter_zone
```
## PromQL queries to measure inter-zone traffic
Assuming that both `network` and `network_inter_zone` metric families are enabled, you can use the following PromQL queries
to measure inter-zone traffic:

Overall inter-zone traffic throughput:

```
sum(rate(beyla_network_inter_zone_bytes_total[$__rate_interval]))
```

Inter-zone traffic throughput, summarized by source and destination zones:
```
sum(rate(beyla_network_inter_zone_bytes_total[$__rate_interval])) by(src_zone,dst_zone)
```

Overall same-zone traffic throughput:

```
sum(rate(beyla_network_flow_bytes_total[$__rate_interval]))
- sum(rate(beyla_network_inter_zone_bytes_total[$__rate_interval]))
```

Percentage of inter-zone traffic from the total:

```
100 * sum(rate(beyla_network_inter_zone_bytes_total[$__rate_interval]))
/ sum(rate(beyla_network_flow_bytes_total[$__rate_interval]))
```


0 comments on commit 241e11f

Please sign in to comment.