AWS Lambda function, that sends the metrics to CloudWatchAWS Lambda recursive invocation works too good?What is the best way to write log data from Kinesis to Cloudwatch?Starting with Lambda and Ec2 and S3"EndpointConnectionError : unable to connect to endpoint https://lambda-xyz/wehwk.comCloudwatch logs filter to trigger lambda then extract values from log dataSend Cloudwatch logs matching a pattern to SQS queueDynamoDB Trigger Lambda Function PROBLEM: Function call failedPass and use input (parameters) to a lambda task from a step functionLambda Function to Call DatabaseHow to monitor website status with AWS Lambda and CloudWatch?

Links to webpages in books

What can I do to find new work while my workplace is closed due to an accidental death?

How to determine what is the correct level of detail when modelling?

Going to get married soon, should I do it on Dec 31 or Jan 1?

Why does the A-4 Skyhawk sit nose-up when on ground?

Does the posterior necessarily follow the same conditional dependence structure as the prior?

Layout of complex table

Story-based adventure with functions and relationships

Origin of 'cuz' as shortening for cousin?

How to get cool night-vision without lame drawbacks?

Is adding a new player (or players) a DM decision, or a group decision?

Why do some games show lights shine through walls?

Do equal angles necessarily mean a polygon is regular?

How many satellites can stay in a Lagrange point?

Why is the Turkish president's surname spelt in Russian as Эрдоган, with г?

Gare du Nord to Gare de Lyon transfer time for a family

How to append a matrix element by element?

Should I tell my insurance company I'm making payments on my new car?

Fedora boot screen shows both Fedora logo and Lenovo logo. Why and How?

STM Microcontroller burns every time

Do French speakers not use the subjunctive informally?

Does the Paladin's Aura of Protection affect only either her or ONE ally in range?

If temperature is related to average kinetic energy in an ideal gas, then does speeding up the gas container affect its temperature?

Does anycast addressing add additional latency in any way?



AWS Lambda function, that sends the metrics to CloudWatch


AWS Lambda recursive invocation works too good?What is the best way to write log data from Kinesis to Cloudwatch?Starting with Lambda and Ec2 and S3"EndpointConnectionError : unable to connect to endpoint https://lambda-xyz/wehwk.comCloudwatch logs filter to trigger lambda then extract values from log dataSend Cloudwatch logs matching a pattern to SQS queueDynamoDB Trigger Lambda Function PROBLEM: Function call failedPass and use input (parameters) to a lambda task from a step functionLambda Function to Call DatabaseHow to monitor website status with AWS Lambda and CloudWatch?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I need to monitor my AWS EFS size by using the AWS lambda function. How can push the metrics to:



  • Prometheus?

  • CloudWatch?

I've created the Lambda script, that outputs to the log the values, that I need to monitor.



import boto3

client = boto3.client('efs')
response = client.describe_file_systems()

def lambda_handler(event, context):
for index, (key, value) in enumerate(response.items()):
print(response['FileSystems'][index]['Name'] + ": " + str(response['FileSystems'][index]['SizeInBytes']['Value']))


In output I receive the EFS name and EFS size:



Function Logs:
START RequestId: be212482-3af7-44d10-97ba-60a66m0fa431 Version: $LATEST
EFS1: 3243905849
EFS2: 9823974308


How can I wrap it up to the metrica's format and push it to Cloudwatch or Prometheus?



Thanks in advance.










share|improve this question




























    0















    I need to monitor my AWS EFS size by using the AWS lambda function. How can push the metrics to:



    • Prometheus?

    • CloudWatch?

    I've created the Lambda script, that outputs to the log the values, that I need to monitor.



    import boto3

    client = boto3.client('efs')
    response = client.describe_file_systems()

    def lambda_handler(event, context):
    for index, (key, value) in enumerate(response.items()):
    print(response['FileSystems'][index]['Name'] + ": " + str(response['FileSystems'][index]['SizeInBytes']['Value']))


    In output I receive the EFS name and EFS size:



    Function Logs:
    START RequestId: be212482-3af7-44d10-97ba-60a66m0fa431 Version: $LATEST
    EFS1: 3243905849
    EFS2: 9823974308


    How can I wrap it up to the metrica's format and push it to Cloudwatch or Prometheus?



    Thanks in advance.










    share|improve this question
























      0












      0








      0








      I need to monitor my AWS EFS size by using the AWS lambda function. How can push the metrics to:



      • Prometheus?

      • CloudWatch?

      I've created the Lambda script, that outputs to the log the values, that I need to monitor.



      import boto3

      client = boto3.client('efs')
      response = client.describe_file_systems()

      def lambda_handler(event, context):
      for index, (key, value) in enumerate(response.items()):
      print(response['FileSystems'][index]['Name'] + ": " + str(response['FileSystems'][index]['SizeInBytes']['Value']))


      In output I receive the EFS name and EFS size:



      Function Logs:
      START RequestId: be212482-3af7-44d10-97ba-60a66m0fa431 Version: $LATEST
      EFS1: 3243905849
      EFS2: 9823974308


      How can I wrap it up to the metrica's format and push it to Cloudwatch or Prometheus?



      Thanks in advance.










      share|improve this question














      I need to monitor my AWS EFS size by using the AWS lambda function. How can push the metrics to:



      • Prometheus?

      • CloudWatch?

      I've created the Lambda script, that outputs to the log the values, that I need to monitor.



      import boto3

      client = boto3.client('efs')
      response = client.describe_file_systems()

      def lambda_handler(event, context):
      for index, (key, value) in enumerate(response.items()):
      print(response['FileSystems'][index]['Name'] + ": " + str(response['FileSystems'][index]['SizeInBytes']['Value']))


      In output I receive the EFS name and EFS size:



      Function Logs:
      START RequestId: be212482-3af7-44d10-97ba-60a66m0fa431 Version: $LATEST
      EFS1: 3243905849
      EFS2: 9823974308


      How can I wrap it up to the metrica's format and push it to Cloudwatch or Prometheus?



      Thanks in advance.







      amazon-web-services aws-lambda prometheus






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 11:00









      Ilya BogomolnyyIlya Bogomolnyy

      1581 gold badge2 silver badges17 bronze badges




      1581 gold badge2 silver badges17 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          0














          To send metrics to Cloudwatch follow the steps:


          Create a Lambda Function with a proper role attached to it. The Role should contain the following policy:




          "Version": "2012-10-17",
          "Statement": [

          "Sid": "VisualEditor0",
          "Effect": "Allow",
          "Action": [
          "logs:CreateLogGroup",
          "logs:CreateLogStream",
          "logs:PutLogEvents"
          ],
          "Resource": "*"

          ]



          After attaching the above policy to the function, lambda function should have the permissions to Cloudwatch and Cloudwatch Logs.



          Deploy your code to Lambda Function and Save it.



          Click on 'Test' button to test the lambda function.



          Go to Cloudwatch Metrics Page to see if the metrics are available.

          It could take around 5- 20 minutes for the metric to appear in the Cloudwatch console.

          You should see the namespace which you have specified in the code, appeared in the Cloudwatch console.




          Thanks






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55336307%2faws-lambda-function-that-sends-the-metrics-to-cloudwatch%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            To send metrics to Cloudwatch follow the steps:


            Create a Lambda Function with a proper role attached to it. The Role should contain the following policy:




            "Version": "2012-10-17",
            "Statement": [

            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
            "logs:CreateLogGroup",
            "logs:CreateLogStream",
            "logs:PutLogEvents"
            ],
            "Resource": "*"

            ]



            After attaching the above policy to the function, lambda function should have the permissions to Cloudwatch and Cloudwatch Logs.



            Deploy your code to Lambda Function and Save it.



            Click on 'Test' button to test the lambda function.



            Go to Cloudwatch Metrics Page to see if the metrics are available.

            It could take around 5- 20 minutes for the metric to appear in the Cloudwatch console.

            You should see the namespace which you have specified in the code, appeared in the Cloudwatch console.




            Thanks






            share|improve this answer



























              0














              To send metrics to Cloudwatch follow the steps:


              Create a Lambda Function with a proper role attached to it. The Role should contain the following policy:




              "Version": "2012-10-17",
              "Statement": [

              "Sid": "VisualEditor0",
              "Effect": "Allow",
              "Action": [
              "logs:CreateLogGroup",
              "logs:CreateLogStream",
              "logs:PutLogEvents"
              ],
              "Resource": "*"

              ]



              After attaching the above policy to the function, lambda function should have the permissions to Cloudwatch and Cloudwatch Logs.



              Deploy your code to Lambda Function and Save it.



              Click on 'Test' button to test the lambda function.



              Go to Cloudwatch Metrics Page to see if the metrics are available.

              It could take around 5- 20 minutes for the metric to appear in the Cloudwatch console.

              You should see the namespace which you have specified in the code, appeared in the Cloudwatch console.




              Thanks






              share|improve this answer

























                0












                0








                0







                To send metrics to Cloudwatch follow the steps:


                Create a Lambda Function with a proper role attached to it. The Role should contain the following policy:




                "Version": "2012-10-17",
                "Statement": [

                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents"
                ],
                "Resource": "*"

                ]



                After attaching the above policy to the function, lambda function should have the permissions to Cloudwatch and Cloudwatch Logs.



                Deploy your code to Lambda Function and Save it.



                Click on 'Test' button to test the lambda function.



                Go to Cloudwatch Metrics Page to see if the metrics are available.

                It could take around 5- 20 minutes for the metric to appear in the Cloudwatch console.

                You should see the namespace which you have specified in the code, appeared in the Cloudwatch console.




                Thanks






                share|improve this answer













                To send metrics to Cloudwatch follow the steps:


                Create a Lambda Function with a proper role attached to it. The Role should contain the following policy:




                "Version": "2012-10-17",
                "Statement": [

                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents"
                ],
                "Resource": "*"

                ]



                After attaching the above policy to the function, lambda function should have the permissions to Cloudwatch and Cloudwatch Logs.



                Deploy your code to Lambda Function and Save it.



                Click on 'Test' button to test the lambda function.



                Go to Cloudwatch Metrics Page to see if the metrics are available.

                It could take around 5- 20 minutes for the metric to appear in the Cloudwatch console.

                You should see the namespace which you have specified in the code, appeared in the Cloudwatch console.




                Thanks







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 28 at 10:48









                Aress SupportAress Support

                7971 silver badge11 bronze badges




                7971 silver badge11 bronze badges





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55336307%2faws-lambda-function-that-sends-the-metrics-to-cloudwatch%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

                    밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

                    1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴