diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml new file mode 100644 index 000000000..665e27aff --- /dev/null +++ b/.github/workflows/docker-images.yml @@ -0,0 +1,29 @@ +name: Docker Images +on: + pull_request: + push: + branches: + - main + schedule: # Rebuild images nightly + - cron: '0 0 * * *' + +jobs: + otel: + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build Base + uses: docker/build-push-action@v6 + with: + push: ${{ github.ref == 'refs/heads/main' && true || false}} + platforms: linux/amd64,linux/arm64 + tags: pocket/opentelemetry-collector-contrib + context: "{{defaultContext}}:images/otel" \ No newline at end of file diff --git a/images/otel/Dockerfile b/images/otel/Dockerfile index 60950e9a1..8723ac064 100644 --- a/images/otel/Dockerfile +++ b/images/otel/Dockerfile @@ -1,14 +1,17 @@ -FROM alpine:latest +# Use an alpine image as our base image, this allows us to define our own entry point script and have access to sh or bash, which the otel image does not have +FROM alpine:3 -COPY --from=otel/opentelemetry-collector-contrib:latest /otelcol-contrib /otelcol-contrib +# Copy the otelcol-contrib binary from the official image +COPY --from=otel/opentelemetry-collector-contrib:0.111.0 /otelcol-contrib /otelcol-contrib COPY otel-collector-config.yaml /etc/otelcol-contrib/config.yaml -COPY entrypont.sh /entrypont.sh -RUN chmod a+x /entrypont.sh +COPY entrypoint.sh /entrypoint.sh +RUN chmod a+x /entrypoint.sh +#Set the ENV variable for the google credentials that will be used by the google cloud exporter and mounted via an environment variable that will be saved to this file via our entrypoint script ENV GOOGLE_APPLICATION_CREDENTIALS=/etc/otelcol-contrib/key.json WORKDIR / -ENTRYPOINT [ "./entrypont.sh" ] +ENTRYPOINT [ "./entrypoint.sh" ] CMD [ "/otelcol-contrib", "--config", "/etc/otelcol-contrib/config.yaml" ] \ No newline at end of file diff --git a/images/otel/entrypont.sh b/images/otel/entrypoint.sh similarity index 100% rename from images/otel/entrypont.sh rename to images/otel/entrypoint.sh diff --git a/infrastructure/user-api/src/main.ts b/infrastructure/user-api/src/main.ts index c610d9563..e8a9a70cb 100644 --- a/infrastructure/user-api/src/main.ts +++ b/infrastructure/user-api/src/main.ts @@ -282,11 +282,6 @@ class UserAPI extends TerraformStack { 'logs:CreateLogStream', 'logs:DescribeLogStreams', 'logs:DescribeLogGroups', - 'xray:PutTraceSegments', - 'xray:PutTelemetryRecords', - 'xray:GetSamplingRules', - 'xray:GetSamplingTargets', - 'xray:GetSamplingStatisticSummaries', ], resources: ['*'], effect: 'Allow',