Commit Graph

510 Commits

Author SHA1 Message Date
AGSaidi ae3083a549
feat: start implementing arm64 support (#313) 2025-09-04 14:15:26 -05:00
Jonathan Perry 5e07f9d687
fix: update release github workflow (#365)
* fix permissions in out directory

* use a local registry to communicate containers from build to github actions
2025-08-19 23:36:20 -05:00
Jonathan Perry f13c89ad63
build: bump version to 0.11.0 (#364) 2025-08-19 15:53:39 -05:00
renovate[bot] 43fafe224e
chore(deps): update debian:bookworm docker digest to 731dd13 (#358) 2025-08-14 01:58:42 -05:00
Victor_Canard e7dadc986d
feat(kernel-collector): Support AWS IMDSv2 with IMDSv1 fallback (#357)
The kernel-collector currently fails to retrieve instance metadata on modern AWS EC2 instances where IMDSv1 is disabled by default. This makes the collector non-functional in a standard, secure AWS environment.

This fix introduces support for IMDSv2 while maintaining backward compatibility with IMDSv1.

The implementation follows this logic:
- A short-lived (2-second timeout) PUT request is made to the IMDSv2 token endpoint to fetch a session token.
- If a token is successfully retrieved, it is used in the 'X-aws-ec2-metadata-token' header for all subsequent metadata requests, which are directed to the IMDSv2 '/latest/' endpoints.
- If the token request fails (due to timeout, network error, or IMDSv1-only environment), the system gracefully falls back to the original IMDSv1 behavior, making requests without the token to the '/2016-09-02/' endpoints.

Fixes: #356
2025-08-13 08:49:29 -05:00
renovate[bot] 164d510f0f
chore(deps): update all patch versions (#336) 2025-08-11 11:12:02 -05:00
renovate[bot] e573ade50f
chore(deps): update docker/login-action action to v3.5.0 (#354) 2025-08-11 11:11:14 -05:00
renovate[bot] d9ec046e59
chore(deps): update actions/download-artifact action to v5 (#355) 2025-08-11 11:10:26 -05:00
Jonathan Perry 2458282067
fix(nat): add nat existing kprobe with exported symbol (#353) 2025-08-10 14:51:14 -05:00
renovate[bot] 65b256357b
chore(deps): update softprops/action-gh-release digest to f82d31e (#351)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-10 05:15:50 -05:00
renovate[bot] 869319daaf
chore(deps): update docker.io/bitnami/minideb:bookworm docker digest to c08bf19 (#352)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-10 05:13:38 -05:00
Jonathan Perry a3dabc3ebb
feat(kernel-collector)!: support CO-RE (compile once run everywhere) by transitioning from bcc to libbpf (#350)
* add vmlinux.h submodule

* add libbpf cmake target and switch #includes to vmlinux.h

* fix static assert for clang / libbpf

* add missing include

* update the kernel version macros

* fix map definitions and their accessors

* fix perf ring event output in renderc

* fix include directory

* fix bpf_log line output

* refactor checking the error codes in bpf_map_lookup_elem to keep the same behavior

* remove old checking of delete unexpected return value

* migrate calls for ntohs to bpf_ntohs helper macros

* solve integer to non-integer cast warning with explicit cast

* migrate BPF_PROG_ARRAY to libbpf

* migrate tail calls

* add networking macros not in vmlinux.h

* add bpf_tracing.h helpers for PT_REGS_PARM

* solve unsigned-to-signed assignment warning

* migrate htons (we only changed ntohs earlier)

* port tcp processor's rings

* migrate DNS perf event output

* add another define for a macro missing from vmlinux.h

* port dns_message_array

* solve errors for missing define

* solve signed-unsigned conversion warnings

* add some netfilter structs missing from vmlinux.h

* move added kernel structs to vmlinux_extensions.h and added doc

* fix string_starts_with without strlen

* add structs from previous versions

* solve multiple kernel version compatibility and missing definition errors

* fix enum read from cgroup_subsys_id

* add enum declaration for cgroup_subsys_id

* convert another bcc map lookup to libbpf format

* remove preserve_access_index attribute from enum (not allowed)

* support configuration of constants using libbpf global variables. max_pid needs to be constant however

* fix string_starts_with

* fix number of parameters by inlining

* fix bpf_log exceeding number of function parameters by encoding fields onto stack to pass to bpf_log

* support functions with many parameters

* migrate userspace code to libbpf

* more migration work
 Please enter the commit message for your changes. Lines starting

* use forward declaration for the skeleton where possible

* removed redundant includes of the skel file

* clang-format

* reorder #includes for correct ordering

* fix the too long prototype for tcp_recvmsg

* fix permission check to use libbpf

* run clang-format

* add SEC annotations to bpf programs

* remove kernel header fetching

* update kernel header test to just run the collector

* run clang format

* statically link against libbpf

* add libelf1 to kernel collector dockerfile

* run a reducer when testing the kernel collector

* remove kernel fetching from the kernel-collector-test, add libelf1

* do not cancel running workflows

* mount sysfs inside the kernel collector container, for BTF

* add host networking so kernel-collector components can reach the test reducer

* remove double "--network=host"

* extract kprobe parameters using REGS_PARM for taskstats_exit

* add license to bpf code

* change to kernel-compatible license

* try to fix load test checks

* parse kprobe parameters from ctx, first update

* parse kprobe parameters from ctx, second update

* run clang format

* fix conversion typo

* support pre-mounted /sys in kernel-collector entrypoint

* give verifier hint as to tgid range in END_SAVE_ARGS

* try using u64 for bpf_trace_printk in END_SAVE_ARGS

* output pid_tgid in bpf_trace_printk in END_SAVE_ARGS to appease the verifier

* allow mounted /sys in kernel-collector-test

* fix typo

* add &= to satisfy verifier

* make new unsigned variable for printing

* fix missing escape

* remove tgid printing in macro (cannot satisfty verifier)

* try to re-get pid_tgid

* different printk format string

* add explicit cast

* try signed printing

* print dummy

* give up on getting verifier to agree to trace in macro, count in global variables instead.

* make reads verifier safe and remove BPF_REGS_PARMS with KERNEL_VERSION (not well supported it seems)

* run clang-format

* use nc instead of reducer

* increase simple test time to 30 seconds

* switch some paths from kernel version to bpf_core_field_exists

* remove getting fd of bpf program

* remove kernel symbol resolution lookup

* remove unneeded fd tracking for kprobes

* install netcat for simple test

* add missing SEC markings

* fix program parameter parsing to use PT_REGS_PARM*

* run clang-format

* fix netcat fetching

* use CORE for msg_iter

* fix duplicate SEC markings

* fix probe naming

* annotate onret_cgroup_control with SEC

* add more missing SEC annotations

* fix PT_REGS_PARM and BPF_CORE_READ in new SEC markings

* clang format

* add BPF_CORE_READ where appropriate in udp_update_stats_impl()

* use the openbsd version of netcat

* move udp_update_stats to always inline

* simplify BPF_CORE_READ

* explicitly disable UDP tracing (was already disabled)

* add BPF_CORE_READ where appropriate

* enhance error reporting when loading tail calls

* mark tail calls with SEC("kprobe")

* add BPF_CORE_READ and PT_REGS_PARM to tail probes in render_bpf.c

* fix verifier in DNS reporting

* move reading of struct iov closer to its origin to help verifier

* fix verifier issues with string_starts_with

* run clang-format

* tackle verifier error on 5.10

* remove bpf-to-bpf calls in functions that also use tail calls so 5.4 kernels will verify

* enumerate existing cgroups using cgroup_get_from_fd

* run clang-format

* fail the simple tests if the word "error" appears in the kernel-collector output

* add __always_inline to avoid mixing bpf-to-bpf calls with tail calls (forbidden in older kernels)

* change failing BPF_CORE_READ of type to bpf_probe_read_kernel

* fix bpf_log variable

* add more __always_inline directives to allow tail calls

* run clang-format

* add __always_inline to another function where compiler complained

* add __always_inline to all functions with 6 or more parameters

* add explicit null checks after casting to pre 5.14 msg struct

* simplify verification for 5.10 kernel

* add __always_inline to functions that might be called from handle_receive_udp_skb to allow tail calls on 5.4 kernels

* simplify backwards compat of handle_kprobe__tcp_sendmsg

* run clang-format

* add more __always_inline to enable tail calls in continue_tcp_sendmsg on 5.4 kernels

* fix printouts during simple run

* remove debug print

* simplify backwards compat code in handle_kprobe__tcp_recvmsg to aid verifier on 5.10 kernels

* run clang-format

* add more __always_inline on functions we missed, for continue_tcp_sendmsg on 5.4 kernels

* fix the bpf_log in handle_kprobe__tcp_recvmsg

* remove the 4.19 kernel from the test matrix since it does not support BTF

* help verifier on 5.4 kernel limit iteration size in string_starts_with

* move bpf configuration to libbpf and remove the bpf code string handling

* fix kernel_collector_test unused variable

* remove dead code

* simplify function name and remove irrelevant docs

* remove `report_debug_events` global variable -- now unused

* remove unneded defines and pragmas

* remove old comment

* remove tcp_*_handler wrappers, unneeded

* remove redundant LINUX_KERNEL_VERSION externs

* Simplify parameter loading in tcp_recvmsg kprobe

* simplify parameter loading in tcp_sendmsg kprobe

* remove dead compat code

* remove bcc from makefiles

* remove compilation and header fetching errors from troubleshooting

* fix bcc-related code comments

* add deprecation warning to the bcc-based tcp-processor python script

* remove kprobe cleanup -- unnecessary with libbpf

* simplify flow

* remove entrypoint error reporting

* remove probe_handler class member -- unneeded

* run clang-format

* remove backwards compatibility artifact

* simplify cgroup selection

* move variables to right scope

* remove dead code

* remove dead code

* remove prefix __ from __onret_udp_get_port_impl

* remove unused parameters

* don't re-read sk twice in on_ip_send_skb

* fix wrong porting bcc->libbpf hidden behind #ifdef

* simplify on_skb_free_datagram_locked

* remove some pre 3.12 cgroup support

* run clang-format

* simplify backwards compatibility

* simplify get_css_id

* rename handle_cgroup_processing -> handle_existing_cgroup

* simplify backwards compatibility in onret_cgroup_control

* suppress libbpf prints

* remove entrypoint_error.h include in reducer

* run clang-format

* keep entrypoint_error message printing, but do not require the enum values

* clang format

* run kernel-collector tests on every gha run

* only check out submodules in ext/

* remove extraneous dependency of kct test on kernel-collector

* fix removal of change set

* Use CMAKE_HOST_SYSTEM_PROCESSOR instead of `uname -m`

* remove redundant cmd_args parameters in entrypoint_kct.sh

* write all libpf messages as debug in the BPF logging kind

* clang-format

* remove redundant __attribute__((preserve_access_index))

* write libbpf logs in default debug mode

* increase libbpf debug buffer size

* move LIBBPF_DEBUG messages to LOG::trace

* clang-format
2025-08-10 02:35:43 -05:00
OpenTelemetry Bot 5dca6134b4
Add subscript to issue templates (#349) 2025-08-01 10:59:18 -05:00
renovate[bot] ba0d124e69
chore(deps): update docker/login-action action to v3.4.0 (#348) 2025-07-27 22:40:26 -05:00
Jonathan Perry d175ad7adb
build: move the opentelemetry-network-build-tools repo into build-tools (#347) 2025-07-25 20:39:21 -05:00
Jonathan Perry f57f9ec8b1
chore(deps): update renderc for gradle 8 and update gradle dependency versions (#346) 2025-07-25 13:36:09 -05:00
Jonathan Perry 9849d93b9b
chore(deps): update go and go dependency versions (#345)
* don't require HTTPS if pushing to localhost:5000

* fix variable scope

* add missing image pull from the temporary container registry

* clean up registry push script

* update go versions and vendor
2025-07-25 13:10:05 -05:00
Jonathan Perry 40737cbf8d
fix(ci): correctly pull containers from container builds in build-and-test.yaml (#344)
* don't require HTTPS if pushing to localhost:5000

* fix variable scope

* add missing image pull from the temporary container registry

* clean up registry push script
2025-07-25 13:09:51 -05:00
renovate[bot] d58a49cd30
chore(deps): update actions/download-artifact action to v4.3.0 (#341) 2025-07-25 10:49:14 -05:00
renovate[bot] e1db15f19c
chore(deps): update dorny/paths-filter action to v3 (#342) 2025-07-25 10:48:47 -05:00
renovate[bot] bd071c6dc2
chore(deps): update docker.io/bitnami/minideb:bookworm docker digest to 53344e9 (#340) 2025-07-25 10:39:55 -05:00
renovate[bot] 70972063df
chore(deps): pin actions/download-artifact action to d3f86a1 (#339) 2025-07-25 10:37:24 -05:00
renovate[bot] afaee40176
chore(deps): update github/codeql-action action to v3.29.4 (#334) 2025-07-25 10:36:20 -05:00
Jonathan Perry f80da3dc85
ci: use build tools with distro packages of curl, openssl, grpc, and abseil (#338)
* migrate ebpf tests to little-vm-helper

* fix actions versions

* speed up apt install

* build the container images for kernel collector, reducer and tests in separate jobs

* fix image references

* different way of speeding up apt installations

* add error handling

* get the container's internal error code, for the kernel-collector-test

* ci: remove snyk gha (#333)

* build: rename shell variable in clang-format scripts for better readability (#330)

found by @bjandras

* fix build for distro packages of curl, openssl, grpc, and abseil

* add header to include unique_ptr template

* fix by_key with initializer list

* add support for printing __int128 (for ipv6 addressess)

* add log formatter for protobuf

* fix constexpr enforcement in logging code

* fix protobuf dependencies so they won't recompile every time

* remove OpenSSL version check (we use the distro package)

* fix initializer list

* add function parameters required by new llvm version

* fix returning weak reference (a deleted function started getting enforced with llvm update)

* fix chrono logging support

* remove double template default parameter

* fix logging of optional<>

* move chrono support only to files requiring it

* update bcc for clang/llvm version 16

* use find_package for protobuf and grpc

* run clang-format with updated version (required for github actions to succeed)

* ci: disable fossa, ossf-scorecard, and trivy-scans on forks

* allow users to override their benv image

* use the same clang-format version as in benv for gha

* explicitly set clang-format binary with version

* run clang-format-16 on codebase

* use new mount structure in build-and-test.yaml

* update release directory structure

* reinstate linking workaround for zlib

* fix reference to protobuf

* fix protobuf generation dependency

* ensure protoc runs after all preparations

* add a protobuf build target

* fix overly restrictive casting in test

* remove counter_to_rate (dead code)

* removed mention of dead code

* fix debug build - requires chrono fmt

* update makefiles to use podman

* upgrade docker images to bookworm

* switch to install_packages (reduces apt state in container)

* update comment on protobuf

* add required libraries to containers

* add permissions for podman to make containers

* use podman when tagging docker images ahead of registry push
2025-07-25 08:37:12 -05:00
Jonathan Perry fa0c4fe40d
ci: use little-vm-helper for kernel tests (#337)
* migrate ebpf tests to little-vm-helper

* fix actions versions

* speed up apt install

* build the container images for kernel collector, reducer and tests in separate jobs

* fix image references

* different way of speeding up apt installations

* add error handling

* get the container's internal error code, for the kernel-collector-test
2025-07-25 08:35:25 -05:00
Jonathan Perry ba3ed58d04
build: rename shell variable in clang-format scripts for better readability (#330)
found by @bjandras
2025-07-23 11:27:16 -05:00
Jonathan Perry 30d6d15dda
ci: remove snyk gha (#333) 2025-07-23 11:26:48 -05:00
renovate[bot] f307564283
fix(deps): update xtextversion to v2.39.0 (#322)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-22 15:04:28 -05:00
renovate[bot] 82af5eba32
chore(deps): update actions/upload-artifact action to v4 (#331)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-22 14:19:07 -05:00
renovate[bot] b5b9e6fb44
chore(deps): update bitnami/minideb:bullseye docker digest to a6f3a96 (#328)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-22 14:12:17 -05:00
renovate[bot] 7686e06e3b
chore(deps): update aquasecurity/trivy-action action to v0.32.0 (#314)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-22 11:03:37 -05:00
renovate[bot] 8e9828c1bb
fix(deps): update dependency args4j:args4j to v2.37 (#317)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-22 11:01:33 -05:00
renovate[bot] d3bf411ef5
chore(deps): update softprops/action-gh-release digest to f2352b9 (#318)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-22 10:38:03 -05:00
OpenTelemetry Bot 5d072c59f1
Add minimum token permissions for all github workflow files (#332)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2025-07-12 23:02:27 -05:00
OpenTelemetry Bot 591ac61ed4
Fix outdated community membership link (#327) 2025-07-08 14:34:15 -05:00
Jonathan Perry 073f9fb973
ci: update runners to ubuntu-24.04 (#329)
* build: update runners to ubuntu-24.04 from deprecated ubuntu-20.04

* update clang-format package installation

* use `clang-format` in checker script

* run clang-format

* add clang-format script

* run clang-format from ubuntu-24.04

* fix JSON request parsing in otlp grpc formatter test

* switch from camelCase to snake_case in otlp formatter verification
2025-06-27 14:43:15 -05:00
renovate[bot] 7e1b5c7edf
chore(deps): update actions/checkout action to v4 (#325)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Perry <yonch@yonch.com>
2025-06-25 23:16:52 -05:00
renovate[bot] f3dc5d8d6b
chore(deps): update bitnami/minideb:bullseye docker digest to b78b0e1 (#323)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-25 23:15:13 -05:00
OpenTelemetry Bot 68fdf5b69c
Update community member listings (#326)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-06-24 22:55:12 -05:00
renovate[bot] a823ef4a6e chore(deps): update dependency go to v1.24.4 2025-06-09 03:30:32 -05:00
renovate[bot] a76fca219e chore(deps): update fossas/fossa-action action to v1.7.0 2025-06-09 03:26:33 -05:00
renovate[bot] 9d496c7d35 chore(deps): update dorny/paths-filter action to v2.12.0 2025-06-02 19:58:19 -05:00
renovate[bot] 048a9fcbd3 chore(deps): update aquasecurity/trivy-action action to v0.30.0 2025-06-01 21:15:49 -05:00
renovate[bot] ab4f85fd12 chore(deps): update actions/upload-artifact action to v3.2.1 2025-06-01 21:05:28 -05:00
renovate[bot] b63e0ba19e chore(deps): update ossf/scorecard-action action to v2.4.2 2025-06-01 21:03:47 -05:00
renovate[bot] 418038039c chore(deps): update actions/checkout action to v3.6.0 2025-06-01 21:02:53 -05:00
renovate[bot] aa8860a169 chore(deps): update bitnami/minideb:bullseye docker digest to a652b44 2025-05-30 22:26:10 -05:00
renovate[bot] 886c57b669 chore(deps): update bitnami/minideb:bullseye docker digest to e8a5447 2025-05-28 22:10:26 -05:00
renovate[bot] 59764336b1 chore(deps): update github/codeql-action action to v3.28.18 2025-05-28 21:25:56 -05:00
renovate[bot] 56c3922e99 chore(deps): update softprops/action-gh-release digest to 37fd9d0 2025-05-28 08:40:57 -05:00