Skip to content
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

DP-1537: Limit Influx db volume getting huge overtime #20

Merged
merged 8 commits into from
May 23, 2024
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
ARG TELEGRAF_VERSION="1.24-alpine"
ARG TELEGRAF_VERSION="1.30-alpine"
FROM telegraf:${TELEGRAF_VERSION}

# Labels
LABEL description="MOV.AI metrics collector"
LABEL maintainer="[email protected]"
LABEL movai="telegraf"
LABEL environment="develop"
LABEL environment="production"

COPY files/telegraf.conf /etc/telegraf/telegraf.conf
# Copy configuration files
COPY files/telegraf_full.conf /etc/telegraf/telegraf_full.conf
COPY files/telegraf_light.conf /etc/telegraf/telegraf_light.conf
COPY files/entrypoint.sh /entrypoint.sh

RUN chmod o+w /etc/telegraf/telegraf.conf
ENV TELEGRAF_CONFIG_PATH /etc/telegraf/telegraf_full.conf

# Rest is upstream
RUN chmod o+w /etc/telegraf/telegraf_full.conf /etc/telegraf/telegraf_light.conf \
&& rm -f /etc/telegraf/telegraf.conf \
&& chmod +x /entrypoint.sh
4 changes: 2 additions & 2 deletions files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ if [ "$enable_plugin_thermalthrottle" = "true" ]; then
metrics="${metrics},\"thermal\""
fi

if [ -n "$metrics" ] && ! grep linux_cpu /etc/telegraf/telegraf.conf -q; then
if [ -n "$metrics" ] && ! grep linux_cpu $TELEGRAF_CONFIG_PATH -q; then
# Include the configuration for the [[inputs.linux_cpu]] plugin
cat <<EOF >> /etc/telegraf/telegraf.conf
cat <<EOF >> $TELEGRAF_CONFIG_PATH

[[inputs.linux_cpu]]
host_sys = "/hostfs/sys"
Expand Down
Loading
Loading