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.3k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
Reflections on building cloud and local hybrid machine entities
mitsuhiko
1
140
Agentic Coding: The Future of Software Development with Agents
mitsuhiko
0
920
Do Dumb Things
mitsuhiko
0
1k
No Assumptions
mitsuhiko
0
430
The Complexity Genie
mitsuhiko
0
350
The Catch in Rye: Seeding Change and Lessons Learned
mitsuhiko
0
450
Runtime Objects in Rust
mitsuhiko
0
450
Rust at Sentry
mitsuhiko
0
610
Overcoming Variable Payloads to Optimize for Performance
mitsuhiko
0
320
Other Decks in Programming
See All in Programming
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
140
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
660
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
620
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
180
リアルな遅延を測る仕様
kota_yata
1
140
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
330
[DroidKaigi 26] How We Moved from Android Studio to Slack
thisaay
0
190
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
290
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
260
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
高専、大学編入、そして未踏へ〜プロダクト開発とキャリアの歩み - Technical College, University Transfer, and On to “Mitou” / My Journey in Product Development and Career
pkmiya
0
130
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
260
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
490
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
320
Building Adaptive Systems
keathley
44
3.2k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
300
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
760
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
270
The Language of Interfaces
destraynor
162
27k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Evolving SEO for Evolving Search Engines
ryanjones
0
280
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?