-
Notifications
You must be signed in to change notification settings - Fork 814
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
[trace-agent] adding output of 'trace-agent -info' #3164
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ DOGSTATSDPATH="/opt/datadog-agent/agent/dogstatsd.py" | |
KILL_PATH="/opt/datadog-agent/embedded/bin/kill" | ||
AGENTUSER="dd-agent" | ||
FORWARDERPATH="/opt/datadog-agent/agent/ddagent.py" | ||
TRACEAGENTPATH="/opt/datadog-agent/bin/trace-agent" | ||
NAME="datadog-agent" | ||
DESC="Datadog Agent" | ||
SUPERVISOR_PIDFILE="/opt/datadog-agent/run/datadog-supervisord.pid" | ||
|
@@ -176,7 +177,12 @@ case "$1" in | |
DOGSTATSD_RETURN=$? | ||
su $AGENTUSER -c "$FORWARDERPATH info" | ||
FORWARDER_RETURN=$? | ||
exit $(($COLLECTOR_RETURN+$DOGSTATSD_RETURN+$FORWARDER_RETURN)) | ||
TRACEAGENT_RETURN=0 | ||
if [ -x $TRACEAGENTPATH ]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. applies to the 2 other init files as well: I don't think we need to check that the trace agent binary exists and is executable, these init files are only used by the packaged Linux agent and it'll always ship the trace agent going forward, with correct exec permissions. Unless I'm missing something. |
||
su $AGENTUSER -c "$TRACEAGENTPATH -info" | ||
TRACEAGENT_RETURN=$? | ||
fi | ||
exit $(($COLLECTOR_RETURN+$DOGSTATSD_RETURN+$FORWARDER_RETURN+$TRACEAGENT_RETURN)) | ||
;; | ||
|
||
status) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ DESC="Datadog Agent" | |
AGENTPATH="/opt/datadog-agent/agent/agent.py" | ||
FORWARDERPATH="/opt/datadog-agent/agent/ddagent.py" | ||
DOGSTATSDPATH="/opt/datadog-agent/agent/dogstatsd.py" | ||
TRACEAGENTPATH="/opt/datadog-agent/bin/trace-agent" | ||
AGENTCONF="/opt/datadog-agent/etc/datadog.conf" | ||
SUPERVISOR_PIDFILE="/opt/datadog-agent/run/datadog-supervisord.pid" | ||
SUPERVISOR_CONF_FILE="/opt/datadog-agent/etc/supervisor.conf" | ||
|
@@ -111,6 +112,10 @@ case $1 in | |
RETURN_VALUE=$(($RETURN_VALUE || $?)) | ||
$FORWARDERPATH info | ||
RETURN_VALUE=$(($RETURN_VALUE || $?)) | ||
if [ -x $TRACEAGENTPATH ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can skip this file, we don't ship with osx |
||
$TRACEAGENTPATH -info | ||
RETURN_VALUE=$(($RETURN_VALUE || $?)) | ||
fi | ||
exit $RETURN_VALUE | ||
;; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ DOGSTATSDPATH="/opt/datadog-agent/agent/dogstatsd.py" | |
KILL_PATH="/opt/datadog-agent/embedded/bin/kill" | ||
AGENTUSER="dd-agent" | ||
FORWARDERPATH="/opt/datadog-agent/agent/ddagent.py" | ||
TRACEAGENTPATH="/opt/datadog-agent/bin/trace-agent" | ||
NAME="datadog-agent" | ||
DESC="Datadog Agent" | ||
SUPERVISOR_PIDFILE="/opt/datadog-agent/run/datadog-supervisord.pid" | ||
|
@@ -417,7 +418,12 @@ case "$1" in | |
DOGSTATSD_RETURN=$? | ||
su $AGENTUSER -c "$FORWARDERPATH info" | ||
FORWARDER_RETURN=$? | ||
exit $(($COLLECTOR_RETURN+$DOGSTATSD_RETURN+$FORWARDER_RETURN)) | ||
TRACEAGENT_RETURN=0 | ||
if [ -x $TRACEAGENTPATH ]; | ||
su $AGENTUSER -c "$TRACEAGENTPATH -info" | ||
TRACEAGENT_RETURN=$? | ||
fi | ||
exit $(($COLLECTOR_RETURN+$DOGSTATSD_RETURN+$FORWARDER_RETURN+$TRACEAGENT_RETURN)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as mentioned in chat, i'd prefer if we don't include $TRACEAGENT_RETURN in the exit code. we mark it as an optional process, disabled by default. since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The way I see it, the exit code should reflect trace agent's status if it's enabled and discard it/ignore it otherwise. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
this is the only way. i agree with @truthbk 's logic in principle if this is not too messy to implement |
||
;; | ||
|
||
status) | ||
|
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.
can skip this file, we don't ship with the source install