Skip to content

Commit

Permalink
merge tmp branch with original files to the monorepo feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaffter committed Nov 13, 2024
2 parents 48e5566 + 97b1ada commit 031ad26
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ docs/_build/
target/

# Ipython Notebook
.ipynb_checkpoints
.ipynb_checkpoints
5 changes: 5 additions & 0 deletions apps/sage/otel-collector/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM public.ecr.aws/aws-observability/aws-otel-collector:latest as aws-otel

Check failure on line 1 in apps/sage/otel-collector/Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3007 warning: Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag

FROM otel/opentelemetry-collector-contrib:0.113.0

COPY --from=aws-otel /healthcheck /healthcheck
21 changes: 21 additions & 0 deletions apps/sage/otel-collector/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 T. Thyer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
34 changes: 34 additions & 0 deletions apps/sage/otel-collector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Purpose

As discussed in this Github Issue: <https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30798#issuecomment-2009233014>
The official opentelemetry (OTEL) collector image does not contain cURL or related shell
commands required to do container level health checks. It is reliant on external
services such as the application load balancer in AWS to perform these checks. This is
problematic with our deployment of the OTEL collector as we are using AWS
service connect with AWS ECS to allow other containers within the namespace to connect
to the collector. As such, there is no load balancer in-front of the container to handle
its lifecycle. Within ECS, the recommended way from AWS to handle container level health
checks is to let ECS perform commands in the container.
Source: <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_HealthCheck.html>

Since the OTEL collector does not have a shell, nor cURL available we need to accomplish
this another way. In the official AWS OTEL collector distro they accomplish this by
compiling a golang script down into a binary that can be run within the container.
Unfortunately we cannot use the AWS OTEL collector because they are not supporting the
`oauth2clientauthextension`: <https://github.com/aws-observability/aws-otel-collector/issues/1492>.

For our purposes we are creating a new image based off the `otel/opentelemetry-collector-contrib` image,
but with the addition of the healthcheck binary from the AWS OTEL distro. This
combination lets us use the oauth2 extension, and have container level health checks.

## Creating a new image (To automate later on)

As new base images are updated we will need to in-turn create a new otel collector
image that we deploy to ECS.

1. Update values in the `Dockerfile`
2. Run `docker build -t ghcr.io/sage-bionetworks/sage-otel-collector:vX.X.X .` (Replace the version)
3. Run `docker push ghcr.io/sage-bionetworks/sage-otel-collector:vX.X.X` (Replace the version)

Once a new image is built and pushed, then you'll want to update the values in the CDK
scripts to use the new image version.

0 comments on commit 031ad26

Please sign in to comment.