-
Notifications
You must be signed in to change notification settings - Fork 526
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
Allow overriding of meta data in intake V2 #1175
Comments
I was looking into elastic/apm-agent-go#69 today, seeing what needed to be changed in the server. Turns out it already works, probably by accident :) The server merges apm-server/model/metadata/metadata.go Lines 94 to 103 in 37091ea
This is backwards for what @felixbarny is requesting, but works in my case where I just want to set the framework at the transaction level. I think we'll want to swap the merge order. |
related Issue #1255 |
@elastic/apm-agent-devs could you please define which fields you'd like to send on an event level. We need to agree on whether the information per event should be merged with the object sent in the metadata or should be set instead of the metadata information. At the moment the |
I'd like to send |
+1 from .NET on |
If we merge the data, it means you need to ensure to send all attributes you want to be overwritten in the event. E.g. if the user sent within metadata is a different one than the one sent in the event (for whichever reason this should ever happen), you would need to send all user data in the event, as otherwise two unrelated user objects would be mixed. Same for every other object you want to overwrite. |
fwiw, the least complicated to address this imo is:
|
What would be a use case to set the user in the meta data? The use cases I have in mind are overriding the service name and the framework name on a per-event basis. I don't think these would be breaking changes. If there is a use case to set data which is usually associated with transactions or spans, like user, in the meta data, I feel like we should discuss that separately. |
The API already allows sending a user in the metadata since 6.5. I assume sending user data via metadata makes especially sense for the rum agent, for sending information about the currently logged in user. |
I suggest we implement the same solution for whichever data are given in the metadata and can be overriden per event, so there is a clear definition of the outcome of overriding data. |
I currently only need to set |
I am going to add |
|
Same from me. I think service.name is more important... the framework will be probably the same, but with different service names - at least in .NET that would be very typical. |
@felixbarny I can see why making |
But it probably still makes sense to check if the resulting document has |
Giving it a second thought I am not going to only define some service attributes to be overridable, as this would for probably lead to more discussion and confusion in the future. All the requirements for sending up |
Gotcha, I'm fine with that |
* Allow overriding `service` information from `context`. fixes #1175
* Allow overriding `service` information from `context`. fixes elastic#1175
* Allow overriding `service` information from `context`. fixes elastic#1175
* Allow overriding `service` information from `context`. fixes elastic#1175
In Java, you can have multiple applications in one JVM and multiple frameworks in one application. Therefore, I propose that the intake API should allow that specific payload attributes of service can be overridden. Related Java agent issue: elastic/apm-agent-java#136
The payload JSON schema defines meta-data which is valid for all the transactions and spans it contains. Instead of allowing only some attributes like
service.name
to be overridden in aTransaction
, add theservice
object toTransaction
,Span
andError
. This allows default values to be set in thePayload
"header" but allows specific objects to override the defaults. In languages where there can only ever be oneservice.name
, this requires no changes and no additional overhead.One problem with that approach is that there are required attributes in
service
likeagent
andname
. These should not have to be repeated. If possible with JSON schema, it would be nice to remove therequired
part from the service definition and only add it where necessary whenever theservice
is used.The text was updated successfully, but these errors were encountered: