Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve opentelemetry parent span from headers #275

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Conversation

adam-cattermole
Copy link
Member

@adam-cattermole adam-cattermole commented Mar 21, 2024

The changes here use the propagated headers from wasm-shim to configure the current span for each incoming request to limitador.

Verification

I have provided a script in a branch of the kuadrant-operator that provisions and configures everything necessary for the tracing setup. This configures and deploys jaeger, istio, authorino as well as a route, authpolicy and ratelimitpolicy and limitador changes from this branch.

From my branch https://github.com/adam-cattermole/kuadrant-operator/tree/tracing-script

. hack/tracing-setup.sh

Then you can open the jaeger UI:

firefox -private-window "tracing.${INGRESS_DOMAIN}"

Look for the requests under Service: istio-ingressgateway-istio.istio-system -> Operation: egress api.toystore.com

Send a curl request to the endpoint providing the tracing headers:

curl -H 'Authorization: APIKEY IAMALICE' \
    -H 'Host: api.toystore.com' \
    -H "Traceparent: 00-$(openssl rand -hex 16)-00f067aa0ba902b7-01" \
    -H 'Tracestate: rojo=00f067aa0ba902b7' \
    -H 'Baggage: key1=value1;property1;property2, key2 = value2, key3=value3; propertyKey=propertyValue' \
    http://$GATEWAY_URL/cars

See the full trace:
image

@adam-cattermole adam-cattermole self-assigned this Mar 21, 2024
@adam-cattermole adam-cattermole force-pushed the tracing-otel branch 3 times, most recently from 5707be2 to c7e1372 Compare March 25, 2024 14:27
@@ -312,7 +314,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.with_endpoint(config.tracing_endpoint.clone()),
)
.with_trace_config(trace::config().with_resource(Resource::new(vec![
KeyValue::new("service.name", "limitador-server"),
KeyValue::new("service.name", "limitador"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the name here to match authorino spans

@adam-cattermole adam-cattermole force-pushed the tracing-otel branch 2 times, most recently from 0311d87 to 2501105 Compare March 26, 2024 14:03
@adam-cattermole adam-cattermole marked this pull request as ready for review March 26, 2024 14:18
@adam-cattermole adam-cattermole merged commit a1ea581 into main Apr 3, 2024
20 checks passed
@adam-cattermole adam-cattermole deleted the tracing-otel branch April 3, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants