Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NRQLはじめました
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
bassbone
December 15, 2021
Programming
1.2k
0
Share
NRQLはじめました
NRUG vol.1でLTしました。
bassbone
December 15, 2021
Other Decks in Programming
See All in Programming
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
関係性から理解する"同一性"の型用語たち
pvcresin
1
230
Back to the roots of date
jinroq
0
890
Agentic AI & UI: Arcitecture, HITL, Emerging Standards
manfredsteyer
PRO
0
120
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
460
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
960
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
390
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1.1k
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
5
5.6k
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
110
Are We Really Coding 10× Faster with AI?
kohzas
0
190
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.4k
For a Future-Friendly Web
brad_frost
183
10k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
[SF Ruby Conf 2025] Rails X
palkan
2
1k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
460
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
440
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The Cult of Friendly URLs
andyhume
79
6.9k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Transcript
NRQLはじめました NRUG Vol.1 2021-12-15 株式会社ラフール 伊藤 純一
自己紹介
伊藤 純一(Junichi Ito) ・株式会社ラフール SRE / EM ・Twitter: @bassbone0 ・GitHub:
@bassbone ・Qiita: @bassbone ・note: @bassbone ・Kaggle: @bassbone (Kaggle Expert) ・Blog: https://blog.bassbone.tokyo ・ISUCON:ISUCON7〜ISUCON11参加 ⇨いつか本戦行きたい 今回、初LTです(ドキドキ
会社紹介
株式会社ラフール = HRテック / メンタルヘルステック ベンチャー 興味のある方は https://survey.lafool.jp へ
今日のテーマ
New Relic導入して サービスを改善した話
NRQL • 文法等の簡単な紹介 • 新しい監視のやり方の紹介
えにゅあーるきゅーえる? ぬるくる?
ぬるくる!
NRQLとは?
NRQLは、New RelicのSQLに似たクエリ言語で す。NRQLを使用して、詳細なNew Relicデータを取 得し、アプリケーションやホスト、ビジネスで重要なア クティビティについての洞察を得ることができます。 公式ドキュメントより引用
NRQLの使い方
NRQLを使いこなせれば、New Relicの活用の幅が広がります! (ダッシュボードや監視設定等)
基本的な構文 SELECT function(attribute) [AS 'label'][, ...] FROM data type [WHERE
attribute [comparison] [AND|OR ...]][AS 'label'][, ...] [FACET attribute | function(attribute)] [LIMIT number] [SINCE time] [UNTIL time] [WITH TIMEZONE timezone] [COMPARE WITH time] [TIMESERIES time] (公式ドキュメントより)
NRQL例(1) FROM StorageSample SELECT average(diskUsedPercent) as 'Disk Usage’ FACET displayName
サーバー単位でディスク使用 率の平均を取得できる。 FACET(SQLのGROUP BYに 相当)がポイント。特定の項目 で集約。
NRQL例(2) FROM Transaction SELECT percentage( count(*), WHERE http.statusCode >= 500
) SINCE 1 week AGO WHERE appName = 'xxxx' 特定のアプリケーションのエラー 発生率を取得できる。 percentageがポイント。特定の 条件を満たす割合を得られる。
ところで
AI/機械学習を使った監視って 憧れますよね?
New Relicでできるの?
できるんです!
最小2乗線形回帰?将来値を予測?すごそう! しかし、サンプルが無い。。。
予測というキーワードからこんなグラフが出せるのかなと期待! (画像は公式フォーラムから引用)
教えて!Google先生!
「NRQL predictLinear」で検索
None
None
None
4件、目を通したけど。。。
余談ですが、
「NewRelic predictLinear」で 検索すれば良かった(9件ヒット) という反省
閑話休題
predictLinearと格闘して わかったこと
None
これが正しいイメージ! (直近1週間のディスク使用率推移から1週間後の値を予測)
どのように使えるのか?
従来の監視の課題 具体例 ディスクA:使用率90%。増加率1%/月。 ディスクB:使用率60%。増加率1%/時。⇦ログの量が急増等。 例えば、使用率90%を閾値とした監視設定を加えた場合、ディスクAは検知す るが、ディスクBは検知しない。しかし、ディスクBは使用率90%に達した瞬間 には約10時間の猶予しか無く、手遅れになる可能性が。 ⇨従来の現在の値だけでの監視の限界。
新しい監視 先の例に対して、 例えば、直近3時間の推移から24時間後の使用率が90%という監視設定をし ておけば、使用率66%到達時点(34時間の猶予)で気付けるため、手遅れる になるリスクを軽減することが可能。 ⇨予測を使った監視を行うことで、より早く異常に気付くことが可能。
まとめ • NRQLの使い方の紹介 • predictLinearによる未来予測型の監視について紹介
今回のLT準備にあたり、こちらの書籍を参考にさせていただきました!
様々な職種で絶賛募集中! 興味のある方はWantedlyへ! We are hiring !
ご清聴ありがとうございました