Skip to content

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

Open
@tomiloza

Description

@tomiloza

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions