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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Armin Ronacher
July 07, 2017
Programming
4
1.2k
Rust at Sentry
An introduction to how we use Rust at Sentry.
Armin Ronacher
July 07, 2017
Tweet
Share
More Decks by Armin Ronacher
See All by Armin Ronacher
Agentic Coding: The Future of Software Development with Agents
mitsuhiko
0
580
Do Dumb Things
mitsuhiko
0
880
No Assumptions
mitsuhiko
0
360
The Complexity Genie
mitsuhiko
0
300
The Catch in Rye: Seeding Change and Lessons Learned
mitsuhiko
0
400
Runtime Objects in Rust
mitsuhiko
0
380
Rust at Sentry
mitsuhiko
0
550
Overcoming Variable Payloads to Optimize for Performance
mitsuhiko
0
270
Rust API Design Learnings
mitsuhiko
0
640
Other Decks in Programming
See All in Programming
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
1
130
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.6k
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
580
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
200
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.5k
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
320
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
200
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
580
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
530
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
410
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
330
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
Featured
See All Featured
Accessibility Awareness
sabderemane
0
73
Art, The Web, and Tiny UX
lynnandtonic
304
21k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
140
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
80
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Done Done
chrislema
186
16k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
140
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
850
Why Our Code Smells
bkeepers
PRO
340
58k
Being A Developer After 40
akosma
91
590k
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?