Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ coverage-report-html: cov-exclude-generated
# image-build is only used for local development. GH actions that build and publish the image don't make use of it
.PHONY: image-build
image-build:
@echo "### Building and pushing the auto-instrumenter image"
@echo "### Building the auto-instrumenter image"
$(call check_defined, IMG_ORG, Your Docker repository user name)
$(OCI_BIN) buildx build --load -t ${IMG} .

Expand Down
8 changes: 4 additions & 4 deletions devdocs/new-tracer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ This document the steps required to add a new TCP protocol based BPF tracer to O

## Investigate the protocol

First, you need to understand the protocol used by the application you want to trace. Beyla captures TCP packets and you need to add the logic to identify the packets that belong to the protocol you want to trace. The are basically two cases:
First, you need to understand the protocol used by the application you want to trace. OBI captures TCP packets and you need to add the logic to identify the packets that belong to the protocol you want to trace. The are basically two cases:

- The package comes in plain text, like SQL. In this case, you can just search for the SQL keywords in the packets.
- The package comes in binary format, like Kafka. In this case, you need to figure out how to identify the start and end of the packets and where the relevant information is.

## Add the new protocol to the BPF program

In [pkg/internal/ebpf/common/tcp_detect_transform.go](https://https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/issues/blob/main/pkg/internal/ebpf/common/tcp_detect_transform.go) any TCP packet captured from BPF passes through the `ReadTCPRequestIntoSpan` function, and depending what's in the bytes, you can identify if the packet is SQL, Redis, etc. You need to add a new case to this function to identify the new protocol.
In [pkg/components/ebpf/common/tcp_detect_transform.go](https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/4dac55491290db8992c4a3d0c30f60039b406a83/pkg/components/ebpf/common/tcp_detect_transform.go) any TCP packet captured from BPF passes through the [`ReadTCPRequestIntoSpan` function](https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/4dac55491290db8992c4a3d0c30f60039b406a83/pkg/components/ebpf/common/tcp_detect_transform.go#L32), and depending what's in the bytes, you can identify if the packet is SQL, Redis, etc. You need to add a new case to this function to identify the new protocol.

Once you have this done (the hard part!), you have to create a new `EventType` in [pkg/internal/request/span.go](https://https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/issues/blob/main/pkg/internal/request/span.go#L4). Look how other `EventTypes` are handled, and you probably need to edit every single file where the data is flowing. For example, to add a new OTEL trace you have to edit `traceAttributes` in [pkg/export/otel/traces.go](https://https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/issues/blob/main/pkg/export/otel/traces.go#L4)
Once you have this done (the hard part!), you have to create a new `EventType` in [pkg/app/request/span.go](https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/4dac55491290db8992c4a3d0c30f60039b406a83/pkg/app/request/span.go#L26). Look how other `EventTypes` are handled, and you probably need to edit every single file where the data is flowing. For example, to add a new OTEL trace you have to edit `TraceAttributesSelector` function in [pkg/export/otel/tracesgen/tracesgen.go](https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/4dac55491290db8992c4a3d0c30f60039b406a83/pkg/export/otel/tracesgen/tracesgen.go#L296)

Take a look at [this PR](https://https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/issues/pull/890) for an example of how to add a new Kafka protocol.
Take a look at [this PR](https://github.com/grafana/beyla/pull/890) for an example of how to add a new Kafka protocol.

## Other considerations

Expand Down
6 changes: 3 additions & 3 deletions devdocs/pipeline-map.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Beyla pipeline map
# OBI pipeline map

The whole Beyla pipeline is divided in two main connected pipelines. The reason for not having a
single pipeline is that there are plans to split Beyla into two: a finder/instrumenter executable
The whole OBI pipeline is divided in two main connected pipelines. The reason for not having a
single pipeline is that there are plans to split OBI into two: a finder/instrumenter executable
with high privileges and a reader/decorator executable with lesser privileges.

The dashed boxes are optional stages that will run only under certain conditions/configurations.
Expand Down
6 changes: 3 additions & 3 deletions devdocs/profiling.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Beyla profiling
# OBI profiling

To profile a Beyla while it is instrumenting an application do the following:
To profile a OBI while it is instrumenting an application do the following:

1. Run Beyla with the `OTEL_EBPF_PROFILE_PORT` variable set, e.g. 6060.
1. Run OBI with the `OTEL_EBPF_PROFILE_PORT` variable set, e.g. 6060.
2. Download the required profiles:

```sh
Expand Down