Skip to content

Commit

Permalink
talk(go/orchestrion): lightning talk about Orchestrion at GoLab 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
darccio committed Nov 12, 2024
1 parent dcd1fb6 commit 24ae7d9
Show file tree
Hide file tree
Showing 14 changed files with 1,975 additions and 0 deletions.
7 changes: 7 additions & 0 deletions go/orchestrion/Makefile
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 .
325 changes: 325 additions & 0 deletions go/orchestrion/go.mod

Large diffs are not rendered by default.

1,418 changes: 1,418 additions & 0 deletions go/orchestrion/go.sum

Large diffs are not rendered by default.

Binary file added go/orchestrion/golab2024.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions go/orchestrion/golab2024/Makefile
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 .
5 changes: 5 additions & 0 deletions go/orchestrion/golab2024/go.mod
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
2 changes: 2 additions & 0 deletions go/orchestrion/golab2024/go.sum
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=
Binary file added go/orchestrion/golab2024/golab2024.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions go/orchestrion/golab2024/main.go
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()
}
67 changes: 67 additions & 0 deletions go/orchestrion/golab2024/slides.md
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 added go/orchestrion/golab2024/slides.pdf
Binary file not shown.
38 changes: 38 additions & 0 deletions go/orchestrion/main.go
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()
}
61 changes: 61 additions & 0 deletions go/orchestrion/slides.md
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 added go/orchestrion/slides.pdf
Binary file not shown.

0 comments on commit 24ae7d9

Please # to comment.