-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
39 changed files
with
1,493 additions
and
730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 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 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 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 [ "./entrypoint.sh" ] | ||
|
||
CMD [ "/otelcol-contrib", "--config", "/etc/otelcol-contrib/config.yaml" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
set -e | ||
echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > /etc/otelcol-contrib/key.json | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Note this is only built nightly and will take effect on the next deploy after being built. | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
endpoint: "0.0.0.0:4317" # gRPC port for receiving traces, metrics, and logs over gRPC | ||
http: | ||
endpoint: "0.0.0.0:4318" # http port for receiving traces, metrics, and logs over http | ||
exporters: | ||
googlecloud: | ||
log: | ||
default_log_name: opentelemetry.io/collector-exported-log | ||
# debug: | ||
# verbosity: detailed | ||
processors: | ||
memory_limiter: | ||
check_interval: 1s | ||
limit_percentage: 30 | ||
spike_limit_percentage: 10 | ||
batch: | ||
# batch metrics before sending to reduce API usage | ||
send_batch_max_size: 200 | ||
send_batch_size: 200 | ||
timeout: 5s | ||
resourcedetection/ecs: | ||
detectors: [env, ecs] | ||
timeout: 2s | ||
override: false | ||
resource/cleanup_for_google: | ||
attributes: | ||
- key: service.namespace | ||
value: pocket | ||
action: insert | ||
# We must set the region to us-east1, as the google exporter uses this to know where to send data to. | ||
- key: cloud.region | ||
value: us-east1 | ||
action: upsert | ||
- key: cloud.availability_zone | ||
value: us-east1-b | ||
action: upsert | ||
# set this to the ecs task id | ||
- key: host.id | ||
from_attribute: aws.ecs.task.id | ||
action: upsert | ||
# https://opentelemetry.io/docs/specs/semconv/resource/deployment-environment/ | ||
- key: deployment.environment.name | ||
value: ${env:DEPLOYMENT_ENVIRONMENT_NAME} | ||
action: upsert | ||
|
||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [resourcedetection/ecs, resource/cleanup_for_google, memory_limiter, batch] | ||
exporters: [googlecloud] | ||
# metrics: | ||
# receivers: [otlp] | ||
# processors: [resourcedetection/ecs, resource/cleanup_for_google, memory_limiter, batch] | ||
# exporters: [googlecloud] | ||
logs: | ||
receivers: [otlp] | ||
processors: [resourcedetection/ecs, resource/cleanup_for_google, memory_limiter, batch] | ||
exporters: [googlecloud] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.