-
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
Deprecating custom context in favor of tags #7
Comments
While I'm generally in favor of this proposal, I just have a few comments on your listed cons:
I'm not sure how this is handled in the other agents, but in the Node.js agent this isn't a problem as the JSON serializer we're using is safe when it comes to circular references etc. I hope all agents guard against this so that they don't risk crashing the system.
We could just add that if we wanted to
This could also be seen as a feature as it means users can store data without the fear of breaking the index 🤔
Yes 👍 |
True, that's why I also added that as a con to tags. But if the only value of custom context is that it's not indexed, I think its better to have non-indexed tags so it is verry clear to users what the difference is.
In case of the manual serialization approach in the Java agent, this would add both complexity and overhead. Serializing arbitarty objects is also not that easy with the JSON serializer we are using there. If we were ever to support additional formats like Protocol Buffers, arbitrary, user-supplied custom context objects would be a blocker. |
This is a very big point plus for removing custom context 💯 If the user really wanted to store an object, they could just serialize the JSON them selfs and store it as a tag value (though the size would of course be limited to 1024 chars) |
One other thing to watch out for: Having keys like |
AFAIK, our agents de-dot by default. |
Not to my knowledge |
@elastic/apm-agent-devs please vote:
|
|
Vote on what? Summary + question would be nice. |
Cited what to vote on from the issue description |
I'm not sure this is a product-related decision. If we agree to deprecate custom context we will ofc have to also deemphasize and deprecate the custom context in the UI. But we can only do that after we agree that makes sense from an agent's perspective. Let me know if you still think product should be involved 🙂 |
Thanks Felix for updating the comment ❤️ I am fine with this but don't agree that it isn't a product decision. We should hear @makwarth – and he can take into account that the agents have concerns about custom context. |
@felixbarny does this come down to a naming problem then? Because Before making a decision here, do we know if/how If we are aiming for removing |
the major open question that @felixbarny posted in the top hasn't been addressed:
The ability to send up non-indexed data was the reason for custom in the first place. We've since heard customer requests for more control over how things are indexed. I've posted #53 to address that issue but haven't heard anything. |
By now, I also think we need support for non-indexed key/value pairs. For example to add a value which is larger than 1024 chars. But I question that we need to have support for arbitrarily nested objects. Do you have use cases for that in mind? We could still allow customizing how those key/value pairs are indexed. Restricting to key/value pairs has the advantage that we know the schema up-front which reduces the risk of serialization errors and allows us to use formats like protobuf in the future. I think this issue and #53 are complementary. |
Great @felixbarny! I'm fine to restrict to key/value pairs. In some languages we can't guarantee that users don't add a complex structure to "custom" at compile time. In those cases we could either try to serialize to JSON gracefully or ignore it all together. I think for something like Python, you'd expect something that resembles what you set, to show up. Thoughts @beniwohli ? |
Do you mean serializing the object to a JSON string and setting that string as the value? For example |
@roncohen we already say in the documentation that the custom context should be a flat key/value dict: https://www.elastic.co/guide/en/apm/agent/python/master/api.html#api-set-custom-context Currently we don't enforce that (although I thought we did, but I can't find it in the code), but I'd be in favor of doing that, by stringifying the value (as in, call |
Ah, great, I wasn't aware of this. Then this basically boils down to a naming issue. If the only difference between custom context and labels (formerly tags) is how it's indexed, I think renaming to |
I am re-raising my questions and my concerns about this being a breaking change on Intake API and ES level from #7 (comment). I'd really be interested in the motivation of why to limit sending up non-indexed fields to simple |
|
This would not be a breaking change. The |
@felixbarny just to clarify, I linked to documentation of the Python agent. I'm not aware if any other agent has similar wording |
To summarize this, @felixbarny you are suggesting to:
Did I get this right? I am still not sure whether or not we have any data backing up the assumption that the feature is not used at the moment. |
since this includes "deprecate context.custom at Intake API" it conflicts with #53. So we need to consider them together. |
I think it is fine from a technical perspective. Following along the conversations here, and also the fact that @roncohen agreed on removing |
Great summary @simitt.
I'm sure
I don't see them conflicting. We should still allow users to customize the indexing of the non-indexed labels. An alternative to introducing non-indexed labels would be to restrict the |
From the issue #53:
The difference is that you suggest to restrict which data can be uploaded, while at the moment there are no restrictions. That is the crucial point. |
@simitt and I discussed offline. We need to discuss the product implications. I'll bring it up on the appropriate sync.
I don't think it makes sense to call them non-indexed labels and then let people add indexing. |
In the meeting, we concluded the following:
If there are no objections, I'll close this issue in a week. |
elastic/apm-server#2111 will hopefully fix this problem by adding more in-depth and centralized documentation on labels/user/custom. |
Cool :)
We should also add the key differences to the respective API docs.
…On Wed 17. Apr 2019 at 19:54, Brandon Morelli ***@***.***> wrote:
The confusion around whether to use labels or custom context does not seem
to warrant breaking backwards compatibility or having users to migrate to
non-indexed labels. *That confusion is better resolved with
documentation.*
elastic/apm-server#2111
<elastic/apm-server#2111> will hopefully fix
this problem by adding more in-depth and centralized documentation on
labels/user/custom.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACEDCNjh7_2J6euRyxawuT99ONFx280wks5vh1_rgaJpZM4X7qGB>
.
|
Was there any discussion of when to add custom context APIs to the agents that currently lack them? (only Java and Go I think) |
Those agents can start adding these APIs now. As mentioned, I plan to only offer an API to add key/value pairs where the value is either a String, Number or boolean. What's your plan for the go agent? |
Not sure yet. Probably accept an arbitrary value, encode basic types to string/number/bool, and stringify complex types. |
Today, users have two options for adding additional metadata to transactions and spans.
We offer custom context and tags in most agent APIs.
Both are quite similar which causes confusion to users https://discuss.elastic.co/t/custom-context-vs-tags/151126.
Cons of custom context
Cons of Tags
cart_value
number tag on a checkout cart transaction. See also Allow setting numbers as tags apm-server#828So I propose deprecating the custom context and suggest users to move to span tags. In the agents which are still in beta, we should remove the custom context and agents which are already generally available should deprecate the custom context.
Open questions:
addIndexedTag
andaddNonIndexedTag
.The text was updated successfully, but these errors were encountered: