Skip to content

Commit

Permalink
Merge pull request #13415 from newrelic/translations-ce6e045
Browse files Browse the repository at this point in the history
Updated translations -  (machine translation)
  • Loading branch information
jmiraNR authored Jun 7, 2023
2 parents 1690a2d + ce6e045 commit 7926bb3
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ metaDescription: Use New Relic NerdGraph to query data using New Relic Query Lan
translationType: machine
---

[NerdGraph API](/docs/introduction-new-relic-graphql)を使用して[NRQLクエリ](/docs/insights/nrql-new-relic-query-language/using-nrql/introduction-nrql)を作成できます
NerdGraph API を使用して [NRQL](/docs/insights/nrql-new-relic-query-language/using-nrql/introduction-nrql) クエリを作成できます

## NerdGraph を使用したクエリの概要 [#overview]

NRQL クエリは、[クエリ ビルダー](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder)または NerdGraph で実行できます。NerdGraph を使用すると、[複数のアカウントにまたがる](#cross-account-query)クエリや[非同期クエリ](/docs/apis/nerdgraph/examples/async-queries-nrql-tutorial)の実行など、UI では実行できないことを実行できます
UI の [クエリ ビルダー](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder) を使用して NRQL クエリを実行することも、NerdGraph API を使用することもできます。NerdGraph を使用すると、 [複数のアカウントにわたるクエリ](#cross-account-query)[非同期クエリの](/docs/apis/nerdgraph/examples/async-queries-nrql-tutorial)実行など、UI からは実行できないことを実行できます

## 要件 [#requirements]

* すべての[ユーザー タイプ](/docs/accounts/accounts-billing/new-relic-one-user-management/user-type)が、アクセス権を持つアカウントのデータを照会できます。NerdGraph 経由でクエリを実行できない場合は[、そのアカウントへのアクセス権](/docs/accounts/accounts-billing/new-relic-one-user-management/user-management-concepts/#understand-concepts)がない可能性があります。
* すべてのNRQLクエリは[NRQLクエリ制限の](/docs/query-your-data/nrql-new-relic-query-language/get-started/rate-limits-nrql-queries)対象です
* すべてのクエリは [NRQL クエリ制限](/docs/query-your-data/nrql-new-relic-query-language/get-started/rate-limits-nrql-queries)の対象となります

## NerdGraphでの基本的なNRQLクエリ [#basic-queries]

NerdGraphを使用して基本的なNRQLクエリを作成するには:
NerdGraph を使用して基本的な NRQL クエリを作成するには、主に 2 つの要件があります。

1. [NerdGraph エクスプローラー](/docs/apis/nerdgraph/get-started/nerdgraph-explorer)に移動します
2. NRQLクエリを文字列引数としてNRQLオブジェクトに渡し、NerdGraphクエリに`results`フィールドを含めます。
* NRQL クエリを文字列引数として NRQL オブジェクトに渡す必要があります
* クエリには `results` フィールドを含める必要があります

たとえば、過去1時間のすべての [トランザクションイベント](/docs/insights/insights-data-sources/default-data/apm-default-event-attributes-insights#transaction-event) のカウントを取得するには、次のクエリを使用します
たとえば、過去 1 時間のすべての [トランザクション イベント](/docs/insights/insights-data-sources/default-data/apm-default-event-attributes-insights#transaction-event) の数を取得するには、 [New Relic アカウント ID](/docs/accounts/accounts-billing/account-structure/account-id)を指定して次のクエリを実行します

```graphql
{
actor {
account(id: YOUR_ACCOUNT_ID) {
nrql(query: "<a href="/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions#state-select">SELECT</a> count(*) <a href="/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions#sel-from">FROM</a> <a href="/docs/insights/insights-data-sources/default-data/apm-default-event-attributes-insights#transaction-event">Transaction</a> <a href="/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions#sel-since">SINCE</a> 1 HOUR AGO") {
nrql(query: "SELECT count(*) FROM Transaction SINCE 1 HOUR AGO") {
results
}
}
Expand Down Expand Up @@ -60,6 +60,8 @@ NerdGraphを使用して基本的なNRQLクエリを作成するには:
}
```

NRQL クエリの作成方法の詳細をお探しですか? [NRQL ドキュメントのセクションを](/docs/insights/nrql-new-relic-query-language/using-nrql/introduction-nrql)参照してください。

## クロスアカウント クエリ [#cross-account-query]

NerdGraph を使用すると、複数のアカウントでクエリを実行できますが、これはクエリ ビルダーでは実行できません。照会するアカウントの[アカウント ID](/docs/accounts/accounts-billing/account-structure/account-id)が必要です。
Expand All @@ -71,7 +73,7 @@ NerdGraph を使用すると、複数のアカウントでクエリを実行で
actor {
nrql(accounts: [ACCOUNT_ID_1, ACCOUNT_ID_2, ACCOUNT_ID_3],
options: {},
query: "NRQL_QUERY",
query: "YOUR_NRQL_QUERY",
timeout: 70)
{ results}
}
Expand All @@ -88,7 +90,7 @@ NerdGraph を使用すると、複数のアカウントでクエリを実行で
{
actor {
account(id: YOUR_ACCOUNT_ID) {
nrql(query: "<a href="/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions#state-select">SELECT</a> count(*) from <a href="/docs/insights/insights-data-sources/default-data/apm-default-event-attributes-insights#transaction-event">Transaction</a> <a href="/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions#sel-timeseries">TIMESERIES</a>") {
nrql(query: "SELECT count(*) from Transaction TIMESERIES") {
embeddedChartUrl
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ translationType: machine

24時間の間に、アカウントごと、1日ごとのユニークなメトリックのタイムスケール(カーディナリティ)の制限を超えた場合、エンドポイントは引き続き生のメトリックデータを受信して保存します。ただし、New Relic は 24 時間の残りの期間、追加のアグリゲート ロールアップ (1 分、5 分など) の作成を停止します。(これらのロールアップは、60分以上のタイムウィンドウを照会するためにデフォルトで使用されます)。

このような違反が発生しても、60分またはそれ以下の時間枠を指定するか、RAWキーワードを指定することで、データの照会を続けることができます( [view and query your metrics](/docs/introduction-new-relic-metric-api#example-view-raw-datapoints) で説明しています)。これは、違反の潜在的な原因を特定するのに役立ちます。
このような違反が発生した場合でも、60 分以下の時間枠を指定するか、RAW キーワードを指定することで、データのクエリを続行できます (詳細については、 [「 高カーディナリティ メトリック](/docs/data-apis/ingest-apis/metric-api/NRQL-high-cardinality-metrics)」を参照してください)。これは、違反の潜在的な原因を特定するのに役立ちます。
</Collapser>

<Collapser
Expand All @@ -262,7 +262,7 @@ translationType: machine

24時間の間に、メトリック名ごと、1日ごとのユニークなメトリックの時系列(カーディナリティ)の制限を超えた場合、エンドポイントは引き続き生のメトリックデータを受信して保存します。ただし、New Relic は 24 時間の残りの期間、追加のアグリゲート ロールアップ (1 分、5 分など) の作成を停止します。(これらのロールアップは、60分を超えるタイムウィンドウのクエリにデフォルトで使用されます)。

このような違反が発生しても、60分またはそれ以下の時間枠を指定するか、RAWキーワードを指定することで、データの照会を続けることができます( [view and query your metrics](/docs/introduction-new-relic-metric-api#example-view-raw-datapoints) で説明しています)。これは、違反の潜在的な原因を特定するのに役立ちます。
このような違反が発生した場合でも、60 分以下の時間枠を指定するか、RAW キーワードを指定することで、データのクエリを続行できます (詳細については、 [「 高カーディナリティ メトリック](/docs/data-apis/ingest-apis/metric-api/NRQL-high-cardinality-metrics)」を参照してください)。これは、違反の潜在的な原因を特定するのに役立ちます。
</Collapser>

<Collapser
Expand Down Expand Up @@ -403,7 +403,7 @@ translationType: machine

**例アトリビュートとして使用されているメトリック値(無効)**

```
```json
[
{
"metrics": [
Expand Down Expand Up @@ -432,7 +432,7 @@ translationType: machine
</td>

<td>
`accountID``appId``eventType`などの[予約語](/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits#reserved-words)は使用しないでください。また、バックティック( ``` `` ``` )しない限り、NRQL構文用語の使用は避けてください。
`accountId``appId``eventType`などの[予約語](/docs/insights/insights-data-sources/custom-data/insights-custom-data-requirements-limits#reserved-words)は使用しないでください。また、バックティック( ``` `` ``` )しない限り、NRQL構文用語の使用は避けてください。
</td>
</tr>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Flutter エージェントを使用すると、クラッシュの追跡、HTTP
New Relic は、Flutter ログをカスタム イベントとして保存します。次の NRQL クエリを使用して、これらのログをクエリし、それらのダッシュボードを構築できます。

```
SELECT * FROM Mobile Dart Console Events SINCE 30 MINUTES AGO
SELECT * FROM `Mobile Dart Console Events` SINCE 30 MINUTES AGO
```

NRQLクエリの詳細については、 [NRQLの概要を](/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language/#where)参照してください。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
---
title: NRQL。時系列でのグループ結果
title: 'NRQL: 時間ごとのファセット結果'
tags:
- Query your data
- 'NRQL: New Relic Query Language'
- NRQL query tutorials
metaDescription: 'New Relic NRQL: how to bucket your data into segments of time with the FACET clause.'
metaDescription: 'New Relic NRQL: use the FACET clause to return results segmented by time buckets.'
translationType: machine
---

import queriesFacetByTime from 'images/queries_screenshot-crop_facet-by-time-query.webp'

import queriesFacetByTimeTwoFunctions from 'images/queries_screenshot-crop_facet-by-time-two-functions.webp'

[NRQL](/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql) では、時間をまたいで結果をグループ化するクエリを作成することができます。例えば、指定した日時の範囲をカバーするバケットに結果を分けることで、タイムスタンプに基づいて結果をグループ化することができます。

<img
title="NRQL facet by time"
alt="NRQL facet by time"
src={queriesFacetByTime}
/>

NRQL クエリで[時間関数](/docs/insights/use-insights-ui/time-settings/set-time-range-insights-dashboards-charts)を使用すると、結果は UTC で返されます。結果をタイム ゾーンに合わせて調整するには、クエリに[`WITH TIMEZONE`](/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions#sel-timezone)を含めます。

## あなたのNRQLクエリの時間範囲のファセット [#cohorts]

NRQL クエリを作成するには、タイムスタンプ属性で機能するバケット関数で[`FACET`](/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions#sel-facett)を使用します。標準の`FACET`クエリを実行しますが、属性によるファセットではなく、時間によるファセットを行います。例えば:

```sql
SELECT count(*) FROM PageView SINCE 1 day ago FACET monthOf(account_created)
SELECT count(*) FROM K8sDaemonsetSample FACET monthOf(createdAt)
```

このドキュメントの上部にあるスクリーンショットは、このクエリの結果を示しています。

同じクエリで複数の機能を実行するには、NRQL のマルチファセット機能を使用します。

```sql
SELECT count(*) FROM PageView SINCE 1 day ago FACET dateOf(account_created), monthOf(account_created)
SELECT count(*) FROM K8sDaemonsetSample FACET dateOf(createdAt), monthOf(createdAt)
```

<img
title="NRQL facet by time with two functions"
alt="NRQL facet by time with two functions"
src={queriesFacetByTimeTwoFunctions}
/>

多くの時間ベースの関数は、結果値の形式を制御する `string` (デフォルト) または `numeric`のオプションの 2 番目の引数を受け入れます。

```sql
SELECT count(*) FROM PageView SINCE 1 day ago FACET monthOf(account_created, numeric)
SELECT count(*) FROM K8sDaemonsetSample FACET monthOf(createdAt, numeric)
```

<table>
Expand Down Expand Up @@ -245,10 +263,10 @@ SELECT count(*) FROM PageView SINCE 1 day ago FACET monthOf(account_created, num
id="facet-time-example"
title="月別に集計"
>
月に基づいてすべての結果をグループ化するには`monthOf`関数を使用します。この例では、NRQL クエリに関数 ( `count(*)` )、データ型 ( `PageView` )、時間枠 ( `SINCE 1 day ago` )、および時間ファセット ( `monthOf(attribute)` ) が含まれています。
すべての結果を月に基づいてグループ化するには`monthOf` 関数を使用します。この例では、NRQL クエリには関数 (`count(*)`)、データ型、タイムフレーム (`SINCE 1 day ago`)、および時間ファセット (`monthOf(createdAt)`) が含まれています。

```sql
SELECT count(*) FROM PageView SINCE 1 day ago FACET monthOf(account_created)
SELECT count(*) FROM K8sDaemonsetSample SINCE 1 day ago FACET monthOf(createdAt)
```

このクエリを実行すると、月ごとの結果の表が返されます。
Expand All @@ -265,16 +283,20 @@ SELECT count(*) FROM PageView SINCE 1 day ago FACET monthOf(account_created, num
id="timeseries-chart-examples"
title="TIMESERIESを指定してチャートを作成する例"
>
`UNTIL``TIMESERIES`関数を追加し、時系列グラフで時間関数を使用することに注意する必要があります。`UNTIL`のデフォルト値は`NOW`であるため、何も指定しない場合、時間関数の値が分離または結合される可能性があります。`UNTIL today`を指定すると、同じ日の午前 0 時に終了するグラフを作成できます。
`UNTIL` 時系列グラフで `TIMESERIES` 関数を追加し、time 関数を使用することに注意する必要があります。

`UNTIL` のデフォルト値は `NOW`であるため、何も指定しない場合、時間関数の値は分離または結合される可能性があります。

`UNTIL today`を指定すると、同日の午前 12 時に終了するグラフを作成できます。

```sql
SELECT count(*) FROM PageView TIMESERIES 1 day WITH TIMEZONE '<localTimeZone>' SINCE 4 week ago UNTIL today
SELECT count(*) FROM PageView TIMESERIES 1 day WITH TIMEZONE 'Europe/London' SINCE 4 week ago UNTIL today
```

過去 4 週間ではなく`last month`からのデータを視覚化する場合は、 `SINCE last month UNTIL this month`を使用できます。

```sql
SELECT count(*) FROM PageView TIMESERIES 1 day WITH TIMEZONE '<localTimeZone>' SINCE last month UNTIL this month
SELECT count(*) FROM PageView TIMESERIES 1 day WITH TIMEZONE 'Europe/London' SINCE last month UNTIL this month
```
</Collapser>
</CollapserGroup>
Expand Down
Loading

0 comments on commit 7926bb3

Please sign in to comment.