-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add messaging fields to schema #143
Comments
APM Server maps However, this is another discussion that we need to have APM Server side, and maybe even think about adding to ECS, just wanted to point out that ES mapping is not that clear IMO. |
@simitt yes, sorry about that, where to locate these fields is not something I can assist with, what I meant to say is that these fields will be used similarly to the HTTP ones, so the type mapping should be similar. Please feel free to update the storage definition to whatever you decide. Regarding ECS- we discussed that and decided to start without adding it for now. If you think we should, let's discuss further. |
@eyalkoren will the information be sent for |
@eyalkoren do you think it would be possible and valuable to detect the type of the messaging system? (kafka, amqp, etc) |
I am not comparing
It certainly would make sense to have new types, not only for spans, but for transactions as well. I didn't include it in this issue because we still need to finalize what we do with the transaction types (we did not get to a final conclusion there - see the discussion issue) and because it doesn't require schema changes. |
No problem, just needed clarification for the apm-server task. |
Added a |
@elastic/apm-server I started implementing for the Java agent. Is this planned for 7.6? |
@eyalkoren yes it is planned for 7.6, but implementation hasn't started (see elastic/apm-server#2697). |
@eyalkoren Thanks for the heads up - I've created an accompanying Kibana issue to add the fields to the metadata. elastic/kibana#49465 |
@simitt @formgeist since I am the only one that implemented this so far, I added the Since the value "0" is valid and given that this is never an accurate measurement, consider some special handling for 0, for example show ~0. This field is mostly to indicate traces where messages were delayed in a queue for a long time, so the values 0 and 100 (ms) are pretty much the same thing. |
@eyalkoren Thanks for the heads up - I've updated the description of the Kibana issue |
Closing this as we have it all in the spec now. |
Description of the issue
Adding dedicated fields to schema to support messaging context.
What we are voting on
New types
Background
Message send/publish events can only be captured as spans if occurring within a traced transaction.
Message consumption can be divided into two types: passive, where you would implement a listener that is called once a message is available, and active, where the queue is being polled (blocking or non-blocking).
Passive consumption typically results in a Messaging transaction and is pretty straightforward to trace.
Message polling can be done within a traced transaction, in which case it will result in a messaging span, or it can be the initiating event for a message handling flow. Capturing polling spans is also mostly straightforward. For polling-based transactions, our goal is to capture the message handling flow, which typically starts after the polling action exits, returning a message. This may be tricky if the handling flow is not implemented within a well defined API. The actual implementation for that may be different for different clients. Whenever it is not possible (or too risky), we may consider capturing the message polling action itself, but this should be decided for each case separately and should only be used as a last resort. In any case, we should not create a transaction based on polling APIs if the polling action did not result with a message (as opposed to polling spans, where we want to capture such as well).
Proposed types
messaging
fortransaction.type
messaging
forspan.type
(both sends and receives-within-a-transaction), the name of the framework forspan.subtype
(egjms
orkafka
) and the operation forspan.action
(egsend
,receive
,poll
).New fields
context.message.queue.name
: optional formessaging
spans and transactions. Indexed as keyword. Wherever the broker terminology uses "topic", this field will contain the topic name.context.message.body
: similar to HTTP requests'context.request.body
- only fill in messaging-related transactions (ie incoming messages creating a transaction) and not for outgoing messaging spans.ELASTIC_APM_CAPTURE_BODY
agent config option.context.request.body
context.message.headers
: similar to HTTP requests'context.request.headers
- only fill in messaging-related transactions.ELASTIC_APM_CAPTURE_HEADERS
agent config option.ELASTIC_APM_SANITIZE_FIELD_NAMES
context.request.headers
context.request.headers
.context.message.age.ms
: a numeric field indicating the message's age in milliseconds. Relevant for transactions andreceive
spans that receive valid messages. There is no accurate definition as to how this is calculated. If the messaging framework provides a timestamp for the message- agents may use it. Otherwise, the sending agent can add a timestamp indicated as milliseconds since epoch UTC to the message's metadata to be retrieved by the receiving agent. If a timestamp is not available- agents should omit this field. Clock skews between agents are ignored, unless the calculated age (receive-timestamp minus send-timestamp) is negative, in which case the agent should report 0 for this field.Vote
@elastic/apm-agent-devs and @elastic/apm-server: tick the N/A box if irrelevant for you. Otherwise, link to the relevant issue or PR this and tick "Yes".
The text was updated successfully, but these errors were encountered: