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
Rust at Sentry
Search
Armin Ronacher
July 07, 2017
Programming
1.2k
4
Share
Rust at Sentry
An introduction to how we use Rust at Sentry.
Armin Ronacher
July 07, 2017
More Decks by Armin Ronacher
See All by Armin Ronacher
Agentic Coding: The Future of Software Development with Agents
mitsuhiko
0
670
Do Dumb Things
mitsuhiko
0
920
No Assumptions
mitsuhiko
0
390
The Complexity Genie
mitsuhiko
0
310
The Catch in Rye: Seeding Change and Lessons Learned
mitsuhiko
0
410
Runtime Objects in Rust
mitsuhiko
0
390
Rust at Sentry
mitsuhiko
0
570
Overcoming Variable Payloads to Optimize for Performance
mitsuhiko
0
280
Rust API Design Learnings
mitsuhiko
0
650
Other Decks in Programming
See All in Programming
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
KagglerがMixSeekを触ってみた
morim
0
370
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
240
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
760
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
2.9k
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
170
Vibe NLP for Applied NLP
inesmontani
PRO
0
260
CDK Deployのための ”反響定位”
watany
4
660
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
290
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
130
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.3k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
How to make the Groovebox
asonas
2
2.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
140
Between Models and Reality
mayunak
3
260
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
140
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
180
Believing is Seeing
oripsolob
1
110
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
790
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
260
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Code Reviewing Like a Champion
maltzj
528
40k
Transcript
Rust at Sentry Armin @mitsuhiko Ronacher
Hi, I'm Armin ... and I do Open Source, lots
of Python and SaaS Flask Sentry …
… and here is where you can find me twitter.com/@mitsuhiko
github.com/mitsuhiko lucumr.pocoo.org/
800°C 36° 2' 0.4662" N 118° 15' 38.7792" W 795°C
789°C 797°C 793°C 805°C 782°C we show you your crashes
None
None
a bit about us chapter 0
Open Source Project “sentry”
Cloud Hosted “sentry.io”
relatively flexible stack postgres, mysql, cassandra, riak, …
our general tech stack chapter 1
Lots of Python
Simple Stack Python RabbitMQ Postgres Riak Redis
Conservative Approach to Adding New Systems
prefer Internal Modularity over building More Services
how does rust fit?
why is there Rust? chapter 2
a bit of a hobby of mine
turned into sentry-cli (command line client to manage organizations /
build integration)
later reused components for Python modules
now part of our tech stack
how we started chapter 3
why we use Rust for sentry-cli
$ otool -L which sentry-cli /usr/local/bin/sentry-cli: /System/Library/Frameworks/Security.framework/Versions/A/Security /usr/lib/libiconv.2.dylib /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation /usr/lib/libcurl.4.dylib
/usr/lib/libz.1.dylib /usr/lib/libSystem.B.dylib
$ curl -sL https://sentry.io/get-cli/ | bash $ npm install sentry-cli-binary
that and crates.io
rejected alternatives go JavaScript (bundled node) C / C++ Python
/ Ruby
things that work well serialization / deserialization error handling console
UX file size
from client to server chapter 4
None
sourcemap parsing
reused sentry-cli code for server
+20 sec -> < 500ms processing time
debug symbols
proguard
marrying python and rust chapter 5
github.com/mitsuhiko/snaek
from setuptools import setup, find_packages setup( name='example', version='0.0.1', packages=find_packages(), include_package_data=True,
zip_safe=False, platforms='any', install_requires=[ 'snaek', ], snaek_rust_modules=[ ('example._native', 'rust/'), ] )
build rust library expose rust -> cabi snaek to consume
#[repr(C)] pub struct Point { pub x: f32, pub y:
f32, } #[no_mangle] pub unsafe extern "C" fn example_get_origin() -> Point { Point { x: 0.0, y: 0.0 } }
from example._native import lib def get_origin(): point = lib.example_get_origin() return
(point.x, point.y)
things in rust to love chapter 6
#[derive(Serialize, Deserialize, Debug, Default)] pub struct Deploy { #[serde(rename="environment")] pub
env: String, pub name: Option<String>, pub url: Option<String>, #[serde(rename="dateStarted")] pub started: Option<DateTime<UTC>>, #[serde(rename="dateFinished")] pub finished: Option<DateTime<UTC>>, }
/// Lists all deploys for a release pub fn list_deploys(&self,
org: &str, version: &str) -> ApiResult<Vec<Deploy>> { self.get(&format!("/organizations/{}/releases/{}/deploys/", PathArg(org), PathArg(version)))? .convert() }
super flexible (de)serialization layer
crates we use / built chapter 7
if_chain lazy_static error-chain always useful
serde serde_derive serde_json serde_yaml for serialization
console indicatif dialoguer for pretty console UI ours :)
rust-curl openssl-probe HTTP stuff
elementtree XML ours :)
things we don't like chapter 8
compile times :'(
things rust needs chapter 9
“what not to do” guide
incremental compilation
higher level C ABI tools
Questions?