Skip to content

Commit

Permalink
add Dockerfile and initial build config
Browse files Browse the repository at this point in the history
  • Loading branch information
bpholt committed Nov 8, 2023
1 parent e0c9538 commit b2e6842
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Dwolla/platform
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
pull_request:
push:
branches: ['**']
tags: [v*]

jobs:
build:
strategy:
matrix:
otel_tag:
- v0.35.0
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and Push Docker Image
uses: Dwolla/jenkins-agents-workflow/.github/actions/build@main
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
BASE_TAG: ${{ matrix.OTEL_TAG }}
TAG_NAME: OTEL_TAG
IMAGE_NAME: dwolla/otel-collector
build-complete:
needs: build
runs-on: ubuntu-latest
steps:
- run: echo "The build completed successfully"
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG OTEL_TAG
FROM amazon/aws-otel-collector:${OTEL_TAG}
LABEL maintainer="Dwolla Dev <[email protected]>"
LABEL org.label-schema.vcs-url="https://github.com/Dwolla/dwolla-adot-collector"

COPY otel-config.yaml /etc/otel-config.yaml
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
OTEL_TAG := $(OTEL_TAG)
JOB := core-${OTEL_TAG}
CLEAN_JOB := clean-${OTEL_TAG}

all: ${JOB}
clean: ${CLEAN_JOB}
.PHONY: all clean ${JOB} ${CLEAN_JOB}

${JOB}: core-%: Dockerfile
docker buildx build \
--platform linux/arm64,linux/amd64 \
--build-arg OTEL_TAG=$* \
--tag dwolla/otel-collector:$*-SNAPSHOT \
.

${CLEAN_JOB}: clean-%:
docker image rm --force dwolla/otel-collector:$*-SNAPSHOT
54 changes: 54 additions & 0 deletions otel-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
extensions:
health_check:

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:55681
zipkin:

processors:
memory_limiter:
limit_mib: 100
check_interval: 5s
batch/traces:
timeout: 10s
send_batch_size: 50
attributes:
actions:
- key: deployment.environment
value: ${env:DWOLLA_ENV}
action: insert
- key: peer.service
action: extract
pattern: ^consul!(?P<peerservice>.*)$ # AFAICT using "peer.service" would be an illegal capture group name
- key: peer.service
action: update
from_attribute: peerservice
- key: peerservice
action: delete

exporters:
awsxray:
indexed_attributes:
- otel.resource.service.name
- deployment.environment

service:
pipelines:
traces:
receivers:
- otlp
- zipkin
processors:
- memory_limiter
- batch/traces
- attributes
exporters:
- awsxray

extensions:
- health_check

0 comments on commit b2e6842

Please sign in to comment.