Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

11
pkg/tracer/README.md Normal file
View File

@@ -0,0 +1,11 @@
# Tracing with DataDog
Run DataDog agent locally (make sure to replace `DD_API_KEY`):
```
docker run --name dd-agent -e DD_APM_ENABLED=true -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro --net="host" -e DD_API_KEY=<DD_API_KEY> gcr.io/datadoghq/agent:7
```
Connect the docker container to the network:
```
docker run --rm --net="host" order
``

22
pkg/tracer/tracer.go Normal file
View File

@@ -0,0 +1,22 @@
package tracer
import (
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"fiskerinc.com/modules/utils/envtool"
)
var agentAvailable bool
func Start() {
agentAvailable = envtool.GetEnv("DD_AGENT_HOST", "") != ""
if agentAvailable {
tracer.Start()
}
}
func Stop() {
if agentAvailable {
tracer.Stop()
}
}