Skip to content

[SVLS-5280] bundle .NET tracer script with serverless-init#366

Merged
DylanLovesCoffee merged 12 commits into
mainfrom
dylan/sls-init-dotnet-image
Aug 22, 2024
Merged

[SVLS-5280] bundle .NET tracer script with serverless-init#366
DylanLovesCoffee merged 12 commits into
mainfrom
dylan/sls-init-dotnet-image

Conversation

@DylanLovesCoffee

@DylanLovesCoffee DylanLovesCoffee commented Aug 19, 2024

Copy link
Copy Markdown
Contributor

Action item for incident-29739.

Adds a .NET tracer installation script to the serverless-init image build so users can call the script directly in their Dockerfile if they're building a .NET non-Alpine and non-arm64 image.

Shell script and testing provided by Storms: https://github.com/DataDog/serverless-self-monitoring/compare/storms/incident-29739. The script installs curl and finds the latest version of the .NET tracing library from Github releases and then installs the tracer.

https://datadoghq.atlassian.net/browse/SVLS-5280

ARG TARGETARCH

COPY ./bin/datadog_extension-$TARGETARCH-alpine/extensions/datadog-agent /datadog-init
COPY ./bin/serverless_init_dotnet.sh /dotnet.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have to add this for some reason for alpine?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah, you're right, that's unnecessary for alpine ✏️

@joeyzhao2018 joeyzhao2018 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 minor comment. non-blocking. 🚢

Comment thread scripts/serverless_init_dotnet.sh Outdated
apt-get update && apt-get install -y curl

# Get latest released version of dd-trace-dotnet
TRACER_VERSION=$(curl -s https://api.github.com/repos/DataDog/dd-trace-dotnet/releases/latest | jq -r '.tag_name' | cut -d '"' -f 4 | cut -c2-)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if they hit rate limit? Should we hardcode a fallback version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah good point 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had this page open and just saw this and thinking it's probably safer to let the operation fail (fast) than fallback to any version which might cause unexpected issue.

@duncanista duncanista Aug 20, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's probably safer to let the operation fail (fast)

wouldn't this crash your customer if it fails?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a very good question. I was thinking that we should favor failing at deployment time over any fallback solution. more about the evil of fallback
However, this is a good question on when it's "crashing". I assumed that the image build is built once and reused when scaling happens, which is the most sensitive time.
If it's not reused, crashing during scaling may be indeed undesirable.
But could it even create a scenario where some instances running with one version and others using fallback versions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But could it even create a scenario where some instances running with one version and others using fallback versions?

I don't know, you tell me!

I agree, I don't like fallbacks, yet I don't want us to crash customers. Pick as your product needs 😛

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah, that's true. It might not be so obvious to the user that there's a fallback version too should the version request fail when they're running this in their pipelines. I'll revert

@DylanLovesCoffee
DylanLovesCoffee merged commit 2a17492 into main Aug 22, 2024
@DylanLovesCoffee
DylanLovesCoffee deleted the dylan/sls-init-dotnet-image branch August 22, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants