-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
talk(go/orchestrion): lightning talk about Orchestrion at GoLab 2024
- Loading branch information
Showing
14 changed files
with
1,975 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.PHONY: run run-uninstrumented | ||
|
||
run: | ||
DD_PROFILING_ENABLED=true DD_TRACE_AGENT_PORT=9126 orchestrion go run . | ||
|
||
run-uninstrumented: | ||
go run . |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.PHONY: clean run run-uninstrumented setup | ||
|
||
clean: | ||
rm orchestrion.tool.go | ||
go mod tidy | ||
|
||
setup: | ||
orchestrion pin | ||
|
||
run: | ||
DD_PROFILING_ENABLED=true DD_TRACE_AGENT_PORT=9126 orchestrion go run . | ||
|
||
run-uninstrumented: | ||
go run . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module dario.cat/golab2024 | ||
|
||
go 1.23.2 | ||
|
||
require github.com/go-chi/chi/v5 v5.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= | ||
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log/slog" | ||
"math/rand/v2" | ||
"net/http" | ||
"time" | ||
|
||
"github.com/go-chi/chi/v5" | ||
"github.com/go-chi/chi/v5/middleware" | ||
) | ||
|
||
func serveHTTP() { | ||
r := chi.NewRouter() | ||
r.Use(middleware.Logger) | ||
r.Use(middleware.Recoverer) | ||
r.Get("/ping", func(w http.ResponseWriter, r *http.Request) { | ||
fmt.Fprintf(w, "Pong!") | ||
}) | ||
http.ListenAndServe("127.0.0.1:8080", r) | ||
} | ||
|
||
func generateRequests() { | ||
for { | ||
_, err := http.Get("http://127.0.0.1:8080/ping") | ||
if err != nil { | ||
slog.Error(err.Error()) | ||
} | ||
amount := rand.Int() % 300 | ||
time.Sleep(time.Duration(amount) * time.Millisecond) | ||
} | ||
} | ||
|
||
func main() { | ||
go serveHTTP() | ||
generateRequests() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
marp: true | ||
paginate: true | ||
--- | ||
|
||
# Orchestrion: lightning demo | ||
|
||
### Automatic compile-time instrumentation of Go code | ||
|
||
Dario Castañé (he/him; github: darccio, bsky: dario.cat, fediverse&email: d@rio.hn) | ||
GoLab 2024 | ||
|
||
<!-- | ||
DataDog: dd-trace-go maintainer | ||
In the next minutes, we'll go from a basic chi server without any dd-trace-go code to the exactly chi server | ||
without any dd-trace-go code BUT sending traces and profiles | ||
to DataDog platfor. | ||
--> | ||
|
||
--- | ||
|
||
<style> | ||
img[alt~="center"] { | ||
display: block; | ||
margin: 0 auto; | ||
} | ||
</style> | ||
|
||
![center](./golab2024.jpeg) | ||
|
||
--- | ||
|
||
# The code | ||
|
||
--- | ||
|
||
# Orchestrion | ||
|
||
[github.com/DataDog/orchestrion](github.com/DataDog/orchestrion) | ||
|
||
<!-- | ||
cat go.mod | ||
orchestrion pin | ||
cat go.mod | ||
--> | ||
|
||
--- | ||
|
||
# Demo time! | ||
|
||
We got: | ||
|
||
- [Traces!](https://app.datadoghq.eu/apm/traces?query=%40_trace_root%3A1%20service%3Agolab2024&agg_m=count&agg_m_source=base&agg_t=count&cols=core_service%2Ccore_resource_name%2Clog_duration%2Clog_http.method%2Clog_http.status_code&fromUser=false&historicalData=false&messageDisplay=inline&query_translation_version=v0&serviceName=golab2024&sort=desc&spanType=trace-root&storage=hot&view=spans&paused=false) | ||
- [Profiling!](https://app.datadoghq.eu/profiling/explorer?query=service%3Agolab2024%20host%3ACOMP-WDWT6G66NH&agg_m=count&agg_m_source=base&agg_t=count&fromUser=true&my_code=disabled&refresh_mode=paused&viz=flame_graph&live=true) | ||
|
||
--- | ||
|
||
# Do you want to know more? | ||
|
||
Julio Guerra - GopherCon Europe 2021: [youtu.be/Uk1hscXhlY0](https://youtu.be/Uk1hscXhlY0) | ||
|
||
Jon Bodner - GopherCon 2023: [youtu.be/5l-W7vPSbuc](https://youtu.be/5l-W7vPSbuc) | ||
|
||
Me (again): bsky: dario.cat, fediverse&email: d@rio.hn | ||
|
||
These slides: [github.com/darccio/talks/main/go/orchestrion](https://github.com/darccio/talks/main/go/orchestrion) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log/slog" | ||
"math/rand/v2" | ||
"net/http" | ||
"time" | ||
|
||
"github.com/go-chi/chi/v5" | ||
"github.com/go-chi/chi/v5/middleware" | ||
) | ||
|
||
func serveHTTP() { | ||
r := chi.NewRouter() | ||
r.Use(middleware.Logger) | ||
r.Use(middleware.Recoverer) | ||
r.Get("/ping", func(w http.ResponseWriter, r *http.Request) { | ||
fmt.Fprintf(w, "Pong!") | ||
}) | ||
http.ListenAndServe("127.0.0.1:8080", r) | ||
} | ||
|
||
func generateRequests() { | ||
for { | ||
_, err := http.Get("http://127.0.0.1:8080/ping") | ||
if err != nil { | ||
slog.Error(err.Error()) | ||
} | ||
amount := rand.Int() % 300 | ||
time.Sleep(time.Duration(amount) * time.Millisecond) | ||
} | ||
} | ||
|
||
func main() { | ||
go serveHTTP() | ||
generateRequests() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
marp: true | ||
paginate: true | ||
--- | ||
|
||
# Orchestrion: lightning demo | ||
|
||
### Automatic compile-time instrumentation of Go code | ||
|
||
Dario Castañé (he/him; github: darccio, bsky: dario.cat, fediverse&email: d@rio.hn) | ||
GoLab 2024 | ||
|
||
<!-- | ||
DataDog: dd-trace-go maintainer | ||
In the next minutes, we'll go from a basic chi server without any dd-trace-go code to the exactly chi server | ||
without any dd-trace-go code BUT sending traces and profiles | ||
to DataDog platfor. | ||
--> | ||
|
||
--- | ||
|
||
<style> | ||
img[alt~="center"] { | ||
display: block; | ||
margin: 0 auto; | ||
} | ||
</style> | ||
|
||
![center](./golab2024.jpeg) | ||
|
||
--- | ||
|
||
# The code | ||
|
||
--- | ||
|
||
# Orchestrion | ||
|
||
[github.com/DataDog/orchestrion](github.com/DataDog/orchestrion) | ||
|
||
--- | ||
|
||
# Demo time! | ||
|
||
We got: | ||
|
||
- [Traces!](https://app.datadoghq.eu/apm/traces?query=%40_trace_root%3A1%20service%3Agolab2024&agg_m=count&agg_m_source=base&agg_t=count&cols=core_service%2Ccore_resource_name%2Clog_duration%2Clog_http.method%2Clog_http.status_code&fromUser=false&historicalData=false&messageDisplay=inline&query_translation_version=v0&serviceName=golab2024&sort=desc&spanType=trace-root&storage=hot&view=spans&paused=false) | ||
- [Profiling!](https://app.datadoghq.eu/profiling/explorer?query=service%3Agolab2024%20host%3ACOMP-WDWT6G66NH&agg_m=count&agg_m_source=base&agg_t=count&fromUser=true&my_code=disabled&refresh_mode=paused&viz=flame_graph&live=true) | ||
|
||
--- | ||
|
||
# Do you want to know more? | ||
|
||
Julio Guerra - GopherCon Europe 2021: [youtu.be/Uk1hscXhlY0](https://youtu.be/Uk1hscXhlY0) | ||
|
||
Jon Bodner - GopherCon 2023: [youtu.be/5l-W7vPSbuc](https://youtu.be/5l-W7vPSbuc) | ||
|
||
Me (again): bsky: dario.cat, fediverse&email: d@rio.hn | ||
|
||
These slides: [github.com/darccio/talks/main/go/orchestrion](https://github.com/darccio/talks/main/go/orchestrion) |
Binary file not shown.