Skip to content

Commit 30561f0

Browse files
authored
Apache instrumentation v1.0 (open-telemetry#1236)
* Apache Instrumentation - Agent Image Build * Rename deafult image name * Github bld action for Apache HTTPD autoinstr img * Added Apache HTTPD image to publish images act * Heading change
1 parent c7c8b05 commit 30561f0

File tree

5 files changed

+107
-0
lines changed

5 files changed

+107
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: "Publish Apache HTTPD Auto-Instrumentation"
2+
3+
on:
4+
push:
5+
paths:
6+
- 'autoinstrumentation/apache-httpd/**'
7+
- '.github/workflows/publish-autoinstrumentation-apache-httpd.yaml'
8+
branches:
9+
- main
10+
pull_request:
11+
paths:
12+
- 'autoinstrumentation/apache-httpd/**'
13+
- '.github/workflows/publish-autoinstrumentation-apache-httpd.yaml'
14+
workflow_dispatch:
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-20.04
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Read version
24+
run: echo "VERSION=$(cat autoinstrumentation/apache-httpd/version.txt)" >> $GITHUB_ENV
25+
26+
- name: Docker meta
27+
id: meta
28+
uses: docker/metadata-action@v4
29+
with:
30+
images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd
31+
tags: |
32+
type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }}
33+
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v2
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v2
39+
40+
- name: Cache Docker layers
41+
uses: actions/cache@v3
42+
with:
43+
path: /tmp/.buildx-cache
44+
key: ${{ runner.os }}-buildx-${{ github.sha }}
45+
restore-keys: |
46+
${{ runner.os }}-buildx-
47+
48+
- name: Login to GitHub Package Registry
49+
uses: docker/login-action@v2
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.repository_owner }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Build and push
56+
uses: docker/build-push-action@v3
57+
with:
58+
context: autoinstrumentation/apache-httpd
59+
platforms: linux/amd64,linux/arm64
60+
push: ${{ github.event_name == 'push' }}
61+
build-args: version=${{ env.VERSION }}
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}
64+
cache-from: type=local,src=/tmp/.buildx-cache
65+
cache-to: type=local,dest=/tmp/.buildx-cache

.github/workflows/publish-images.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
grep -v '\#' versions.txt | grep autoinstrumentation-nodejs | awk -F= '{print "AUTO_INSTRUMENTATION_NODEJS_VERSION="$2}' >> $GITHUB_ENV
2929
grep -v '\#' versions.txt | grep autoinstrumentation-python | awk -F= '{print "AUTO_INSTRUMENTATION_PYTHON_VERSION="$2}' >> $GITHUB_ENV
3030
grep -v '\#' versions.txt | grep autoinstrumentation-dotnet | awk -F= '{print "AUTO_INSTRUMENTATION_DOTNET_VERSION="$2}' >> $GITHUB_ENV
31+
grep -v '\#' versions.txt | grep autoinstrumentation-apache-httpd | awk -F= '{print "AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION="$2}' >> $GITHUB_ENV
3132
echo "VERSION_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
3233
echo "VERSION=$(git describe --tags | sed 's/^v//')" >> $GITHUB_ENV
3334
@@ -82,5 +83,6 @@ jobs:
8283
AUTO_INSTRUMENTATION_NODEJS_VERSION=${{ env.AUTO_INSTRUMENTATION_NODEJS_VERSION }}
8384
AUTO_INSTRUMENTATION_PYTHON_VERSION=${{ env.AUTO_INSTRUMENTATION_PYTHON_VERSION }}
8485
AUTO_INSTRUMENTATION_DOTNET_VERSION=${{ env.AUTO_INSTRUMENTATION_DOTNET_VERSION }}
86+
AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION=${{ env.AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION }}
8587
cache-from: type=local,src=/tmp/.buildx-cache
8688
cache-to: type=local,dest=/tmp/.buildx-cache
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
############################
3+
# STEP 1 download the webserver agent
4+
############################
5+
FROM alpine:latest as agent
6+
7+
ARG version
8+
9+
RUN mkdir /opt/opentelemetry
10+
WORKDIR /opt/opentelemetry
11+
12+
RUN wget https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/download/webserver%2Fv$version/opentelemetry-webserver-sdk-x64-linux.tgz.zip
13+
RUN unzip opentelemetry-webserver-sdk-x64-linux.tgz.zip
14+
RUN mkdir agent
15+
RUN tar -xvf opentelemetry-webserver-sdk-x64-linux.tgz -C agent
16+
17+
############################
18+
# STEP 2 download the webserver agent
19+
############################
20+
FROM alpine:latest
21+
22+
COPY --from=agent /opt/opentelemetry/agent/opentelemetry-webserver-sdk /opt/opentelemetry
23+
24+
RUN chmod a+w /opt/opentelemetry/logs
25+
26+
CMD ["cat", "Just delivering the Opentelemetry Apache/Nginx agent"]
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# How to build Apache HTTPD auto-instrumentation docker image
2+
3+
To build image for Apache HTTPD auto instrumentation, use the following commands
4+
5+
```
6+
export REPO_NAME="<your-docker-image-repo-name>"
7+
export IMAGE_NAME_PREFIX="autoinstrumentation-apache-httpd"
8+
export IMAGE_VERSION=`cat version.txt`
9+
export IMAGE_NAME=${REPO_NAME}/${IMAGE_NAME_PREFIX}:${IMAGE_VERSION}
10+
docker build --build-arg version=${IMAGE_VERSION} . -t ${IMAGE_NAME} -t ${REPO_NAME}/${IMAGE_NAME_PREFIX}:latest
11+
docker push ${IMAGE_NAME}
12+
docker push ${REPO_NAME}/${IMAGE_NAME_PREFIX}:latest
13+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.2

0 commit comments

Comments
 (0)