Skip to content

Commit

Permalink
maint: Rename project to network agent (#172)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
Renames the agent to be more accurate of what it is rather than one of
the technical choices of how we collect data.

## Short description of the changes
- Replace all references of "ebpf-agent" with "network-agent" through
repo (.md, .go, makefile, github workflows, binary name, docker image,
etc)

## How to verify that this has the expected result
The agent is now called called network agent.
  • Loading branch information
MikeGoldsmith committed Sep 14, 2023
1 parent a660ec1 commit 732fca2
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4.6.0
with:
images: ghcr.io/honeycombio/ebpf-agent
images: ghcr.io/honeycombio/network-agent
tags: |
# use dev tag for main branch builds
type=raw,value=dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4.6.0
with:
images: ghcr.io/honeycombio/ebpf-agent
images: ghcr.io/honeycombio/network-agent

- name: Build and push
uses: docker/build-push-action@v4.1.1
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Honeycomb eBPF Agent changelog
# Honeycomb Network Agent changelog

## [0.0.13-alpha] - 2023-09-14

Expand Down
26 changes: 13 additions & 13 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ When building with `make docker-build`, the generated files are included in the

## To pull a published image from ghcr

Docker images are found in [`ghcr.io/honeycombio/ebpf-agent:latest`](https://github.com/honeycombio/honeycomb-ebpf-agent/pkgs/container/ebpf-agent).
Docker images are found in [`ghcr.io/honeycombio/network-agent:latest`](https://github.com/honeycombio/honeycomb-network-agent/pkgs/container/network-agent).

Because this is a private registry, you must have a Github [personal access token](https://github.com/settings/tokens) (classic) with `read:packages` permission.

Expand All @@ -46,34 +46,34 @@ kubectl create secret docker-registry ghcr-secret \

## To create a local docker image

`make docker-build` will create a local docker image called `hny/ebpf-agent:local`.
`make docker-build` will create a local docker image called `hny/network-agent:local`.

Verify that it published to your local docker images:

```sh
$ docker images | grep ebpf-agent
REPOSITORY TAG IMAGE ID CREATED SIZE
hny/ebpf-agent local 326362e52d9c 5 minutes ago 120MB
$ docker images | grep network-agent
REPOSITORY TAG IMAGE ID CREATED SIZE
hny/network-agent local 326362e52d9c 5 minutes ago 120MB
```

For a custom name and/or tag, pass `IMG_NAME` and/or `IMG_TAG` in the make command.
For example, to get a local docker image called `hny/ebpf-agent-go:custom`:
For example, to get a local docker image called `hny/network-agent-go:custom`:

`IMG_NAME=hny/ebpf-agent-go IMG_TAG=custom make docker-build`
`IMG_NAME=hny/network-agent-go IMG_TAG=custom make docker-build`

## Deploying the agent to a Kubernetes cluster

Set environment variables like `HONEYCOMB_API_KEY` and the previously noted `GITHUB_TOKEN` and `BASE64_TOKEN` in a file called `.env`.
These environment variables get passed in the make command.

`make apply-ebpf-agent`
`make apply-network-agent`

```sh
$ make apply-ebpf-agent
$ make apply-network-agent
namespace/honeycomb created
secret/honeycomb created
secret/ghcr created
daemonset.apps/hny-ebpf-agent created
daemonset.apps/hny-network-agent created
```

If you're on a Mac, try `brew install gettext` if `envsubst` isn't available.
Expand All @@ -82,13 +82,13 @@ Confirm that the pods are up by using `k9s` or with `kubectl`:

```sh
$ kubectl get pods --namespace=honeycomb
NAME READY STATUS RESTARTS AGE
hny-ebpf-agent-bqcvl 1/1 Running 0 94s
NAME READY STATUS RESTARTS AGE
hny-network-agent-bqcvl 1/1 Running 0 94s
```

To remove the agent:

`make unapply-ebpf-agent` or `kubectl delete -f smoke-tests/deployment.yaml`
`make unapply-network-agent` or `kubectl delete -f smoke-tests/deployment.yaml`

## Optionally install the "greetings" example app

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ RUN make build

FROM ubuntu:22.04
RUN apt-get update -yq && apt-get install -yq ca-certificates libpcap-dev
COPY --from=builder /src/hny-ebpf-agent /bin/hny-ebpf-agent
ENTRYPOINT [ "/bin/hny-ebpf-agent" ]
COPY --from=builder /src/hny-network-agent /bin/hny-network-agent
ENTRYPOINT [ "/bin/hny-network-agent" ]
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ifeq (,$(wildcard /sys/kernel/btf/vmlinux))
BPF_HEADERS += -DBPF_NO_PRESERVE_ACCESS_INDEX
endif

IMG_NAME ?= hny/ebpf-agent
IMG_NAME ?= hny/network-agent
IMG_TAG ?= local

.PHONY: generate
Expand All @@ -24,13 +24,13 @@ generate:
.PHONY: docker-generate
#: generate go/bpf interop code but in Docker
docker-generate:
docker build --tag hny/ebpf-agent-builder . -f bpf/Dockerfile
docker run --rm -v $(shell pwd):/src hny/ebpf-agent-builder
docker build --tag hny/network-agent-builder . -f bpf/Dockerfile
docker run --rm -v $(shell pwd):/src hny/network-agent-builder

.PHONY: build
#: compile the agent executable
build:
CGO_ENABLED=1 GOOS=linux go build -o hny-ebpf-agent main.go
CGO_ENABLED=1 GOOS=linux go build -o hny-network-agent main.go

.PHONY: docker-build
#: build the agent image
Expand All @@ -46,12 +46,12 @@ update-headers:
### Testing targets

.PHONY: apply-agent
#: deploy ebpf agent daemonset to already-running cluster with env vars from .env file
#: deploy network agent daemonset to already-running cluster with env vars from .env file
apply-agent:
envsubst < smoke-tests/deployment.yaml | kubectl apply -f -

.PHONY: unapply-agent
#: remove ebpf agent daemonset
#: remove network agent daemonset
unapply-agent:
kubectl delete -f smoke-tests/deployment.yaml

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Honeycomb eBPF Agent for Kubernetes
# Honeycomb Network Agent for Kubernetes

<!-- OSS metadata badge - rename repo link and set status in OSSMETADATA -->
<!-- [![OSS Lifecycle](https://img.shields.io/osslifecycle/honeycombio/{repo-name})](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md) -->

The agent is deployed to Kubernetes as a [`DaemonSet`](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/),
which means that Kubernetes will try to have the agent run on every node in the cluster.

Docker images are found in [`ghcr.io/honeycombio/ebpf-agent:latest`](https://github.com/honeycombio/honeycomb-ebpf-agent/pkgs/container/ebpf-agent).
Docker images are found in [`ghcr.io/honeycombio/network-agent:latest`](https://github.com/honeycombio/honeycomb-network-agent/pkgs/container/network-agent).

See notes on local development in [`DEVELOPING.md`](./DEVELOPING.md)

Expand Down Expand Up @@ -51,7 +51,7 @@ kubectl create secret docker-registry ghcr-secret \
kubectl apply -f examples/quickstart.yaml
```

Events should show up in Honeycomb in the `hny-ebpf-agent` dataset.
Events should show up in Honeycomb in the `hny-network-agent` dataset.

Alternative options for configuration and running can be found in [Deploying the agent to a Kubernetes cluster](./DEVELOPING.md#deploying-the-agent-to-a-kubernetes-cluster):

Expand Down
4 changes: 2 additions & 2 deletions assemblers/tcp_assembler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"sync/atomic"
"time"

"github.com/honeycombio/ebpf-agent/config"
"github.com/honeycombio/gopacket"
"github.com/honeycombio/gopacket/ip4defrag"
"github.com/honeycombio/gopacket/layers"
"github.com/honeycombio/gopacket/pcap"
"github.com/honeycombio/gopacket/reassembly"
"github.com/honeycombio/honeycomb-network-agent/config"
"github.com/honeycombio/libhoney-go"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -225,7 +225,7 @@ func (a *tcpAssembler) logAssemblerStats() {
"active_streams": stats.active_streams,
}
statsEvent := libhoney.NewEvent()
statsEvent.Dataset = "hny-ebpf-agent-stats"
statsEvent.Dataset = "hny-network-agent-stats"
statsEvent.AddField("name", "tcp_assembler_stats")
statsEvent.Add(statsFields)
statsEvent.Send()
Expand Down
2 changes: 1 addition & 1 deletion assemblers/tcp_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"fmt"
"sync"

"github.com/honeycombio/ebpf-agent/config"
"github.com/honeycombio/gopacket"
"github.com/honeycombio/gopacket/layers"
"github.com/honeycombio/gopacket/reassembly"
"github.com/honeycombio/honeycomb-network-agent/config"
"github.com/rs/zerolog/log"
)

Expand Down
2 changes: 1 addition & 1 deletion assemblers/tcp_stream_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"fmt"
"sync"

"github.com/honeycombio/ebpf-agent/config"
"github.com/honeycombio/gopacket"
"github.com/honeycombio/gopacket/layers"
"github.com/honeycombio/gopacket/reassembly"
"github.com/honeycombio/honeycomb-network-agent/config"
"github.com/rs/zerolog/log"
)

Expand Down
2 changes: 1 addition & 1 deletion bpf/probes/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/cilium/ebpf/link"
"github.com/cilium/ebpf/perf"
"github.com/honeycombio/ebpf-agent/utils"
"github.com/honeycombio/honeycomb-network-agent/utils"
"github.com/honeycombio/libhoney-go"
"github.com/rs/zerolog/log"
semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
Expand Down
2 changes: 1 addition & 1 deletion debug/debug_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sync"
"syscall"

"github.com/honeycombio/ebpf-agent/config"
"github.com/honeycombio/honeycomb-network-agent/config"
deltaprof "github.com/pyroscope-io/godeltaprof/http/pprof"
metrics "github.com/rcrowley/go-metrics"
"github.com/rcrowley/go-metrics/exp"
Expand Down
14 changes: 7 additions & 7 deletions examples/quickstart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ subjects:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: hny-ebpf-agent
name: hny-network-agent
namespace: honeycomb
labels:
app: hny-ebpf-agent
app: hny-network-agent
spec:
selector:
matchLabels:
name: hny-ebpf-agent
name: hny-network-agent
template:
metadata:
labels:
name: hny-ebpf-agent
name: hny-network-agent
spec:
serviceAccountName: honeycomb-sa
hostNetwork: true
containers:
- name: hny-ebpf-agent
image: ghcr.io/honeycombio/ebpf-agent:latest
- name: hny-network-agent
image: ghcr.io/honeycombio/network-agent:latest
imagePullPolicy: IfNotPresent
env:
- name: HONEYCOMB_API_KEY
Expand All @@ -56,7 +56,7 @@ spec:
name: honeycomb
key: api-key
- name: HONEYCOMB_DATASET
value: hny-ebpf-agent
value: hny-network-agent
args:
- tcp
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/honeycombio/ebpf-agent
module github.com/honeycombio/honeycomb-network-agent

go 1.20

Expand Down
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"syscall"
"time"

"github.com/honeycombio/ebpf-agent/assemblers"
"github.com/honeycombio/ebpf-agent/config"
"github.com/honeycombio/ebpf-agent/debug"
"github.com/honeycombio/ebpf-agent/utils"
"github.com/honeycombio/honeycomb-network-agent/assemblers"
"github.com/honeycombio/honeycomb-network-agent/config"
"github.com/honeycombio/honeycomb-network-agent/debug"
"github.com/honeycombio/honeycomb-network-agent/utils"
"github.com/honeycombio/libhoney-go"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
Expand All @@ -24,7 +24,7 @@ import (
)

const Version string = "0.0.13-alpha"
const defaultDataset = "hny-ebpf-agent"
const defaultDataset = "hny-network-agent"
const defaultEndpoint = "https://api.honeycomb.io"

func main() {
Expand All @@ -40,7 +40,7 @@ func main() {
// TODO: add a flag to enable human readable logs
// log.Logger = log.Output(zerolog.NewConsoleWriter())

log.Info().Str("agent_version", Version).Msg("Starting Honeycomb eBPF agent")
log.Info().Str("agent_version", Version).Msg("Starting Honeycomb Network agent")

kernelVersion, err := utils.HostKernelVersion()
if err != nil {
Expand Down Expand Up @@ -72,7 +72,7 @@ func main() {
})

// appends libhoney's user-agent (TODO: doesn't work, no useragent right now)
libhoney.UserAgentAddition = fmt.Sprintf("hny/ebpf-agent/%s", Version)
libhoney.UserAgentAddition = fmt.Sprintf("hny/network-agent/%s", Version)

// configure global fields that are set on all events
libhoney.AddField("honeycomb.agent_version", Version)
Expand Down
16 changes: 8 additions & 8 deletions smoke-tests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,26 @@ subjects:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: hny-ebpf-agent
name: hny-network-agent
namespace: honeycomb
labels:
app: hny-ebpf-agent
app: hny-network-agent
spec:
selector:
matchLabels:
name: hny-ebpf-agent
name: hny-network-agent
template:
metadata:
labels:
name: hny-ebpf-agent
name: hny-network-agent
spec:
serviceAccountName: honeycomb-sa
hostNetwork: true
containers:
- name: hny-ebpf-agent
- name: hny-network-agent
# use locally built image from make docker-build
image: hny/ebpf-agent:local
# image: ghcr.io/honeycombio/ebpf-agent:latest
image: hny/network-agent:local
# image: ghcr.io/honeycombio/network-agent:latest
imagePullPolicy: IfNotPresent
# uncomment this to enable profiling listener on port 6060
# ports:
Expand All @@ -91,7 +91,7 @@ spec:
name: honeycomb
key: api-key
- name: HONEYCOMB_DATASET
value: hny-ebpf-agent
value: hny-network-agent
## uncomment this to enable debug log level
# - name: LOG_LEVEL
# value: "DEBUG"
Expand Down
2 changes: 1 addition & 1 deletion smoke-tests/loadtest.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

```shell
make docker-build
HONEYCOMB_API_KEY=abc make apply-ebpf-agent
HONEYCOMB_API_KEY=abc make apply-network-agent
```

3. Start load test
Expand Down
2 changes: 1 addition & 1 deletion source/packet_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package source
import (
"time"

"github.com/honeycombio/ebpf-agent/config"
"github.com/honeycombio/gopacket"
"github.com/honeycombio/gopacket/pcap"
"github.com/honeycombio/honeycomb-network-agent/config"
"github.com/rs/zerolog/log"
)

Expand Down

0 comments on commit 732fca2

Please sign in to comment.