Migrating from Telegraf 1.14.5 to 1.29.5

Trying to migrate from Telegraf 1.14.5 to 1.29.5 due to a vulnerability issue.

I am running into an error like this after the upgrade:

12:52:25 2024-03-14T19:52:25Z I! Loading config: /etc/telegraf/telegraf.conf 12:52:25 2024-03-14T19:52:25Z E! error loading config file /etc/telegraf/telegraf.conf: error parsing jolokia2_exec_agent, undefined but requested input: jolokia2_exec_agent

Can anyone guide me on the steps required to do this upgrade ?

Also, we have following plugins-
/plugins/inputs/jolokia2_exec/
/plugins/inputs/jolokia2_general/
/plugins/outputs/s3/
/plugins/aggregators/tagcounter/

Attaching below our docker file and telegraf.conf for reference.

FROM ......./oicp/standard/base/debian11

ARG TELEGRAF_RELEASE=1.14.5
ENV TELEGRAF_RELEASE=$TELEGRAF_RELEASE

ARG GO_VER=1.13-0-stretch
ENV GO_VER=$GO_VER

USER root

RUN apt-get update \
	&& apt-get -y install gcc \
			wget \
			curl \
			git \
			make \
			python \
			rpm \
			ruby-dev \
			build-essential \
			golang

RUN gem install fpm

RUN go get github.com/influxdata/telegraf
# RUN go get github.com/aws/aws-sdk-go

# RUN mkdir /usr/local/go/bin
## Install dep for older versions of telegraf
# RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
## (OR)
# RUN wget http://ftp.us.debian.org/debian/pool/main/g/go-dep/go-dep_0.5.4-3_amd64.deb
# RUN apt-get install -y /usr/local/go-dep_0.5.4-3_amd64.deb

RUN go env

RUN cd /root/go/src/github.com/influxdata/telegraf/ && git checkout v${TELEGRAF_RELEASE}

COPY plugins/aggregators/ /root/go/src/github.com/influxdata/telegraf/plugins/aggregators/
COPY plugins/inputs/ /root/go/src/github.com/influxdata/telegraf/plugins/inputs/
COPY plugins/outputs/ /root/go/src/github.com/influxdata/telegraf/plugins/outputs/
COPY telegraf.conf /usr/local/telegraf.conf

RUN sed -i '$ i\ _ "github.com/influxdata/telegraf/plugins/inputs/jolokia2_exec"' /root/go/src/github.com/influxdata/telegraf/plugins/inputs/all/all.go
RUN sed -i '$ i\ _ "github.com/influxdata/telegraf/plugins/outputs/s3"' /root/go/src/github.com/influxdata/telegraf/plugins/outputs/all/all.go
RUN sed -i '$ i\ _ "github.com/influxdata/telegraf/plugins/aggregators/tagcounter"' /root/go/src/github.com/influxdata/telegraf/plugins/aggregators/all/all.go


RUN cd /root/go/src/github.com/influxdata/telegraf && ./scripts/build.py --version="${TELEGRAF_RELEASE}" --package --platform=linux --arch=amd64

RUN apt-get install -y /root/go/src/github.com/influxdata/telegraf/build/telegraf_${TELEGRAF_RELEASE}-1_amd64.deb
RUN cp /usr/local/telegraf.conf /etc/telegraf/telegraf.conf

RUN rm -rf /root/go /usr/local/.cache /usr/local/.rpmdb

RUN mkdir /app \
	&& chown -R appuser:appuser /app \
	&& chmod -R 775 /app \
	&& chown -R appuser:appuser /usr/local

RUN ["/home/appuser/post_harden.sh"]

USER appuser

CMD ["telegraf"]
~~~~~~~~~~~~~~~~~ End docker file ~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~ telegraf.conf ~~~~~~~~~~~~~~~~~~~~
[agent]
  collection_jitter = "0s"
  flush_interval = "1s"
  flush_jitter = "0s"
  interval = "0.3s"
  logfile = "/app/telegraf/telegraf.log"
  metric_batch_size = 1000
  metric_buffer_limit = 1000
  round_interval = true

[global_tags]
  app = "fpos"
  bu = "ifdp"
  env = "qa"
  location = "us-west-2"
  source = "octomon"

[[inputs.jolokia2_exec_agent]]
  urls = ["http://localhost:8080/jolokia"]

[[inputs.jolokia2_exec_agent.metric]]
  mbean = "com.abcd.platform.fdp.monitoring:type=ExecutionDetailQueue"
  name = "monitor_execution_details"
  operation = "poll"
  repeatMetric = true
  repeatTime = 300

[[aggregators.tagcounter]]
  drop_original = true
  period = "1s"
  tag_names = ["fdpErrorCode", "tier", "flow_category", "abcd_fdp_flowname",
               "abcd_country", "providerId", "abcd_offeringid", "platform", "env",
               "bu", "location", "app", "source"]

[[outputs.s3]]
  accountid = "247827617643"
  bucket = "intu-oim-dev-3-us-west-2"
  credential_url = "https://ticketmaster.cet.a.abcd.com/oim"
  data_format = "wavefront"
  prefix = "custom.ifdp.monitoring."
  region = "us-west-2"
~~~~~~~~~~~~~~~~~ End of telegraf.conf ~~~~~~~~~~~~~~~~~~~~

I’ve not heard of this plugin before and I don’t see it in v1.14.5 tag.

There is the jolokia2_agent, which looks to do what you are trying to do.

outputs/s3/
aggregators/tagcounter/

These don’t exist either… aaah are you saying you have these custom plugins?

In which case you need to ensure that they are added correctly. You can view an example in the input docs, where you add the code AND you need to register the plugin in the plugins/inputs/all/... directory.