GithubHelp home page GithubHelp logo

Comments (6)

shakuzen avatar shakuzen commented on August 16, 2024 2

Thanks for the quick response. We'll aim to get this included in 1.14 then.

from micrometer.

shakuzen avatar shakuzen commented on August 16, 2024

Thanks for opening the issue. I think you're the first person to ask for it, but we could certainly consider this enhancement. Not directly related to what you mentioned, but another consideration is that our MongoDB client instrumentation still doesn't use the Observation API (see the docs if you're not familiar). I think we'd like to have an instrumentation of the MongoDB client that does, but we need to check whether such instrumentation would be hosted in the Micrometer repo (as the current instrumentation is) or if it will be in the MongoDB client repo.
Also note if you're using Spring Data MongoDB, that has its own instrumentation based on the Observation API; see their docs.

from micrometer.

hadjiski avatar hadjiski commented on August 16, 2024

@shakuzen thanks for the quick reply, I am aware of the observation offered by spring data for the mongo commands, but it appears a bit cumbersome at the moment. Compared to the spring data repository observation, the one for commands is not capable of extending the DefaultMongoHandlerObservationConvention to easily customize the tags, because it is package private, rather one should copy&paste the content and implement directly GlobalObservationConvention<MongoHandlerContext> to be able to be added to the ObservationRegistryCustomizer. This was probably addressed in this issue.
Maybe we can wait for Spring boot to pick it

Spring Data MongoDB currently has the most up-to-date code to support Observability in your MongoDB application. These changes, however, haven’t been picked up by Spring Boot (yet)

Overall the whole configuration is a bit awkward, whereas the DefaultMongoCommandTagsProvider is just working out of the box, just without the exception ;)

from micrometer.

hadjiski avatar hadjiski commented on August 16, 2024

@shakuzen do you think it can go into 1.13.0 by 13 of May?
Since it only requires:
Tag.of("exception", (event instanceof CommandFailedEvent failed) ? getExceptionName(failed.getThrowable()) : "none")
or
Tag.of("error", (event instanceof CommandFailedEvent failed) ? getExceptionName(failed.getThrowable()) : "none")
depending on which convention you are following

by having such helper methods e.g.

private String getExceptionName(Throwable error) {
        return this.getSimpleClassName(error.getClass());
    }

    private String getSimpleClassName(Class<?> type) {
        String simpleName = type.getSimpleName();
        return !StringUtils.hasText(simpleName) ? type.getName() : simpleName;
    }

from micrometer.

shakuzen avatar shakuzen commented on August 16, 2024

do you think it can go into 1.13.0 by 13 of May?

Typically, we would not merge enhancements for a feature release after a release candidate has been made available. 1.13.0-RC1 is already out. The proposed change sounds low risk enough, but the workaround - provide your own tags provider extending the default one - is also easy enough. Could you not use a custom tags provider until 1.14.0 if we included this enhancement there? Would you also be interested in contributing a pull request for this?

from micrometer.

hadjiski avatar hadjiski commented on August 16, 2024

Thanks for letting me know, I agree with you and there is no urgency for 1.13, it was just an informational question. As of the PR contribution, currently I am not able to involve myself on that level 😐

from micrometer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.