-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add otelcol shortcut to elastic-agent otel
#4816
Conversation
This pull request does not have a backport label. Could you fix it @nchaulet? 🙏
NOTE: |
thoughts on doing otelcol instead of elastic-otel? or elastic-otel-collector? |
|
|
||
BASEDIR=$(dirname "$0") | ||
|
||
exec $BASEDIR/elastic-agent 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.
For Darwin and Linux I believe we actually want
exec "$BASEDIR/elastic-agent" otel "$@"
If you put elastic-agent into a folder with a space and then cd to root and try to run it, it will fail due to the space without the path being quoted.
In addition I believe $@ needs to be in quotes:
($@) Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word.
./a.sh 2 "3 4" 5
2 3 4 5 # output for "$@"
2 3 4 5 # output for $@ -> spaces are lost!
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, run shellcheck on this and it should find this problem and any other Bash quirks.
elastic-agent otel
elastic-agent otel
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
dev-tools/packaging/packages.yml
Outdated
@@ -811,10 +832,7 @@ specs: | |||
'data/{{.BeatName}}-{{ commit_short }}/elastic-agent': | |||
template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/elastic-agent.tmpl' | |||
mode: 0755 | |||
'{{.BeatName}}{{.BinaryExt}}': |
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.
intentional?
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.
No, I will re-add this
…-agent into feature-elastic-otel-cmd
|
(cherry picked from commit 6a02d8b) # Conflicts: # dev-tools/packaging/packages.yml
Description
Resolve #4661
Provide an
otelcol
shortcut toelastic-agent otel
cmd.The solution with a shell script seems to work well for mac and linux, for windows I had to create an
elastic-otel.ps1
to be executable. @ycombinator @blakerouse it is acceptable for windows? is there a better implementation possible?Tests
You can build the agent and test that is working. Should we have some automated test for those new shortcuts? and is there something in place to build them?