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

Region not take from --arn-prefix and message not pushed to SNS Topic #32

Open
tomiloza opened this issue Jun 16, 2020 · 1 comment
Open

Comments

@tomiloza
Copy link

Installed lastest version of alertmanager-sns-binary and configured binary with following cmd line parameters on amazon-linux2:

/opt/alertmanager_sns/bin/alertmanager-sns-forwarder --addr ":9087" --arn-prefix arn:aws:sns:eu-central-1:xxxxxxxxxxx: --debug

Executed CURL post with test data provided in repo:

curl -H "Content-Type: application/json" --data @test_alert.json http://localhost:9087/alert/sns_traffic_monitoring_alarm

Logs for posted Request:
[alertmanager_sns]: time="2020-06-16T09:57:35Z" level=debug msg="Using topic ARN: arn:aws:sns:eu-central-1:xxxxxxxxx:sns_traffic_monitoring_alarm"
[alertmanager_sns]: time="2020-06-16T09:57:35Z" level=debug msg="+------------------ A L E R T J S O N -------------------+"
[alertmanager_sns]: time="2020-06-16T09:57:35Z" level=debug msg="{ "receiver": "admins", "status": "firing", "alerts": [ { "status": "firing", "la
bels": { "alertname": "something_happend", "env": "prod", "instance": "server01.int:9100", "job": "node", "service": "prometheus_bot"
, "severity": "warning", "supervisor": "runit" }, "annotations": { "summary": "Oops, something happend!" }, "startsAt": "20
16-04-27T20:46:37.903Z", "endsAt": "0001-01-01T00:00:00Z", "generatorURL": "https://example.com/graph#..." } ], "groupLabels": { "alertname": "something_happend", "
instance": "server01.int:9100" }, "commonLabels": { "alertname": "something_happend", "env": "prod", "instance": "server01.int:9100", "job": "node", "service": "pro
metheus_bot", "severity": "warning", "supervisor": "runit" }, "commonAnnotations": { "summary": "runit service prometheus_bot restarted, server01.int:9100" }, "externalURL": "htt
ps://alert-manager.example.com", "version": "3", "groupKey": 43434343434343434343}"
[alertmanager_sns]: time="2020-06-16T09:57:35Z" level=debug msg=+-----------------------------------------------------------+
[alertmanager_sns]: time="2020-06-16T09:57:35Z" level=warning msg="MissingRegion: could not find region configuration"
[alertmanager_sns]: [GIN] 2020/06/16 - 09:57:35 | 503 | 181.948µs | 127.0.0.1 | POST /alert/sns_traffic_monitoring_alarm

What did you expect to happen instead:
Expected that the message is pushed to SNS_TOPIC. Metrics displayed under the Metrics /metrics endpoint show tat the message was unsuccessfully delivered to SNS TOPIC

Warning messaged displays:
[alertmanager_sns]: time="2020-06-16T09:57:35Z" level=warning msg="MissingRegion: could not find region configuration"

But the region configuration should be taken from SNS ARN provided by the input configuration parameters

After Adding the AWS Environment Region parameters in the system.d configuration:
Environment="AWS_REGION=eu-central-1"

The message is successfully delivered:

[alertmanager_sns]: time="2020-06-16T11:12:36Z" level=debug msg=+-----------------------------------------------------------+
[alertmanager_sns]: time="2020-06-16T11:12:36Z" level=info msg="{\n MessageId: "7fdfe9de-4395-521a-ad91-bebce8f1553c"\n}"

According to the Documentation this should not be necessary:
Alternatively, if you provide the ARN prefix argument (described in the next section), the region will be parsed from the prefix and it's not necessary to provide it.

@nourspace
Copy link

Same here. I assume using prefix ARN and not an actual one is failing to return a region. The error message is not to be found in this code rather in the arn parser.

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

No branches or pull requests

2 participants