Skip to content

Commit

Permalink
Fixup makefile and generate trace/span id
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi committed Mar 29, 2023
1 parent 9231e49 commit 41a5816
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/e2e/k8s/sample-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ spec:
value: "test-opentelemetry-collector:4317"
- name: OTEL_SERVICE_NAME
value: "sample-app"
- name: OTEL_PROPAGATORS
value: "tracecontext,baggage"
resources: {}
securityContext:
runAsUser: 0
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ verify-licenses: | $(GOLICENSES)
.PHONY: fixture-nethttp fixture-gorillamux
fixture-nethttp: fixtures/nethttp
fixture-gorillamux: fixtures/gorillamux
fixture/%: LIBRARY=$*
fixture/%:
fixtures/%: LIBRARY=$*
fixtures/%:
IMG=otel-go-instrumentation $(MAKE) docker-build
if [ ! -d "launcher" ]; then \
git clone https://github.com/keyval-dev/launcher.git; \
Expand All @@ -74,7 +74,7 @@ fixture/%:
kind load docker-image otel-go-instrumentation sample-app kv-launcher
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
if [ ! -d "opentelemetry-helm-charts" ]; then \
git clone https://open-telemetry/opentelemetry-helm-charts; \
git clone https://github.com/open-telemetry/opentelemetry-helm-charts.git; \
fi
helm install test -f .github/workflows/e2e/k8s/collector-helm-values.yml opentelemetry-helm-charts/charts/opentelemetry-collector
kubectl wait --for=condition=Ready --timeout=60s pod/test-opentelemetry-collector-0
Expand Down
28 changes: 28 additions & 0 deletions test/e2e/gorillamux/traces.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,34 @@
]
},
"scopeSpans": [
{
"scope": {
"name": "net/http"
},
"spans": [
{
"attributes": [
{
"key": "http.method",
"value": {
"stringValue": "GET"
}
},
{
"key": "http.target",
"value": {
"stringValue": ""
}
}
],
"kind": 2,
"parentSpanId": "",
"spanId": "cc1a651bfd03c2ae",
"status": {},
"traceId": "c7f2eb84d6cf61c076e95b0a7d5eb406"
}
]
},
{
"scope": {
"name": "github.com/gorilla/mux"
Expand Down
21 changes: 21 additions & 0 deletions test/e2e/nethttp/traces.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@
"name": "net/http"
},
"spans": [
{
"attributes": [
{
"key": "http.method",
"value": {
"stringValue": "GET"
}
},
{
"key": "http.target",
"value": {
"stringValue": ""
}
}
],
"kind": 2,
"parentSpanId": "",
"spanId": "a12c8ff240d71c9b",
"status": {},
"traceId": "ff04ebd7ec9ae28959ceb0e26efde31d"
},
{
"attributes": [
{
Expand Down

0 comments on commit 41a5816

Please sign in to comment.