Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .checkapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ ignored_paths:
- processor/tailsamplingprocessor
- receiver/hostmetricsreceiver # issue with the parser not identifying Config as a config struct
- receiver/pulsarreceiver # 38930
- receiver/auditlogreceiver/test-standalone # test module
- exporter/pulsarexporter # 38929
- test-auditlog # test module
- exporter/elasticsearchexporter/integrationtest
- testbed/mockdatasenders/mockdatadogagentexporter
- extension/sumologicextension # 40655
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and Push Docker Image

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

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/otelcontribcol-auditlog

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Linux binary
run: |
GOOS=linux GOARCH=amd64 make otelcontribcol

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 AS prep
RUN apk --update add ca-certificates

FROM alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1

ARG USER_UID=10001
ARG USER_GID=10001

# Create storage directory and set permissions
RUN mkdir -p /var/lib/otelcol/storage && \
chown -R ${USER_UID}:${USER_GID} /var/lib/otelcol

USER ${USER_UID}:${USER_GID}

COPY --from=prep /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY bin/otelcontribcol_linux_amd64 /otelcontribcol
COPY auditlog-config.yaml /etc/otel/config.yaml
EXPOSE 8080 4317 4318
ENTRYPOINT ["/otelcontribcol"]
CMD ["--config", "/etc/otel/config.yaml"]
31 changes: 31 additions & 0 deletions auditlog-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
receivers:
auditlogreceiver:
endpoint: 0.0.0.0:4318
storage: redis_storage
process_interval: 5s
process_age_threshold: 5s
circuit_breaker:
enabled: false
circuit_open_threshold: 5
circuit_open_duration: 1m

exporters:
debug:
verbosity: detailed
sampling_initial: 1000
sampling_thereafter: 1000

extensions:
redis_storage:
endpoint: localhost:6379
db: 0
expiration: 24h
tls:
insecure: true

service:
extensions: [redis_storage]
pipelines:
logs:
receivers: [auditlogreceiver]
exporters: [debug]
2 changes: 2 additions & 0 deletions receiver/auditlogreceiver/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include ../../Makefile.Common

Loading
Loading