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
480
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
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Amazon Qを使ってIaCを触ろう!
maruto
0
410
Contemporary Test Cases
maaretp
0
140
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Outline View in SwiftUI
1024jp
1
330
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
Featured
See All Featured
KATA
mclloyd
29
14k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Docker and Python
trallard
40
3.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Bash Introduction
62gerente
608
210k
Navigating Team Friction
lara
183
14k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Statistics for Hackers
jakevdp
796
220k
How STYLIGHT went responsive
nonsquared
95
5.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