Code Monkey home page Code Monkey logo

Comments (10)

henryzhang1984 avatar henryzhang1984 commented on July 17, 2024

image

from lambda-cloudwatch-slack.

rozhok avatar rozhok commented on July 17, 2024

Same here. What should we tune?

from lambda-cloudwatch-slack.

creichert avatar creichert commented on July 17, 2024

@henryzhang1984 Your event seems to be going through SNS, but what service is sending the event? I think there are currently some limitations that the processor has to be pre-defined: https://github.com/assertible/lambda-cloudwatch-slack/blob/master/config.js#L11

I'm happy to check this out if you can post your (scrubbed) event.

from lambda-cloudwatch-slack.

creichert avatar creichert commented on July 17, 2024

@rozhok What does your event look like?

IMO, we probably need a better way to have a default "catchall" type event.

from lambda-cloudwatch-slack.

rozhok avatar rozhok commented on July 17, 2024

Here we go:

{
  "Records": [
    {
      "EventSource": "aws:sns",
      "EventVersion": "1.0",
      "EventSubscriptionArn": "arn:aws:sns:eu-west-1:111111111111111:samlpe-alert:ff1e3698-7f85-4da2-a90e-13ad2afe30e0",
      "Sns": {
        "Type": "Notification",
        "MessageId": "0d7a65e4-435e-5ff1-8e80-37e6fba3ef4f",
        "TopicArn": "arn:aws:sns:eu-west-1:111111111111111:Sample-alert",
        "Subject": "ALARM: \"Sample Alert\" in EU - Ireland",
        "Message": "{\"AlarmName\":\"Sample Alert\",\"AlarmDescription\":null,\"AWSAccountId\":\"111111111111111\",\"NewStateValue\":\"ALARM\",\"NewStateReason\":\"Threshold Crossed: 1 datapoint [1446.0 (07/08/17 18:46:00)] was greater than or equal to the threshold (1000.0).\",\"StateChangeTime\":\"2017-08-07T18:51:41.602+0000\",\"Region\":\"EU - Ireland\",\"OldStateValue\":\"OK\",\"Trigger\":{\"MetricName\":\"RequestCount\",\"Namespace\":\"AWS/ApplicationELB\",\"StatisticType\":\"Statistic\",\"Statistic\":\"SUM\",\"Unit\":null,\"Dimensions\":[{\"name\":\"LoadBalancer\",\"value\":\"app/app/6892f491c9b95d3f\"}],\"Period\":300,\"EvaluationPeriods\":1,\"ComparisonOperator\":\"GreaterThanOrEqualToThreshold\",\"Threshold\":1000.0,\"TreatMissingData\":\"\",\"EvaluateLowSampleCountPercentile\":\"\"}}",
        "Timestamp": "2017-08-07T18:51:41.652Z",
        "SignatureVersion": "1",
        "Signature": "lol",
        "SigningCertUrl": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-b95095beb82e8f6a0463n12jnkndswea.pem",
        "UnsubscribeUrl": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:111111111111111:Sample-alert:ff1e3698-7f85-4da2-a90e-13ad2afe30e0",
        "MessageAttributes": {}
      }
    }
  ]
}

from lambda-cloudwatch-slack.

creichert avatar creichert commented on July 17, 2024

We are working on this in #20

from lambda-cloudwatch-slack.

henryzhang1984 avatar henryzhang1984 commented on July 17, 2024

image

from lambda-cloudwatch-slack.

CodyReichert avatar CodyReichert commented on July 17, 2024

Thanks @henryzhang1984 - I see 2 issues here:

  1. The ECONNREFUSED error. Do you have a correct UNENCRYPTED_HOOK_URL value set in the deploy.env file when you deployed to lambda? That's only reason I can see that happening (becuase it did successfully matched a CloudWatch event).

  2. In your original issue, you did post the no matching processor found for event. That one will be fixed in #20. (It also seems like you've corrected the EventSubscriptionArn since then, so you should be getting past this).

Can you double check the webhook URL you have configured? Does that all look correct?

from lambda-cloudwatch-slack.

CodyReichert avatar CodyReichert commented on July 17, 2024

Hey all - we just released v0.2.1 that contains a 'catch-all' handler for events that don't have a matching processor. Now, SampleEvents and various things like should work.

@henryzhang1984 - I believe ECONNREFUSED is an issue with not having a correct Slack Hook URL, so if you're still having issues with that please open another issue and I'll check it out!

from lambda-cloudwatch-slack.

rozhok avatar rozhok commented on July 17, 2024

@CodyReichert thanks! Will test it soon.

from lambda-cloudwatch-slack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.