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
NewRelic for Java
Search
Ran Tavory
September 29, 2012
Programming
4
520
NewRelic for Java
How to use the application performance monitoring service newrelic for java programmers
Ran Tavory
September 29, 2012
Tweet
Share
More Decks by Ran Tavory
See All by Ran Tavory
go-grpc-channelz: a Go based UI for gRPC's channelz
rantav
0
490
Code Review (Navy Hackathon)
rantav
0
49
Infrastructure Testing Using Kubernetes And Golang
rantav
0
61
Infrastructure testing using Kubernetes
rantav
0
490
Interview Workshop - Technical Questions
rantav
0
300
Code Review Best Practices
rantav
0
61
Code Review @ AppsFlyer
rantav
0
61
GraphQL at Yodas
rantav
2
170
Git for champs
rantav
0
140
Other Decks in Programming
See All in Programming
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
510
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
return文におけるstd::moveについて
onihusube
1
1.2k
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
MCP with Cloudflare Workers
yusukebe
2
220
Haze - Real time background blurring
chrisbanes
1
520
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
400
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
780
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
170
Featured
See All Featured
A Tale of Four Properties
chriscoyier
157
23k
Mobile First: as difficult as doing things right
swwweet
222
9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Automating Front-end Workflow
addyosmani
1366
200k
Building Applications with DynamoDB
mza
91
6.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Building an army of robots
kneath
302
44k
Six Lessons from altMBA
skipperchong
27
3.5k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Transcript
NewRelic for Java @rantav Totango Saturday, 29 September 12
Server Monitoring Saturday, 29 September 12
Application Monitoring Saturday, 29 September 12
Webapps Monitoring This is automatic!!! fun fun fun... Saturday, 29
September 12
Webapps Monitoring This is automatic!!! fun fun fun... Saturday, 29
September 12
Real User Monitoring <script type="text/javascript">var NREUMQ=NREUMQ|| [];NREUMQ.push(["mark","firstbyte",new Date().getTime()])</script> Saturday, 29
September 12
Real User Monitoring <script type="text/javascript">var NREUMQ=NREUMQ|| [];NREUMQ.push(["mark","firstbyte",new Date().getTime()])</script> Saturday, 29
September 12
The Java API Maven: <repository> <id>morphia</id> <name>morphia</name> <url>http://morphia.googlecode.com/svn/mavenrepo/</url> </repository> <dependency>
<groupId>newrelic.java-agent</groupId> <artifactId>newrelic-api</artifactId> <version>2.7.0</version> </dependency> Saturday, 29 September 12
The Java API Report background as web request: NewRelic.setRequestAndResponse(Request request,
Response response) NewRelic.setTransactionName(String category, String transactionName) Custom params: NewRelic.addCustomParameter(String key, String value) NewRelic.addCustomParameter(String key, Number value) Error reporting: NewRelic.noticeError(Throwable throwable) NewRelic.noticeError(Throwable throwable, Map<String, String> params) NewRelic.noticeError(String message, Map<String, String> params) Metrics: NewRelic.recordMetric(String name, float value) NewRelic.recordResponseTimeMetric(Stri ng name, long millis) NewRelic.incrementCounter(String name) Real user monitoring: NewRelic.getBrowserTimingHeader() NewRelic.getBrowserTimingFooter() NewRelic.setUserName(String name) NewRelic.setAccountName(String name) NewRelic.setProductName(String name) Ignoring: NewRelic.ignoreTransaction() NewRelic.ignoreApdex() Saturday, 29 September 12
Background Processing @Trace(dispatcher=true) NewRelic.setRequestAndResponse() NewRelic.recordMetric() https://newrelic.com/docs/java/java-agent-api Saturday, 29 September 12
Background Processing Example 1 @Trace(dispatcher=true) private DateTimeZone getServiceTimezone(String serviceId) {
} Saturday, 29 September 12
Background Processing Example 1 @Trace(dispatcher=true) private DateTimeZone getServiceTimezone(String serviceId) {
} Saturday, 29 September 12
Background Processing Example 2 @Trace(dispatcher=true) private void insertSdr(...) { final
NewrelicResponseImpl response = new NewrelicResponseImpl(); NewRelic.setRequestAndResponse(new NewrelicRequestImpl("/ rtprocessor/insert-sdr", map("serviceId", sdr.getServiceId())), response); try { ! batchInsertSdr(sdr, serviceTimeZone); } catch (final RuntimeException e) { response.setError(e); ! ! throw e; } } Saturday, 29 September 12
Background Processing Example 2 @Trace(dispatcher=true) private void insertSdr(...) { final
NewrelicResponseImpl response = new NewrelicResponseImpl(); NewRelic.setRequestAndResponse(new NewrelicRequestImpl("/ rtprocessor/insert-sdr", map("serviceId", sdr.getServiceId())), response); try { ! batchInsertSdr(sdr, serviceTimeZone); } catch (final RuntimeException e) { response.setError(e); ! ! throw e; } } Saturday, 29 September 12
Reporting Metrics NewRelic.recordMetric("Custom/last-sdr- seconds-ago-" + sdr.getServiceId(), 5.56); Saturday, 29 September
12
Reporting Metrics NewRelic.recordMetric("Custom/last-sdr- seconds-ago-" + sdr.getServiceId(), 5.56); Saturday, 29 September
12
Database Monitoring Saturday, 29 September 12
Slow SQL Saturday, 29 September 12
Map View Saturday, 29 September 12
JVM Memory use and GC Saturday, 29 September 12
Custom Dashboards Saturday, 29 September 12
Alerting Saturday, 29 September 12
Apdex Saturday, 29 September 12
The Java agent How does it work: java -javaagent:newrelic.jar Saturday,
29 September 12
newrelic.yaml Saturday, 29 September 12
newrelic-sysmond sudo apt-get install newrelic-sysmond sudo /etc/init.d/newrelic-sysmond stop sudo /etc/init.d/newrelic-sysmond
start Saturday, 29 September 12
newrelic-sysmond sudo apt-get install newrelic-sysmond sudo /etc/init.d/newrelic-sysmond stop sudo /etc/init.d/newrelic-sysmond
start Saturday, 29 September 12
Ignoring Ignore URLs: IgnoreNewrelicFilter Ignore methods: @NewRelicIgnoreTransaction or: NewRelic.ignoreTransaction() Ignore
methods for apdex: @ NewRelicIgnoreApdex Or: NewRelic.ignoreApdex() Saturday, 29 September 12
Ignoring - using the filter Saturday, 29 September 12
The full Java API https://newrelic.com/docs/java/java-agent-api Saturday, 29 September 12
Deployment Notification curl -H x-api-key:17... -d 'deployment[app_name]=rtprocessor' -d 'deployment[revision]=r15161' -d
'deployment[user]=Ran Tavory' https://rpm.newrelic.com/deployments.xml Saturday, 29 September 12
Resources https://sites.google.com/a/totango.com/wiki/engineering/ ops/newrelic https://newrelic.com/docs/java/new-relic-for-java https://newrelic.com/docs/java/java-agent-configuration https://newrelic.com/docs/java/java-agent-api https://newrelic.com/docs/java/real-user-monitoring-in- java http://apdex.org/overview.html Saturday,
29 September 12