Monitoring에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다.
자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
// listIPs is an example of listing uptime check IPs.funclistIPs(wio.Writer)error{ctx:=context.Background()client,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{returnfmt.Errorf("NewUptimeCheckClient: %w",err)}deferclient.Close()req:=&monitoringpb.ListUptimeCheckIpsRequest{}it:=client.ListUptimeCheckIps(ctx,req)for{config,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{returnfmt.Errorf("ListUptimeCheckIps: %w",err)}fmt.Fprintln(w,config)}fmt.Fprintln(w,"Done listing uptime check IPs")returnnil}
Node.js
Monitoring에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다.
자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
// Imports the Google Cloud client libraryconstmonitoring=require('@google-cloud/monitoring');// Creates a clientconstclient=newmonitoring.UptimeCheckServiceClient();// List uptime check IPsconst[uptimeCheckIps]=awaitclient.listUptimeCheckIps();uptimeCheckIps.forEach(uptimeCheckIp=>{console.log(uptimeCheckIp.region,uptimeCheckIp.location,uptimeCheckIp.ipAddress);});
PHP
Monitoring에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다.
자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
Monitoring에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다.
자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
deflist_uptime_check_ips()-> pagers.ListUptimeCheckIpsPager:"""Gets all locations and IP addresses used by uptime check servers Returns: A list of locations and IP addresses of uptime check servers. Iterating over this object will yield results and resolve additional pages automatically. """client=monitoring_v3.UptimeCheckServiceClient()ips=client.list_uptime_check_ips(request={})print(tabulate.tabulate([(ip.region,ip.location,ip.ip_address)foripinips],("region","location","ip_address"),))returnips
Ruby
Monitoring에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다.
자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.
gem"google-cloud-monitoring"require"google/cloud/monitoring"deflist_ipsclient=Google::Cloud::Monitoring.uptime_check_service# Iterate over all results.client.list_uptime_check_ips({}).eachdo|element|puts"#{element.location}#{element.ip_address}"endend
업타임 체크는 모든 IP 주소에서 가져올 수 있지만, 각 시간 간격에 각 지리적 위치의 주소가 하나만 사용됩니다. 지리적 위치는 이전 섹션과 같이 업타임 체크 대시보드에 나열됩니다. 또한 무료 웹 기반 서비스를 사용해서 다운로드한 IP 주소의 등록 위치를 식별할 수 있습니다.
로그에서 업타임 체크 트래픽 식별
서비스의 요청 로그에서 다음 정보를 확인하여 업타임 확인 서버의 요청을 식별할 수 있습니다.
ip: ip 필드에는 업타임 체크 서버에 사용되는 주소 중 하나가 포함됩니다. 모든 IP 주소를 나열하는 방법은 IP 주소 나열을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-21(UTC)"],[],[],null,["This document shows you how to get a list of IP addresses used by uptime-check\nservers, and how you can identify traffic from the uptime-check servers in\nyour logs.\n\nList IP addresses\n\nWhen you're checking a service that is behind a firewall, you can configure your\nservice's firewall to accept traffic from the current set of IP addresses used\nfor uptime checking. To get these IP addresses, use the following instructions: \n\nConsole\n\n1. In the Google Cloud console, go to the **Uptime checks** page:\n\n [Go to **Uptime checks**](https://console.cloud.google.com/monitoring/uptime)\n\n \u003cbr /\u003e\n\n If you use the search bar to find this page, then select the result whose subheading is\n **Monitoring**.\n2. In the toolbar of the Google Cloud console, select your Google Cloud project. For [App Hub](/app-hub/docs/overview) configurations, select the App Hub host project or the app-enabled folder's management project.\n3. In the **Uptime checks** menu, click *get_app* **Download** . A file `uptime-source-ips.txt` is downloaded and contains the IP addresses.\n\ngcloud\n\nRun the [`gcloud monitoring uptime list-ips`](/sdk/gcloud/reference/monitoring/uptime/list-ips) command: \n\n gcloud monitoring uptime list-ips\n\nThe method returns the following information for each IP address:\n\n- The IP address, not a range, in IPv4 or IPv6 format.\n- The region: `USA`, `EUROPE`, `SOUTH_AMERICA`, or `ASIA_PACIFIC`.\n- The location within the region.\n\nAPI\n\nCall the\n[`uptimeCheckIps.list`](/monitoring/api/ref_v3/rest/v3/uptimeCheckIps/list)\nmethod of the Monitoring API.\n\nThe method returns the following information for each IP address:\n\n- The region: `USA`, `EUROPE`, `SOUTH_AMERICA`, or `ASIA_PACIFIC`.\n- A more specific location within the region.\n- The IP address, not a range, in IPv4 or IPv6 format.\n\nC#\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n public static object ListUptimeCheckIps()\n {\n var client = UptimeCheckServiceClient.Create();\n var ips = client.ListUptimeCheckIps(new ListUptimeCheckIpsRequest());\n foreach (UptimeCheckIp ip in ips)\n {\n Console.WriteLine(\"{0,20} {1}\", ip.IpAddress, ip.Location);\n }\n return 0;\n }\n\nJava\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n private static void listUptimeCheckIps() throws IOException {\n try (UptimeCheckServiceClient client = UptimeCheckServiceClient.create()) {\n ListUptimeCheckIpsPagedResponse response =\n client.listUptimeCheckIps(ListUptimeCheckIpsRequest.newBuilder().build());\n for (UptimeCheckIp config : response.iterateAll()) {\n System.out.println(config.getRegion() + \" - \" + config.getIpAddress());\n }\n } catch (Exception e) {\n usage(\"Exception listing uptime IPs: \" + e.toString());\n throw e;\n }\n }\n\nGo\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n\n // listIPs is an example of listing uptime check IPs.\n func listIPs(w io.Writer) error {\n \tctx := context.Background()\n \tclient, err := monitoring.NewUptimeCheckClient(ctx)\n \tif err != nil {\n \t\treturn fmt.Errorf(\"NewUptimeCheckClient: %w\", err)\n \t}\n \tdefer client.Close()\n \treq := &monitoringpb.ListUptimeCheckIpsRequest{}\n \tit := client.ListUptimeCheckIps(ctx, req)\n \tfor {\n \t\tconfig, err := it.Next()\n \t\tif err == iterator.Done {\n \t\t\tbreak\n \t\t}\n \t\tif err != nil {\n \t\t\treturn fmt.Errorf(\"ListUptimeCheckIps: %w\", err)\n \t\t}\n \t\tfmt.Fprintln(w, config)\n \t}\n \tfmt.Fprintln(w, \"Done listing uptime check IPs\")\n \treturn nil\n }\n\nNode.js\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n // Imports the Google Cloud client library\n const monitoring = require('https://cloud.google.com/nodejs/docs/reference/monitoring/latest/overview.html');\n\n // Creates a client\n const client = new monitoring.https://cloud.google.com/nodejs/docs/reference/monitoring/latest/overview.html();\n\n // List uptime check IPs\n const [uptimeCheckIps] = await client.listUptimeCheckIps();\n uptimeCheckIps.forEach(uptimeCheckIp =\u003e {\n console.log(\n uptimeCheckIp.region,\n uptimeCheckIp.location,\n uptimeCheckIp.ipAddress\n );\n });\n\nPHP\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n use Google\\Cloud\\Monitoring\\V3\\Client\\UptimeCheckServiceClient;\n use Google\\Cloud\\Monitoring\\V3\\ListUptimeCheckIpsRequest;\n\n /**\n * Example:\n * ```\n * list_uptime_check_ips($projectId);\n * ```\n */\n function list_uptime_check_ips(string $projectId): void\n {\n $uptimeCheckClient = new UptimeCheckServiceClient([\n 'projectId' =\u003e $projectId,\n ]);\n $listUptimeCheckIpsRequest = new ListUptimeCheckIpsRequest();\n\n $pages = $uptimeCheckClient-\u003elistUptimeCheckIps($listUptimeCheckIpsRequest);\n\n foreach ($pages-\u003eiteratePages() as $page) {\n $ips = $page-\u003egetResponseObject()-\u003egetUptimeCheckIps();\n foreach ($ips as $ip) {\n printf(\n 'ip address: %s, region: %s, location: %s' . PHP_EOL,\n $ip-\u003egetIpAddress(),\n $ip-\u003egetRegion(),\n $ip-\u003egetLocation()\n );\n }\n }\n }\n\nPython\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n def list_uptime_check_ips() -\u003e pagers.ListUptimeCheckIpsPager:\n \"\"\"Gets all locations and IP addresses used by uptime check servers\n\n Returns:\n A list of locations and IP addresses of uptime check servers.\n Iterating over this object will yield results and resolve additional pages automatically.\n \"\"\"\n client = monitoring_v3.UptimeCheckServiceClient()\n ips = client.list_uptime_check_ips(request={})\n print(\n tabulate.tabulate(\n [(ip.region, ip.location, ip.ip_address) for ip in ips],\n (\"region\", \"location\", \"ip_address\"),\n )\n )\n return ips\n\nRuby\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n gem \"google-cloud-monitoring\"\n require \"google/cloud/monitoring\"\n\n def list_ips\n client = Google::Cloud::https://cloud.google.com/ruby/docs/reference/google-cloud-monitoring/latest/Google-Cloud-Monitoring.html.https://cloud.google.com/ruby/docs/reference/google-cloud-monitoring/latest/Google-Cloud-Monitoring.html\n\n # Iterate over all results.\n client.list_uptime_check_ips({}).each do |element|\n puts \"#{element.location} #{element.https://cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-UptimeCheckIp.html}\"\n end\n end\n\n\u003cbr /\u003e\n\nUptime checks can come from any of the IP addresses, but only one address from\neach geographic location is used for each time interval. The geographic\nlocations are listed in the uptime checks dashboard, as shown in the previous\nsection. You can also use free, web-based services to identify the registered\nlocations of the IP addresses you downloaded.\n\nIdentify uptime-check traffic in logs\n\nYou can identify requests from the uptime-check servers by the following\ninformation in your service's [request logs](/logging/docs/view/logs-explorer-interface):\n\n- **ip** : The `ip` field contains one of the addresses used by the uptime-check servers. For information about how to list all IP addresses, see [List IP addresses](#get-ips).\n- **User-Agent** : The `User-Agent` header value is always the following:\n\n GoogleStackdriverMonitoring-UptimeChecks(https://cloud.google.com/monitoring)\n\n Specifying a `User-Agent` custom header results in a form validation error\n and prevents the check configuration from being saved.\n\nWhat's next\n\n- [Manage uptime checks](/monitoring/uptime-checks/manage)\n- [Create alerting policies for uptime checks](/monitoring/uptime-checks/uptime-alerting-policies)\n- [Chart uptime-check metrics](/monitoring/charts/uptime-charts)"]]