Skip to content

Implemented OTLP for the metrics crate to standardize metrics collection#191

Merged
LorenzoTettamanti merged 18 commits into
CortexFlow:0.1.5from
LorenzoTettamanti:0.1.5-refactor
Jun 5, 2026
Merged

Implemented OTLP for the metrics crate to standardize metrics collection#191
LorenzoTettamanti merged 18 commits into
CortexFlow:0.1.5from
LorenzoTettamanti:0.1.5-refactor

Conversation

@LorenzoTettamanti

@LorenzoTettamanti LorenzoTettamanti commented Jun 1, 2026

Copy link
Copy Markdown
Member

Changes

  • Implemented OTLP protocol for the metrics service
  • metrics.yaml and otel-agent.yaml
  • Introduced otel_init.rs and otel_metrics.rs to handle the otel initialization and the collection of metrics in modo efficiente

Metrics:

Metrics Type Description
events_total Counter<u64> Total number of eBPF events processed across all perf buffers
packets_total Counter<u64> Total number of network-related events produced by the net_metrics
sk_drops Gauge<i64> Observed socket drop count (sk_drops) from the kernel sock struct.
sk_err Gauge<i64> Observed socket error count (sk_err) from the kernel sock struct.
delta_us Histogram<u64> Histogram of delta_us values supplied by the time_stamp_events perf buffer.
ts_us Histogram<u64> Histogram of ts_us values seen in both net_metrics and time_stamp_events

Testing:

environment: minikube with --cni=cilium --driver= docker
metrics_image: lorenzotettamanti/cortexflow-metrics:otel-test-1

Schermata del 2026-06-01 21-25-31

you should see a MetricsExporter in the otel-agent pod

LorenzoTettamanti and others added 17 commits February 8, 2026 21:10
…map handling and added read_perf_buffer function
…ed imports. Added error handling in event listener
…esses vector is empty. Added comments and annotations
…_VETH). The shared map is used to store the veth names and the status (attached or not) during the startup
….rs. Simplified buffers filling and buffer initialization
…ing opentelemetry sdk. added srtruct Metrics to group all the metrics in one place. added auxiliary functions record_network_metrics and record_timestamp_metrics. added exporter setting in buffer_type/read_network_metrics and buffer_type/read_timestamp_metrics
… ConfigMap. Added updated image in the metrics.yaml with the new implementations
@LorenzoTettamanti LorenzoTettamanti marked this pull request as ready for review June 1, 2026 19:28
@LorenzoTettamanti LorenzoTettamanti requested a review from siddh34 June 1, 2026 19:28
@LorenzoTettamanti LorenzoTettamanti self-assigned this Jun 1, 2026
@LorenzoTettamanti LorenzoTettamanti added enhancement New feature or request rust Pull requests that update Rust code ebpf eBPF related tasks labels Jun 1, 2026
@LorenzoTettamanti LorenzoTettamanti moved this to In Progress in CortexFlow v0.1 Jun 1, 2026
@siddh34

siddh34 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

@LorenzoTettamanti

I'm unable to run metrics image here

manifest for lorenzotettamanti/cortexflow-metrics:otel-test-1

{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 1243,
"digest": "sha256:de99d019f806bff96b53548c8804c4e419bd77a5148afdfdeace6439c290075d",
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 564,
"digest": "sha256:ae33194edaef7f03fea1b0ec46a84c1e5c40e8ba634e7fae1f9444d70a6833ce",
"platform": {
"architecture": "unknown",
"os": "unknown"
}
}
]
}

Manifest for lorenzotettamanti/cortexflow-identity:0.1.2

{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"size": 2971,
"digest": "sha256:e942e039853eb1dd03c8d0509dc23df1209d060127ae74d8a19f16b59c036f39"
},
"layers": [
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 30595557,
"digest": "sha256:e93fce65fb9fdbf95d95433f0a49637000c985ffab1470a3bd7dc626ac7f1c06"
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 1050612,
"digest": "sha256:2b8f9011290366c4a49905e10bc0098f7aa915e7c0709327757d914f5fc2dba5"
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 156,
"digest": "sha256:0e09eaf03e1de2644d952e5f95139d30db617864e5f335d2ba3f09a8def9cb29"
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 4749693,
"digest": "sha256:2cb1c84cd6acdfcd6f70433abf78970c6c17fdf18fa7a28a6383ce86d09a85d9"
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 3721,
"digest": "sha256:377d1f65347f243187104bf1bcf15666dee9d582d11c030d198d1f249f52709e"
}
]
}

could you please check it?

@LorenzoTettamanti

Copy link
Copy Markdown
Member Author

@siddh34 I've tried to follow this discussion. I set the --provenance=false and the --sbom=false in the build command.

The new image is this: lorenzotettamanti/cortexflow-metrics:otel-test-2

Comment thread core/src/testing/metrics.yaml Outdated
containers:
- name: metrics
image: lorenzotettamanti/cortexflow-metrics:0.1.2-test12
image: lorenzotettamanti/cortexflow-metrics:otel-test-1

@siddh34 siddh34 Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please replace with otel-test-2

it is working fine

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@siddh34

siddh34 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

@LorenzoTettamanti otel is working fine

from metrics pod

image

from identity pod

image

from otel agent pod

image

@LorenzoTettamanti

Copy link
Copy Markdown
Member Author

@siddh34 I'm merging the changes and i'm closing issue #175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ebpf eBPF related tasks enhancement New feature or request rust Pull requests that update Rust code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants