Cloud Network Monitoring

The Cloud Network Monitoring API allows you to fetch aggregated connections and their attributes. See the Cloud Network Monitoring page for more information.

Note: This endpoint is in Preview. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/network/connections/aggregatehttps://api.datadoghq.eu/api/v2/network/connections/aggregatehttps://api.ddog-gov.com/api/v2/network/connections/aggregatehttps://api.datadoghq.com/api/v2/network/connections/aggregatehttps://api.us3.datadoghq.com/api/v2/network/connections/aggregatehttps://api.us5.datadoghq.com/api/v2/network/connections/aggregate

개요

Get all aggregated connections.

인수

쿼리 문자열

이름

유형

설명

from

integer

Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window is 15 minutes before the to timestamp. If neither from nor to are provided, the query window is [now - 15m, now].

to

integer

Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window is the current time. If neither from nor to are provided, the query window is [now - 15m, now].

group_by

string

Comma-separated list of fields to group connections by.

tags

string

Comma-separated list of tags to filter connections by.

limit

integer

The number of connections to be returned. The maximum value is 5000.

응답

OK

List of aggregated connections.

Expand All

항목

유형

설명

data

[object]

Array of aggregated connection objects.

attributes

object

Attributes for an aggregated connection.

bytes_sent_by_client

int64

The total number of bytes sent by the client over the given period.

bytes_sent_by_server

int64

The total number of bytes sent by the server over the given period.

group_bys

object

The key, value pairs for each group by.

<any-key>

[string]

The values for each group by.

packets_sent_by_client

int64

The total number of packets sent by the client over the given period.

packets_sent_by_server

int64

The total number of packets sent by the server over the given period.

rtt_micro_seconds

int64

Measured as TCP smoothed round trip time in microseconds (the time between a TCP frame being sent and acknowledged).

tcp_closed_connections

int64

The number of TCP connections in a closed state. Measured in connections per second from the client.

tcp_established_connections

int64

The number of TCP connections in an established state. Measured in connections per second from the client.

tcp_refusals

int64

The number of TCP connections that were refused by the server. Typically this indicates an attempt to connect to an IP/port that is not receiving connections, or a firewall/security misconfiguration.

tcp_resets

int64

The number of TCP connections that were reset by the server.

tcp_retransmits

int64

TCP Retransmits represent detected failures that are retransmitted to ensure delivery. Measured in count of retransmits from the client.

tcp_timeouts

int64

The number of TCP connections that timed out from the perspective of the operating system. This can indicate general connectivity and latency issues.

id

string

A unique identifier for the aggregated connection based on the group by values.

type

enum

Aggregated connection resource type. Allowed enum values: aggregated_connection

default: aggregated_connection

{
  "data": [
    {
      "attributes": {
        "bytes_sent_by_client": "integer",
        "bytes_sent_by_server": "integer",
        "group_bys": {
          "<any-key>": []
        },
        "packets_sent_by_client": "integer",
        "packets_sent_by_server": "integer",
        "rtt_micro_seconds": "integer",
        "tcp_closed_connections": "integer",
        "tcp_established_connections": "integer",
        "tcp_refusals": "integer",
        "tcp_resets": "integer",
        "tcp_retransmits": "integer",
        "tcp_timeouts": "integer"
      },
      "id": "string",
      "type": "string"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/network/connections/aggregate" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get all aggregated connections returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_network_monitoring_api import CloudNetworkMonitoringApi

configuration = Configuration()
configuration.unstable_operations["get_aggregated_connections"] = True
with ApiClient(configuration) as api_client:
    api_instance = CloudNetworkMonitoringApi(api_client)
    response = api_instance.get_aggregated_connections()

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Get all aggregated connections returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_aggregated_connections".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CloudNetworkMonitoringAPI.new
p api_instance.get_aggregated_connections()

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Get all aggregated connections returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetAggregatedConnections", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCloudNetworkMonitoringApi(apiClient)
	resp, r, err := api.GetAggregatedConnections(ctx, *datadogV2.NewGetAggregatedConnectionsOptionalParameters())

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CloudNetworkMonitoringApi.GetAggregatedConnections`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CloudNetworkMonitoringApi.GetAggregatedConnections`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Get all aggregated connections returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudNetworkMonitoringApi;
import com.datadog.api.client.v2.model.SingleAggregatedConnectionResponseArray;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.getAggregatedConnections", true);
    CloudNetworkMonitoringApi apiInstance = new CloudNetworkMonitoringApi(defaultClient);

    try {
      SingleAggregatedConnectionResponseArray result = apiInstance.getAggregatedConnections();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling CloudNetworkMonitoringApi#getAggregatedConnections");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
// Get all aggregated connections returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_network_monitoring::CloudNetworkMonitoringAPI;
use datadog_api_client::datadogV2::api_cloud_network_monitoring::GetAggregatedConnectionsOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetAggregatedConnections", true);
    let api = CloudNetworkMonitoringAPI::with_config(configuration);
    let resp = api
        .get_aggregated_connections(GetAggregatedConnectionsOptionalParams::default())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
 * Get all aggregated connections returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getAggregatedConnections"] = true;
const apiInstance = new v2.CloudNetworkMonitoringApi(configuration);

apiInstance
  .getAggregatedConnections()
  .then((data: v2.SingleAggregatedConnectionResponseArray) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"

PREVIEWING: ava.silver/azints-3391/add-azure-storage-monitoring-setup