-
Notifications
You must be signed in to change notification settings - Fork 7
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
Extend client and server middleware builder to allow filtering out attributes added by default #140
base: main
Are you sure you want to change the base?
Conversation
I have very mixed feelings about this. unfortunately, this middleware started out as a port of a much older middleware that was substantially out-of-date with regard to otel semantic conventions; that said, I'd like to move it in the direction of complying with otel semantic conventions by default and to the greatest degree possible. while on the surface this PR seems reasonable, I find myself wondering why we should be supporting things that are not part of the open telemetry semantic conventions. this includes the current customisation of the (by default convention-non-compliant) span names (which need to be fixed), but also includes filtering out arbitrary attributes. the most customisation that feels reasonable to me to support is specifying the minimum requirement level of attributes created by the middleware (required, recommended, optional(, experimental)). in general, I feel that these middlewares should become more opinionated (primarily based on the otel semantic conventions), not the inverse. I'm curious to hear others' thoughts though; cc @iRevive @rossabaker |
@ioleo what's your particular use case? |
@NthPortal My use case was to migrate towards otel4s library, but keep existing tag names (we're using datadog conventions currently). I could easily add new attributes, but I did not want to push unnecessary (unused by us) attributes, and so this proposal was born. However, I have since simply created a custom implementation for that (not using the Eventually we plan to move towards OTEL attribute naming convetions, so in time we will probably just switch to the default impl anyways. Thanks for your hard work on this library 🙏 I'm currently waiting for the |
@ioleo 0.9.0 stable is waiting for anyone to use the RC (such as my employer) and say it's working fine. I don't expect any issues, but I feel weird making a non-RC release without having it tested in some sort of "integration". the only reason it's even at rc.2 is because I double-bumped something in the build.sbt by accident and used up the rc.1 tag on a commit that didn't build. I fully expect the proper release to be the same commit as rc.2, so feel free to use it already if you need the newer otel4s version.
hmm, we definitely wouldn't want to discourage adoption for this reason. I will think more on this over the weekend |
There are a lot of good points and I agree with everything. From what I see, there are two big goals:
At the same time, I'm okay with adding some ad-hoc filters to enable/disable specific attributes. High cardinality metrics can be an issue (primarily financial).
I think it's a great compromise that should be suitable for the majority of the users. |
I'm wondering if it would make sense to have a trait (let's say I realise I've described the tracing implementation and not one for metrics, but I assume we can do something similar for metrics without the span name. |
@NthPortal sounds interesting. I guess we can give the |
@ioleo just want to leave an update that I am actively working on implementing |
Please see #158, sorry it took so long. had to true up the implementation with semconv as well, and add tests for that |
Currently there is an easy way to extend the default middleware to add additional attributes, but there is no way to disable/filter out attributes added by default implementation.