コンテンツにスキップ

アナリティクス

CloudflareのTURNサービスは、バイト単位での入出力使用量をカウントします。このリアルタイムおよび履歴データには、TURNアナリティクスAPIを使用してアクセスできます。時間の経過に伴うバイト単位のトラフィックを示す時系列または集約データでTURN使用量を確認できます。

Cloudflare TURNアナリティクスは、GraphQL APIを介してのみ利用可能です。

TURNトラフィックデータフィルター

TURNアナリティクスのデータは以下の条件でフィルタリングできます:

  • 日時範囲
  • TURNキーID
  • TURNユーザー名
  • カスタム識別子

有用なTURNアナリティクスクエリ

以下は、一般的なユースケースのためのいくつかの例クエリです。これらを修正して、ユースケースに適応させ、アナリティクスデータの異なるビューを取得できます。

出力によるトップTURNキー

query{
viewer {
usage: accounts(filter: { accountTag: "8846293bd06d1af8c106d89ec1454fe6" }) {
callsTurnUsageAdaptiveGroups(
filter: {
datetimeMinute_gt: "2024-07-15T02:07:07Z"
datetimeMinute_lt: "2024-08-10T02:07:05Z"
}
limit: 2
orderBy: [sum_egressBytes_DESC]
) {
dimensions {
keyId
}
sum {
egressBytes
}
}
}
}
}
{
"data": {
"viewer": {
"usage": [
{
"callsTurnUsageAdaptiveGroups": [
{
"dimensions": {
"keyId": "74007022d80d7ebac4815fb776b9d3ed"
},
"sum": {
"egressBytes": 502614982
}
},
{
"dimensions": {
"keyId": "6b9e68b07dfee8cc2d116e4c51d6a957"
},
"sum": {
"egressBytes": 4853235
}
}
]
}
]
}
},
"errors": null
}

トップTURNカスタム識別子

query{
viewer {
usage: accounts(filter: { accountTag: "8846293bd06d1af8c106d89ec1454fe6" }) {
callsTurnUsageAdaptiveGroups(
filter: {
datetimeMinute_gt: "2024-07-15T02:07:07Z"
datetimeMinute_lt: "2024-08-10T02:07:05Z"
}
limit: 100
orderBy: [sum_egressBytes_DESC]
) {
dimensions {
customIdentifier
}
sum {
egressBytes
}
}
}
}
}
{
"data": {
"viewer": {
"usage": [
{
"callsTurnUsageAdaptiveGroups": [
{
"dimensions": {
"customIdentifier": "custom-id-333"
},
"sum": {
"egressBytes": 269850354
}
},
{
"dimensions": {
"customIdentifier": "custom-id-555"
},
"sum": {
"egressBytes": 162641324
}
},
{
"dimensions": {
"customIdentifier": "custom-id-112"
},
"sum": {
"egressBytes": 70123304
}
}
]
}
]
}
},
"errors": null
}

特定のカスタム識別子の使用量

query{
viewer {
usage: accounts(filter: { accountTag: "8846293bd06d1af8c106d89ec1454fe6" }) {
callsTurnUsageAdaptiveGroups(
filter: {
datetimeMinute_gt: "2024-07-15T02:07:07Z"
datetimeMinute_lt: "2024-08-10T02:07:05Z"
customIdentifier: "tango"
}
limit: 100
orderBy: []
) {
dimensions {
keyId
customIdentifier
}
sum {
egressBytes
}
}
}
}
}
{
"data": {
"viewer": {
"usage": [
{
"callsTurnUsageAdaptiveGroups": [
{
"dimensions": {
"customIdentifier": "tango",
"keyId": "74007022d80d7ebac4815fb776b9d3ed"
},
"sum": {
"egressBytes": 162641324
}
}
]
}
]
}
},
"errors": null
}

時系列としての使用量(グラフ用)

query{
viewer {
usage: accounts(filter: { accountTag: "8846293bd06d1af8c106d89ec1454fe6" }) {
callsTurnUsageAdaptiveGroups(
filter: {
datetimeMinute_gt: "2024-07-15T02:07:07Z"
datetimeMinute_lt: "2024-08-10T02:07:05Z"
}
limit: 100
orderBy: [datetimeMinute_ASC]
) {
dimensions {
datetimeMinute
}
sum {
egressBytes
}
}
}
}
}
{
"data": {
"viewer": {
"usage": [
{
"callsTurnUsageAdaptiveGroups": [
{
"dimensions": {
"datetimeMinute": "2024-08-01T17:09:00Z"
},
"sum": {
"egressBytes": 4570704
}
},
{
"dimensions": {
"datetimeMinute": "2024-08-01T17:10:00Z"
},
"sum": {
"egressBytes": 27203016
}
},
{
"dimensions": {
"datetimeMinute": "2024-08-01T17:11:00Z"
},
"sum": {
"egressBytes": 9067412
}
},
{
"dimensions": {
"datetimeMinute": "2024-08-01T17:17:00Z"
},
"sum": {
"egressBytes": 10059322
}
},
...
]
}
]
}
},
"errors": null
}