open-telemetry / open-telemetry/opentelemetry-java-instrumentation

Akka HTTP Bad Request 400 is not being traced

Open
#5,139 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug contribution welcome repro provided
Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 18h
Merged PRs (30d)
228

Description

Description
When Akka HTTP server produces Bad Request 400 due to illegal request there is no trace produced by opentelemetry-javaagent.

Steps to reproduce
See example project https://github.com/makssobolevs/akka-open-telemetry-test

$ curl -v http://localhost:8080/%%
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /%% HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.80.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Server: akka-http/10.2.4
< Date: Sat, 15 Jan 2022 16:33:16 GMT
< Connection: close
< Content-Type: text/plain; charset=UTF-8
< Content-Length: 77
< 
* Closing connection 0

Agent config used:

 "-Dotel.resource.attributes=service.name=test",
 "-Dotel.traces.exporter=logging",
 "-Dotel.traces.sampler=always_on"

What did you expect to see?
I would expect to see span in logs with http.status_code=400

What did you see instead?
I see only akka http warning
[2022-01-15 19:33:16,844] [WARN] [akka.actor.ActorSystemImpl] [Test-akka.actor.default-dispatcher-5] [akka.actor.ActorSystemImpl(Test)] - Illegal request, responding with status '400 Bad Request': Illegal request-target: Invalid input '%', expected HEXDIG (line 1, column 3): /%%

Version
opentelemetry-javaagent 1.9.2
Akka 2.6.14
Akka HTTP 10.2.4
Scala 2.13.5
OpenJDK 11.0.13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked example project with opentelemetry-javaagent 1.9.2 and reproducing the curl request to /%%. Trace the Akka HTTP request path and determine where the illegal request produces the 400 response; done means a span is emitted with http.status_code=400 and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, scala
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.