Skip to content

Commit

Permalink
Remove Opentelemetry instrumentation agent from the runtime
Browse files Browse the repository at this point in the history
We decided to instrument our application code manually by leveraging a
customized middleware implemented in pulpcore.

Refer to pulp/pulpcore#5943 for more.
  • Loading branch information
lubosmj committed Oct 30, 2024
1 parent ccfbb55 commit 5158851
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 21 deletions.
2 changes: 0 additions & 2 deletions docs/admin/guides/deploy-multi-process-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ The following environment variables configure the container's behavior.

* `PULP_GUNICORN_TIMEOUT` A positive integer that specifies the [timeout for gunicorn process](https://docs.gunicorn.org/en/stable/settings.html#timeout). Default to 90.

* `PULP_OTEL_ENABLED` Set to "true" (all lowercase) if you wish to enable pulp telemetry.

To add one of them, modify the command you use to start pulp to include syntax like the following at the beginning: Instead of `podman run`, specify `podman run -e PULP_WORKERS=4 -e PULP_GUNICORN_TIMEOUT=30 ...`

### Adding Signing Services
Expand Down
2 changes: 0 additions & 2 deletions docs/admin/reference/available-images/multi-process-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ The following environment variables configure the container's behavior.

* `PULP_GUNICORN_TIMEOUT` A positive integer that specifies the [timeout for gunicorn process](https://docs.gunicorn.org/en/stable/settings.html#timeout). Default to 90.

* `PULP_OTEL_ENABLED` Set to "true" (all lowercase) if you wish to enable pulp telemetry.

* `PULP_API_WORKERS_MAX_REQUESTS` The maximum number of requests a worker will process before restarting API workers. If this is set to zero (the default) then the automatic worker restarts are disabled. NOTE: Only supported for pulpcore >= 3.41.0

* `PULP_API_WORKERS_MAX_REQUESTS_JITTER` The maximum jitter to add to the max_requests setting for API workers. NOTE: Only supported for pulpcore >= 3.41.0
Expand Down
2 changes: 0 additions & 2 deletions images/pulp_ci_centos/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ RUN curl -Ls https://github.com/just-containers/s6-overlay/releases/download/v3.

ENV PULP_GUNICORN_RELOAD=${PULP_GUNICORN_RELOAD:-false}

ENV PULP_OTEL_ENABLED=${PULP_OTEL_ENABLED:-false}

ENV PULP_WORKERS=2

ENV PULP_HTTPS=false
Expand Down
5 changes: 1 addition & 4 deletions images/s6_assets/init/pulpcore-api
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
if [ "${PULP_GUNICORN_RELOAD}" = "true" ]; then
PULP_GUNICORN_RELOAD_STRING="--reload"
fi
if [ "${PULP_OTEL_ENABLED}" = "true" ]; then
OTEL_PREFIX="/usr/local/bin/opentelemetry-instrument --service_name pulp-api"
fi

if which pulpcore-api
then
Expand Down Expand Up @@ -32,7 +29,7 @@ then
PULP_GUNICORN_PROCESS_RECYCLING_STRING="--max-requests ${PULP_API_WORKERS_MAX_REQUESTS} --max-requests-jitter ${PULP_API_WORKERS_MAX_REQUESTS_JITTER}"
fi

exec ${OTEL_PREFIX} "${PULP_API_ENTRYPOINT[@]}" \
exec "${PULP_API_ENTRYPOINT[@]}" \
--timeout "${PULP_GUNICORN_TIMEOUT}" \
--workers "${PULP_API_WORKERS}" \
${PULP_GUNICORN_PROCESS_RECYCLING_STRING} \
Expand Down
5 changes: 1 addition & 4 deletions images/s6_assets/init/pulpcore-content
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
if [ "${PULP_GUNICORN_RELOAD}" = "true" ]; then
PULP_GUNICORN_RELOAD_STRING="--reload"
fi
if [ "${PULP_OTEL_ENABLED}" = "true" ]; then
OTEL_PREFIX="/usr/local/bin/opentelemetry-instrument --service_name pulp-content"
fi

if which pulpcore-content
then
Expand Down Expand Up @@ -32,7 +29,7 @@ then
PULP_GUNICORN_PROCESS_RECYCLING_STRING="--max-requests ${PULP_CONTENT_WORKERS_MAX_REQUESTS} --max-requests-jitter ${PULP_CONTENT_WORKERS_MAX_REQUESTS_JITTER}"
fi

exec ${OTEL_PREFIX} "${PULP_CONTENT_ENTRYPOINT[@]}" \
exec "${PULP_CONTENT_ENTRYPOINT[@]}" \
--timeout "${PULP_GUNICORN_TIMEOUT}" \
--workers "${PULP_CONTENT_WORKERS}" \
${PULP_GUNICORN_PROCESS_RECYCLING_STRING} \
Expand Down
5 changes: 1 addition & 4 deletions images/s6_assets/init/pulpcore-worker
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/bin/bash
if [ "${PULP_OTEL_ENABLED}" = "true" ]; then
OTEL_PREFIX="/usr/local/bin/opentelemetry-instrument --service_name pulp-worker"
fi
exec $OTEL_PREFIX /usr/local/bin/pulpcore-worker
exec /usr/local/bin/pulpcore-worker
1 change: 0 additions & 1 deletion images/s6_assets/s6-rc.d/pulpcore-api/run
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ importas HOME HOME
importas PULP_GUNICORN_TIMEOUT PULP_GUNICORN_TIMEOUT
importas PULP_API_WORKERS PULP_API_WORKERS
importas PULP_GUNICORN_RELOAD PULP_GUNICORN_RELOAD
importas PULP_OTEL_ENABLED PULP_OTEL_ENABLED
importas PULP_API_WORKERS_MAX_REQUESTS PULP_API_WORKERS_MAX_REQUESTS
importas PULP_API_WORKERS_MAX_REQUESTS_JITTER PULP_API_WORKERS_MAX_REQUESTS_JITTER
foreground { s6-echo "Calling /etc/init/pulpcore-api" }
Expand Down
1 change: 0 additions & 1 deletion images/s6_assets/s6-rc.d/pulpcore-content/run
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ importas HOME HOME
importas PULP_GUNICORN_TIMEOUT PULP_GUNICORN_TIMEOUT
importas PULP_CONTENT_WORKERS PULP_CONTENT_WORKERS
importas PULP_GUNICORN_RELOAD PULP_GUNICORN_RELOAD
importas PULP_OTEL_ENABLED PULP_OTEL_ENABLED
importas PULP_CONTENT_WORKERS_MAX_REQUESTS PULP_CONTENT_WORKERS_MAX_REQUESTS
importas PULP_CONTENT_WORKERS_MAX_REQUESTS_JITTER PULP_CONTENT_WORKERS_MAX_REQUESTS_JITTER
foreground { s6-echo "Calling /etc/init/pulpcore-content" }
Expand Down
1 change: 0 additions & 1 deletion images/s6_assets/s6-rc.d/pulpcore-worker@1/run
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ export HOME /var/lib/pulp/
importas HOME HOME
export PATH /usr/local/bin:/usr/bin/
importas PATH PATH
importas PULP_OTEL_ENABLED PULP_OTEL_ENABLED
foreground { s6-echo "Calling /etc/init/pulpcore-worker" }
/etc/init/pulpcore-worker

0 comments on commit 5158851

Please sign in to comment.