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

Error when executing alertmanager_test, the Alertmanager v1 API was deprecated. #494

Closed
eyett opened this issue Aug 11, 2024 · 8 comments
Closed

Comments

@eyett
Copy link
Contributor

eyett commented Aug 11, 2024

I was using alertmanager_test daily, but after upading to the latest version, the alerts stopped coming.

<% if p('alertmanager.test_alert.daily') %>
# Send a test alert daily
cp /var/vcap/jobs/alertmanager/bin/alertmanager_test /etc/cron.daily
<% else %>
# Remove pre-existing daily test alert
rm -f /etc/cron.daily/alertmanager_test
<% end %>

When trying to run it manually, seems there's an error returned, the Alertmanager v1 API was deprecated.

  • Sshed into the alertmanager vm, then manually run alertmanager_test
alertmanager:~# /var/vcap/jobs/alertmanager/bin/alertmanager_test
{"status":"deprecated","error":"The Alertmanager v1 API was deprecated in version 0.16.0 and is removed as of version 0.28.0 - please use the equivalent route in the v2 API"}
  • deploy cli
bosh -e $BOSH_ENV -d prometheus deploy $UPSTREAM_PATH/prometheus.yml \
  -o $UPSTREAM_PATH/operators/enable-grafana-uaa.yml \
  -o $UPSTREAM_PATH/operators/monitor-bosh.yml \
  -o $UPSTREAM_PATH/operators/monitor-cf.yml \
  -o $UPSTREAM_PATH/operators/monitor-elasticsearch.yml \
  -o $UPSTREAM_PATH/operators/monitor-concourse.yml \
  -o $UPSTREAM_PATH/operators/enable-service-discovery.yml \
  -o $UPSTREAM_PATH/operators/enable-cf-route-registrar.yml \
  -o $UPSTREAM_PATH/operators/alertmanager-slack-receiver.yml \
  -o $UPSTREAM_PATH/operators/enable-bosh-uaa.yml \
  --vars-file vars.yml $@
  • version, env
    v30.3.0, deployed on AWS
@benjaminguttmann-avtq
Copy link
Contributor

Hi @eyett ,

thanks for reporting the issue.
Are you interested in providing a PR to fix this?

@eyett
Copy link
Contributor Author

eyett commented Aug 13, 2024

Hello @benjaminguttmann-avtq
I would be interested, however I'm pretty new to this bosh/cf system.
I might not know how this release system works..
Thanks for checking.

@benjaminguttmann-avtq
Copy link
Contributor

Hi @eyett ,

there are no specific things to pay attention to. You basically create a fork, then you adjust this line and replace v1 with v2 and create a PR.

@eyett
Copy link
Contributor Author

eyett commented Aug 14, 2024

What was confused for me was, where do these alertmanager binaries come from.
Theses binary executables of alertmanager/alertmanager-0.27.0.linux-amd64.tar.gz, aren't they coming from a remote?
As far as I understood, the binaries including the error causing alertmanager_test, are unzipped from this tar, so may the tar be the one that need to be fixed?

config.yml

alertmanager/alertmanager-0.27.0.linux-amd64.tar.gz:
  size: 30866868
  object_id: 0ff68b26-1e55-4a1f-69da-e1def36708ef
  sha: sha256:23c3f5a3c73de91dbaec419f3c492bef636deb02680808e5d842e6553aa16074

packages/alertmanager/packaging

set -eux

# Copy common utils
mkdir -p ${BOSH_INSTALL_TARGET}/common
cp -a ${BOSH_COMPILE_TARGET}/common/* ${BOSH_INSTALL_TARGET}/common

# Extract alertmanager package
mkdir -p ${BOSH_INSTALL_TARGET}/bin
tar xzvf ${BOSH_COMPILE_TARGET}/alertmanager/alertmanager-0.27.0.linux-amd64.tar.gz
cp -a ${BOSH_COMPILE_TARGET}/alertmanager-0.27.0.linux-amd64/* ${BOSH_INSTALL_TARGET}/bin

@benjaminguttmann-avtq
Copy link
Contributor

The alertmanager binaries get pulled from the upstream and added as a blob to be used by the BOSH release. Nothing you need to worry about.

@eyett
Copy link
Contributor Author

eyett commented Aug 14, 2024

Ah ha.. I think I might get it now..
Tried creating a PR...

@benjaminguttmann-avtq
Copy link
Contributor

We will most likely create a new release end of this month which will include you fix @eyett . Thanks for submitting it.

@eyett
Copy link
Contributor Author

eyett commented Aug 14, 2024

Thank you for the guide @benjaminguttmann-avtq .

#495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants