getting getmetrics data api calls under the account

0

How to find getmetrics data API call count per asset?

When checking my account cost I noticed a quite large number of Getmetrics Data API calls and i need to spend more money. How i can find to which or for which assets those getmetrics data API call is triggering?

질문됨 9달 전332회 조회
2개 답변
0
수락된 답변

{ "metrics": [ [ { "expression": "SELECT COUNT(CallCount)\nFROM SCHEMA("AWS/Usage", Class, Resource, Service, Type)\nWHERE Type = 'API'\nGROUP BY Service, Resource\nORDER BY COUNT() DESC\nLIMIT 20", "label": "${LABEL} [avg: ${AVG}]", "id": "q1" } ], [ "AWS/Usage", "CallCount", "Type", "API", "Resource", "GetMetricData", "Service", "CloudWatch", "Class", "None", { "yAxis": "left", "id": "m1" } ] ], "sparkline": true, "region": "eu-west-1", "view": "timeSeries", "stacked": false, "stat": "Sum", "period": 86400, "yAxis": { "left": { "label": "Count", "showUnits": false } }, "title": "Top 20 AWS APIs by the number of calls in your account" }

답변함 9달 전
0

When we access GetMetricData through AWS console, like using CloudWatch's dashboard to view graphs, it doesn’t charge Anything. AutoScaling service EC2 detailed monitoring also don’t affect GetMetricData API cost.

If an AWS console is calling GetMetricData on the public CloudWatch endpoint then it will trigger charges, but AWS console should not be doing this.

Can you check if there is any external log monitoring tool such as Grafana or any monitoring company(DataDog/New Relic), which might be using GetMetricData API to fetch the logs and this would be external to AWS and would incur charges. Any external company would be accessing this API through IAM role, so CloudTrail would be a good starting point for you to look assumeRole events events.

Hope you find this helpful.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
전문가
답변함 9달 전
  • Yes, an external monitoring tool is there. But how can this be tracked with in aws portal about the request count to each asset like ec2,rds etc...

  • I have been in this situation, like I mentioned, you should follow the cloudtrail route and look up for ** assumeRole** event for the user which is being used by external tool. Most of the GetMetricData API calls within AWS won't be charging you, substantial amount of cost would be coming from external calls. So please proceed with the cloudtrail analysis as I mentioned, you'll have the answer most likely.

    Comment here if you have additional questions, glad to help.

  • Actually, i know it is from an external provider but I am trying to figure out the request counts corresponding to each asset (EC2,RDS etc ...).

    I will get the total count via,

    { "metrics": [ [ "AWS/Usage", "CallCount", "Type", "API", "Resource", "GetMetricData", "Service", "CloudWatch", "Class", "None", { "yAxis": "left" } ]

    ],
    "sparkline": true,
    "timezone": "UTC",
    "region": "eu-west-1",
    "view": "timeSeries",
    "stacked": false,
    "stat": "Sum",
    "period": 86400,
    "yAxis": {
        "left": {
            "showUnits": true
        }
    }
    

    }

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인