Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Introduction to microservices observability with Eclipse MicroProfile

October 1, 2019
Rhuan Rocha
Related topics:
Microservices

    Microservices provide a modern approach to development, which is compliant with the cloud environment and gives us the ability to create cloud-native applications. With microservices, we promote resilience, fault tolerance, and scale; however, a microservice approach also presents different challenges than monolithic applications because of its distributed nature.

    One of these challenges involves monitoring and logging, which naturally brings us to the concept of observability. In this article, we'll look at how Eclipse MicroProfile can help you implement observability in microservices.

    What is observability?

    The concept of observability comes from the control theory, that is, a math theory.

    Formally, a system is said to be observable if, for any possible sequence of state and control vectors (the latter being variables whose values one can choose), the current state (the values of the underlying dynamically evolving variables) can be determined in finite time using only the outputs. — Wikipedia

    Some developers define observability in a microservice architecture as the set of metrics, logging, and tracing tools, but I think observability is a more general concept. Metrics, logging, and tracing are simply ways to provide observability.

    To me, observability is the capacity of a system to expose precise information about its states in a quick and easy way. Unlike monitoring, observability is about the system. When we talk about monitoring, the focus is on the tools used to monitor the system, which can be easy or hard to monitor. When we talk about observability, the focus is on the system itself and the need to provide this information in an easier and faster way.

    Observability with MicroProfile

    With the aim of supporting easy observability, MicroProfile has specifications that let the developer implement observability in microservices. MicroProfile has three main specifications for this:  Microprofile OpenTracing, MicroProfile Metrics, and MicroProfile HealthCheck—all of which we'll look at here.

    Screenshot from 2019-02-27 16-44-31

    MicroProfile OpenTracing

    The MicroProfile OpenTracing specification permits us to use distributed tracing using the OpenTracing API to trace  the flow of a request across a service. This specification is compatible with Zipkin and Jaeger, and it permits us to use those tools to show information about the distributed tracing. Below is an example of how to use MicroProfile OpenTracing.

    @Path("subjects")
    @Traced
    public  SubjectEndpoint {
    

    MicroProfile Metrics

    MicroProfile Metrics is a specification that permits us to expose metrics information about our applications. With this, we can expose precise metrics to be consumed more quickly and easily. Below is an example of how to use MicroProfile Metrics.

    @Counted
    public CounterBean() {
    }

    MicroProfile HealthCheck

    The MicroProfile HealthCheck spec permits us to expose if the application is up or down in our environment. It works as a Boolean response (yes or no) to the question, "Is my application still running ok?". Below is an example of how to use MicroProfile HealthCheck.

    @Health
    @ApplicationScoped
    public class ApplicationHealthCheck implements HealthCheck {
    
        @Override
        public HealthCheckResponse call() {
            return HealthCheckResponse
                    .named("application-check").up()
                    .withData("CPUAvailable", Runtime.getRuntime().availableProcessors())
                    .withData( "MemoryFree", Runtime.getRuntime().freeMemory())
                    .withData("TotalMemory", Runtime.getRuntime().totalMemory())
                    .build();
        }
    }
    

    Conclusion

    Eclipse MicroProfile provides several solutions to microservice challenges, including various specifications to promote observability in our microservices. With these specs, we can use MicroProfile with Jaeger, Zipkin, Prometheus, and other tools to promote better observability and monitoring. I will provide more details of these specs and how to use them in upcoming articles.

    Last updated: July 1, 2020

    Recent Posts

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.