0

I'm creating custom spans for outgoing requests for my java app. It works and it's great ;) But... when I compare my custom span on Kibana's APM board with other spans from springboot applications, which are created by elastic-apm-agent, then I can see that my spans are very low on additional details. I would like to have at least the URL details included in my custom span. The apm-agent-api doesn't allow this.

Is there a way to set additional details, like url, to custom span? (I don't want to use labels for this)

Thanks

Oliver
  • 1
  • 3

1 Answers1

1

Using labels should be the best way to add custom details to the transaction/span but you can also use the addCustomContext() method:

https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-transaction-add-custom-context

Ricardo Ferreira
  • 1,236
  • 3
  • 6
  • Thanks for the answer, Ricardo ;) The external http span created by the java agent contains information about url and status code. But I'm not able to set these details to my custom span when using the api :( My goal is to have same details on my custom span as on the span created by the agent. In Kibana when I click on the span in Trace sample section I want to see the url and status code as it is displayed for agent created spans. – Oliver Feb 24 '21 at 08:47