Skip to content

Commit 8dffa31

Browse files
authored
Merge branch 'main' into create-pull-request/update-nodejs-agent
2 parents bc16f8a + 571e70c commit 8dffa31

File tree

183 files changed

+4781
-2710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+4781
-2710
lines changed

.codecov.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: yes
4+
# wait for unit and integration test builds.
5+
after_n_builds: 2
6+
strict_yaml_branch: main # only use the latest copy on main branch
7+
8+
coverage:
9+
precision: 2
10+
round: down
11+
range: "80...100"
12+
status:
13+
project:
14+
default:
15+
enabled: yes
16+
target: 40%
17+
patch:
18+
default:
19+
enabled: yes
20+
target: 85%

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ updates:
5555
- dependency-name: "github.com/open-telemetry/*"
5656
schedule:
5757
interval: "weekly"
58+
- package-ecosystem: "gomod"
59+
directory: "/packaging/dotnet-instr-deployer-add-on"
60+
ignore:
61+
- dependency-name: "go.opentelemetry.io/*"
62+
- dependency-name: "github.com/open-telemetry/*"
63+
schedule:
64+
interval: "weekly"
5865
- package-ecosystem: "gomod"
5966
directory: "/pkg/extension/smartagentextension"
6067
ignore:

.github/workflows/ansible.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ jobs:
5555
linux-test:
5656
name: Linux Test
5757
needs: lint
58-
# Use ubuntu-20.04.5 for containers with cgroups v1. Otherwise, use ubuntu-24.04 (cgroups v2).
59-
runs-on: ${{ fromJSON('["ubuntu-24.04", "ubuntu-20.04"]')[contains(fromJSON('["amazonlinux2", "centos9", "opensuse12", "ubuntu1604"]'), matrix.distro)] }}
58+
runs-on: ubuntu-24.04
6059
strategy:
6160
fail-fast: false
6261
matrix:
@@ -65,13 +64,10 @@ jobs:
6564
- ansible~=9.2.0
6665
- ansible~=8.7.0
6766
distro:
68-
- amazonlinux2
6967
- amazonlinux2023
7068
- centos8
71-
- centos9
7269
- debian11
7370
- debian12
74-
- opensuse12
7571
- ubuntu2004
7672
- ubuntu2204
7773

.github/workflows/auto-instrumentation.yml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
PYTHON_VERSION: '3.13'
2424
PIP_VERSION: '24.2'
2525
REQUIREMENTS_PATH: "packaging/tests/requirements.txt"
26-
GO_VERSION: 1.23.6
26+
GO_VERSION: 1.23.8
2727

2828
jobs:
2929
cross-compile:
@@ -53,7 +53,7 @@ jobs:
5353
./bin/*
5454
5555
build-package:
56-
runs-on: ubuntu-24.04
56+
runs-on: ${{ matrix.ARCH == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
5757
strategy:
5858
matrix:
5959
SYS_PACKAGE: [ "deb", "rpm" ]
@@ -64,12 +64,6 @@ jobs:
6464
with:
6565
fetch-depth: 0
6666

67-
- uses: docker/setup-qemu-action@v3
68-
if: ${{ matrix.ARCH != 'amd64' }}
69-
with:
70-
platforms: ${{ matrix.ARCH }}
71-
image: tonistiigi/binfmt:qemu-v7.0.0
72-
7367
- name: Run tests
7468
run: make -C instrumentation tests ARCH=${{ matrix.ARCH }}
7569

@@ -92,24 +86,24 @@ jobs:
9286
id: get-matrix
9387
run: |
9488
# create test matrix for distro and arch
95-
dockerfiles=$(find packaging/tests/instrumentation/images/ -name "Dockerfile.*" | cut -d '.' -f2- | sort -u)
89+
dockerfiles=$(find packaging/tests/instrumentation/images -name "Dockerfile.*" | cut -d '.' -f2- | sort -u)
9690
if [ -z "$dockerfiles" ]; then
9791
echo "Failed to get dockerfiles from packaging/tests/instrumentation/images!" >&2
9892
exit 1
9993
fi
10094
distro=$(for d in $dockerfiles; do echo -n "\"$d\","; done)
10195
arch="\"amd64\", \"arm64\""
10296
testcase="\"express\",\"tomcat\",\"dotnet\""
103-
exclude='{"ARCH": "arm64", "TESTCASE": "dotnet"}' # splunk-otel-dotnet currently not supported on arm64
97+
# splunk-otel-dotnet currently not supported on arm64
98+
exclude='{"ARCH": "arm64", "TESTCASE": "dotnet"}'
10499
matrix="{\"DISTRO\": [${distro%,}], \"ARCH\": [${arch}], \"TESTCASE\": [${testcase}], \"exclude\": [${exclude}]}"
105100
echo "$matrix" | jq
106101
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
107102
outputs:
108103
matrix: ${{ steps.get-matrix.outputs.matrix }}
109104

110105
test-package:
111-
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
112-
runs-on: ${{ fromJSON('["ubuntu-20.04", "ubuntu-22.04"]')[matrix.DISTRO == 'amazonlinux-2023'] }}
106+
runs-on: ubuntu-24.04${{ matrix.ARCH == 'arm64' && '-arm' || '' }}
113107
timeout-minutes: 60
114108
needs: [cross-compile, build-package, test-package-matrix]
115109
strategy:
@@ -140,12 +134,6 @@ jobs:
140134
name: splunk-otel-auto-instrumentation-${{ matrix.ARCH }}-${{ env.SYS_PACKAGE }}
141135
path: ./instrumentation/dist
142136

143-
- uses: docker/setup-qemu-action@v3
144-
if: ${{ matrix.ARCH != 'amd64' }}
145-
with:
146-
platforms: ${{ matrix.ARCH }}
147-
image: tonistiigi/binfmt:qemu-v7.0.0
148-
149137
- name: Setup python
150138
uses: actions/setup-python@v5
151139
with:
@@ -168,23 +156,15 @@ jobs:
168156
continue-on-error: true
169157
run: |
170158
distro="${{ matrix.DISTRO }}"
171-
if [[ "$distro" = "amazonlinux-2" ]]; then
172-
# workaround for pytest substring matching
173-
distro="amazonlinux-2 and not amazonlinux-2023"
174-
fi
175159
testcase="${{ matrix.TESTCASE }} or uninstall"
176160
python3 -u -m pytest -s --verbose -k "$distro and ${{ matrix.ARCH }} and ($testcase)" \
177161
packaging/tests/instrumentation/instrumentation_test.py
178162
179-
# qemu, networking, running systemd in containers, etc., can be flaky
163+
# networking, running systemd in containers, etc., can be flaky
180164
- name: Re-run failed tests
181165
if: ${{ steps.pytest.outcome == 'failure' }}
182166
run: |
183167
distro="${{ matrix.DISTRO }}"
184-
if [[ "$distro" = "amazonlinux-2" ]]; then
185-
# workaround for pytest substring matching
186-
distro="amazonlinux-2 and not amazonlinux-2023"
187-
fi
188168
testcase="${{ matrix.TESTCASE }} or uninstall"
189169
python3 -u -m pytest -s --verbose -k "$distro and ${{ matrix.ARCH }} and ($testcase)" \
190170
--last-failed \

.github/workflows/build-and-test.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ concurrency:
2626
cancel-in-progress: true
2727

2828
env:
29-
GO_VERSION: 1.23.6
29+
GO_VERSION: 1.23.8
3030

3131
jobs:
3232
setup-environment:
@@ -86,9 +86,9 @@ jobs:
8686
- name: gofmt
8787
run: |
8888
make install-tools
89-
make fmt
89+
make for-all CMD="make fmt"
9090
if ! git diff --exit-code; then
91-
echo "One or more Go files are not formatted correctly. Run 'make fmt' and push the changes."
91+
echo "One or more Go files are not formatted correctly. Run 'make for-all CMD="make fmt"' and push the changes."
9292
exit 1
9393
fi
9494
@@ -193,16 +193,19 @@ jobs:
193193
go-version: ${{ env.GO_VERSION }}
194194
cache-dependency-path: '**/go.sum'
195195

196-
- name: Coverage tests
197-
run: |
198-
make install-tools
199-
make test-with-cover
196+
- name: Install Tools
197+
run: make install-tools
200198

201-
- name: Uploading artifacts
202-
uses: actions/upload-artifact@v4
199+
- name: Run Unit Tests With Coverage
200+
run: make gotest-with-codecov
201+
202+
- name: Upload coverage report
203+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # 5.4.0
203204
with:
204-
name: coverage-results
205-
path: ./coverage.html
205+
fail_ci_if_error: true
206+
verbose: true
207+
env:
208+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
206209

207210
cross-compile:
208211
name: cross-compile
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
kind: Cluster
2+
apiVersion: kind.x-k8s.io/v1alpha4
3+
nodes:
4+
- role: control-plane
5+
kubeadmConfigPatches:
6+
- |
7+
kind: InitConfiguration
8+
nodeRegistration:
9+
kubeletExtraArgs:
10+
node-labels: "ingress-ready=true"
11+
- |
12+
kind: KubeletConfiguration
13+
serverTLSBootstrap: true
14+
extraPortMappings:
15+
- containerPort: 80
16+
hostPort: 80
17+
protocol: TCP
18+
- containerPort: 443
19+
hostPort: 443
20+
protocol: TCP

.github/workflows/darwin-test.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
- '!packaging/**'
2020

2121
env:
22-
GO_VERSION: '1.23.6'
22+
GO_VERSION: 1.23.8
2323

2424
concurrency:
2525
group: darwin-test-${{ github.event.pull_request.number || github.ref }}
@@ -45,14 +45,32 @@ jobs:
4545

4646
- run: go env -w CGO_ENABLED=0
4747

48-
- name: Install golang dependency
49-
run: make install-tools
50-
51-
- name: Unit tests with coverage
52-
run: make test-with-cover
48+
- name: Unit tests
49+
run: |
50+
set -o pipefail
51+
make install-tools
52+
mkdir -p unit-test-results-${{ matrix.OS }}/junit
53+
trap "go-junit-report -set-exit-code < unit-test-results-${{ matrix.OS }}/go-unit-tests.out > unit-test-results-${{ matrix.OS }}/junit/results.xml" EXIT
54+
make gotest-cover-without-race | tee unit-test-results-${{ matrix.OS }}/go-unit-tests.out
5355
5456
- name: Uploading artifacts
5557
uses: actions/upload-artifact@v4
5658
with:
57-
name: coverage-results-${{ matrix.OS }}
58-
path: ./coverage.html
59+
name: unit-test-results-${{ matrix.OS }}
60+
path: ./unit-test-results-${{ matrix.OS }}
61+
62+
- name: Upload coverage report
63+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # 5.4.0
64+
with:
65+
fail_ci_if_error: true
66+
verbose: true
67+
env:
68+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
69+
70+
- name: bundle.d
71+
run: |
72+
make bundle.d
73+
if ! git diff --exit-code; then
74+
echo "Discovery bundle.d config has changed. Run 'make bundle.d' and push the changes or ensure correct .tmpl updated."
75+
exit 1
76+
fi

.github/workflows/dotnet-instr-deployer-add-on.yml

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
paths:
1010
- 'packaging/dotnet-instr-deployer-add-on/**'
1111
- '.github/workflows/dotnet-instr-deployer-add-on.yml'
12+
schedule:
13+
- cron: '0 1 * * 1,4' # Every Monday and Thursday at 1 AM UTC
1214
workflow_dispatch:
1315
inputs:
1416
splunk_uf_version:
@@ -21,13 +23,13 @@ on:
2123
default: '6b4ebe426ca6'
2224

2325
env:
24-
GO_VERSION: 1.23.6
26+
GO_VERSION: 1.23.8
2527
# Provide default values for non-manually triggered executions
2628
splunk_uf_version: ${{ github.event.inputs.splunk_uf_version || '9.4.0' }}
2729
splunk_uf_build_hash: ${{ github.event.inputs.splunk_uf_build_hash || '6b4ebe426ca6' }}
2830

2931
jobs:
30-
build-pack-test-dotnet-deployer-ta:
32+
build-pack-test-dotnet-instrumentation-deployer-ta:
3133
runs-on: windows-latest
3234

3335
steps:
@@ -86,3 +88,44 @@ jobs:
8688
if: always()
8789
run: |
8890
Get-Content "${Env:ProgramFiles}\SplunkUniversalForwarder\var\log\splunk\splunk_otel_dotnet_deployer.log"
91+
92+
push-release-tag:
93+
name: Push Release Tag
94+
runs-on: ubuntu-24.04
95+
needs: [build-pack-test-dotnet-instrumentation-deployer-ta]
96+
if: github.ref == 'refs/heads/main'
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
101+
- name: Read version from app.conf
102+
id: read-app-conf
103+
run: |
104+
version=$(grep -oP '^version = \K.*' packaging/dotnet-instr-deployer-add-on/assets/default/app.conf)
105+
echo "version=$version" >> $GITHUB_OUTPUT
106+
107+
- name: Ensure version is read from app.conf
108+
if: steps.read-app-conf.outputs.version == ''
109+
run: echo "Fail to read version from app.conf" && exit 1
110+
111+
- name: Push new release tag if it doesn't exist
112+
uses: actions/github-script@v7
113+
with:
114+
github-token: ${{ secrets.GITHUB_TOKEN }}
115+
script: |
116+
const tagRef = "tags/dotnet-instrumentation-deployer-ta-v${{ steps.read-app-conf.outputs.version }}"
117+
const existingRefs = await github.rest.git.listMatchingRefs({
118+
owner: context.repo.owner,
119+
repo: context.repo.repo,
120+
ref: tagRef
121+
})
122+
if (existingRefs.data.length === 0) {
123+
await github.rest.git.createRef({
124+
owner: context.repo.owner,
125+
repo: context.repo.repo,
126+
ref: "refs/" + tagRef,
127+
sha: context.sha
128+
})
129+
} else {
130+
console.log(tagRef + " already exists")
131+
}

.github/workflows/gendependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- '.github/workflows/scripts/gendependabot.sh'
99

1010
env:
11-
GO_VERSION: 1.23.6
11+
GO_VERSION: 1.23.8
1212

1313
jobs:
1414
gendependabot:

0 commit comments

Comments
 (0)