Skip to content

Commit

Permalink
Merge branch 'main' into dbotcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Jul 27, 2023
2 parents 2625462 + 298c38b commit 40cc3d0
Show file tree
Hide file tree
Showing 117 changed files with 6,149 additions and 7,082 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

* @open-telemetry/go-instrumentation-approvers

CODEOWNERS @open-telemetry/go-instrumentaiton-maintainers
CODEOWNERS @open-telemetry/go-instrumentation-maintainers
11 changes: 7 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

jobs:
generate:
generate-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -23,15 +23,18 @@ jobs:
make generate
- name: verify output
run: |
git diff --exit-code || (echo 'generated diff, please run "make generate"' && exit 1)
make check-clean-work-tree
- name: Run unit tests
run: |
make test
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Build auto-instrumentation
run: |
IMG=otel-go-instrumentation make docker-build
make docker-build
offsets:
runs-on: ubuntu-latest
steps:
Expand All @@ -42,4 +45,4 @@ jobs:
make docker-offsets
- name: Check diff
run: |
git diff --exit-code || (echo 'offsets diff detected, run "make offsets"' && exit 1)
make check-clean-work-tree
33 changes: 33 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This action requires that any PR targeting the main branch should touch at
# least one CHANGELOG file. If a CHANGELOG entry is not required, or if
# performing maintenance on the Changelog, add either \"[chore]\" to the title of
# the pull request or add the \"Skip Changelog\" label to disable this action.

name: changelog

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
jobs:
changelog:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}

steps:
- uses: actions/checkout@v3
- name: Check for CHANGELOG changes
run: |
# Only the latest commit of the feature branch is available
# automatically. To diff with the base branch, we need to
# fetch that too (and we only need its latest commit).
git fetch origin ${{ github.base_ref }} --depth=1
if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
then
echo "A CHANGELOG was modified. Looks good!"
else
echo "No CHANGELOG was modified."
echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
false
fi
9 changes: 7 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: lycheeverse/lychee-action@v1.7.0
- uses: lycheeverse/lychee-action@v1.8.0
with:
args: >-
-v -n "*.md" "**/*.md"
Expand Down Expand Up @@ -45,8 +45,13 @@ jobs:
with:
path: ~/.tools
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }}
- name: Install build dependencies
run: |
sudo apt-get update && sudo apt-get install -y clang llvm libbpf-dev
- name: Run linters
run: make license-header-check dependabot-check
run: make license-header-check dependabot-check go-mod-tidy golangci-lint
- name: Check clean repository
run: make check-clean-work-tree
verify-licenses:
runs-on: ubuntu-22.04
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e/k8s/sample-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
- name: OTEL_GO_AUTO_TARGET_EXE
value: /sample-app/main
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "test-opentelemetry-collector:4317"
value: "http://test-opentelemetry-collector:4317"
- name: OTEL_SERVICE_NAME
value: "sample-app"
- name: OTEL_PROPAGATORS
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:

jobs:
kubernetes-test:
strategy:
strategy:
matrix:
k8s-version: ["v1.26.0"]
library: ["gorillamux", "nethttp"]
library: ["gorillamux", "nethttp", "gin"]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -22,6 +22,8 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Setup BATS
uses: mig4/setup-bats@v1
- name: Build auto-instrumentation
run: |
IMG=otel-go-instrumentation:latest make docker-build
Expand All @@ -34,7 +36,7 @@ jobs:
with:
version: v3.9.0
- name: Create kind cluster
uses: helm/kind-action@v1.5.0
uses: helm/kind-action@v1.8.0
with:
node_image: kindest/node:${{ matrix.k8s-version }}
kubectl_version: ${{ matrix.k8s-version }}
Expand Down Expand Up @@ -68,9 +70,8 @@ jobs:
kubectl wait --for=condition=Complete --timeout=60s job/sample-job
- name: copy telemetry trace output
run: |
kubectl cp -c filecp default/test-opentelemetry-collector-0:tmp/trace.json ./test/e2e/${{ matrix.library }}/traces.json.tmp
jq 'del(.resourceSpans[].scopeSpans[].spans[].endTimeUnixNano, .resourceSpans[].scopeSpans[].spans[].startTimeUnixNano) | .resourceSpans[].scopeSpans[].spans[].spanId|= (if . != "" then "xxxxx" else . end) | .resourceSpans[].scopeSpans[].spans[].traceId|= (if . != "" then "xxxxx" else . end) | .resourceSpans[].scopeSpans|=sort_by(.scope.name)' ./test/e2e/${{ matrix.library }}/traces.json.tmp | jq --sort-keys . > ./test/e2e/${{ matrix.library }}/traces.json
rm ./test/e2e/${{ matrix.library }}/traces.json.tmp
- name: verify output
kubectl cp -c filecp default/test-opentelemetry-collector-0:tmp/trace.json ./test/e2e/${{ matrix.library }}/traces-orig.json
rm -f ./test/e2e/${{ matrix.library }}/traces.json
- name: verify output and redact to traces.json
run: |
git diff --exit-code || (echo 'output fixture diff detected' && exit 1)
bats ./test/e2e/${{ matrix.library }}/verify.bats
2 changes: 1 addition & 1 deletion .github/workflows/offsets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:

schedule:
- cron: '0 0 * * 0'
- cron: '0 0 * * *'

jobs:
updateOffsets:
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,42 @@ jobs:
permissions:
contents: read
packages: write

env:
IMAGE_NAME: autoinstrumentation-go
steps:
- uses: actions/[email protected]

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
uses: docker/login-action@v2.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0
uses: docker/setup-qemu-action@v2.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
uses: docker/setup-buildx-action@v2.9.1

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.4.0
uses: docker/metadata-action@v4.6.0
with:
images: ghcr.io/${{ github.repository }}/autoinstrumentation-go
images: |
otel/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}
- name: Build and push
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v4.1.1
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@
otel-go-instrumentation
launcher/
opentelemetry-helm-charts/

# don't track temp e2e trace json files
test/**/traces-orig.json
Loading

0 comments on commit 40cc3d0

Please sign in to comment.