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
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
CSC509 Lecture 11
javiergs
PRO
0
180
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Better Code Design in PHP
afilina
PRO
0
130
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
210
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Jakarta EE meets AI
ivargrimstad
0
160
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Ruby is Unlike a Banana
tanoku
97
11k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Practical Orchestrator
shlominoach
186
10k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
The World Runs on Bad Software
bkeepers
PRO
65
11k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Gamification - CAS2011
davidbonilla
80
5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
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