-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker image running Elastic Agent in Otel mode #5248
Conversation
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
This pull request does not have a backport label. Could you fix it @michalpristas? 🙏
NOTE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of a second dockerfile, as I know the other is complicated. On the other hand I do worry about the issues this brings of having to make updates in two places (like pcap adjustments not being consistent, or adjustments to deps, etc.).
My question is how much is this really saving in complexity in the file? It looks similar but without the synthetics stuff with is already conditional.
@blakerouse if we agree on keeping components (still a question), i will merge this into a single docker file, |
@@ -265,3 +265,7 @@ RUN echo -e '#!/bin/sh\nexec /usr/local/bin/docker-entrypoint' > /app/apm.sh && | |||
{{- else }} | |||
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/docker-entrypoint"] | |||
{{- end }} | |||
|
|||
{{- if contains .image_name "-otel" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
starting with a default config
|
||
set -eo pipefail | ||
|
||
exec {{ .BeatName }} otel "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept entrypoint separate to avoid starting conditionally based on ENV vars
failures on k8s integ tests. related: #5275 |
Do we want to discuss the inclusion of components and the use of a separate dockerfile in the PR or in the issue? I have an open item in the issue |
Yeah, thinking more I think our life might be easier if we just support this with an environment variable. #5246 (comment) An elastic-agent-otel container is probably easier for users, but adding an env var that is equivalent to running |
Updated entrypoint to execute proper command based on env var. |
Did we confirm that the operator allows customizing the env vars? |
yes this is something i initially offered and they were happy with env vars |
This should probably have a basic smoke test. Probably something can be added using the tests in https://github.com/elastic/elastic-agent/blob/main/testing/integration/kubernetes_agent_standalone_test.go as a base. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much simplier, but doesn't reduce the image size. That is something that will come with time, I believe.
"beat/metrics-monitoring": false, | ||
"filestream-monitoring": false, | ||
"system/metrics-default": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there actually a way you can tell we started the OTel collector?
This test would still pass if we started elastic agent as usual, but disabled monitoring and didn't use the system/metrics integration/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but scenario you mentioned is not the default config nor any config we test with so chance of false positive is really small, especially when agent is reported healthy.
no way to tell agent is in otel besides logs that are with default config printed to stdout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't an HTTP port or something that returns otel specific data or something?
I don't feel that strongly about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improving this is something we could follow up with.
|
@amolnater-qasource I have added testing instructions for this PR to the PR description. |
Thank you!! @ycombinator |
Hi Team, Steps followed:
Hence, we are marking this ticket as QA:Validated. cc: @pierrehilbert Thanks!! |
Adding new type of docker image for amd64 and arm64
Image is based on wolfi and contains agent binary without components resulting in 277MB
Using separate otel entrypoint and Dockerfile templates for simplification
fixes: #5246
How to test this PR
These steps were added after this PR was merged and it's functionality was available in the next snapshot build.
8.16.0-SNAPSHOT
in a Docker container, setting the new environment variable introduced in this PR to run Agent in OTel mode.elastic-agent otel
process and no Beats or other sub-processes of theelastic-agent otel
process.