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
Zoneless Testing
rainerhahnekamp
0
120
103 Early Hints
sugi_0000
1
240
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
Recoilを剥がしている話
kirik
5
6.8k
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
290
情報漏洩させないための設計
kubotak
3
340
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
340
선언형 UI에서의 상태관리
l2hyunwoo
0
180
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.5k
ドメインイベント増えすぎ問題
h0r15h0
2
360
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
140
Featured
See All Featured
Building Adaptive Systems
keathley
38
2.3k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Docker and Python
trallard
42
3.1k
Documentation Writing (for coders)
carmenintech
66
4.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Pragmatic Product Professional
lauravandoore
32
6.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Typedesign – Prime Four
hannesfritz
40
2.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Designing Experiences People Love
moore
138
23k
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