DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Front-End Troubleshooting Using OpenTelemetry
  • 11 Observability Tools You Should Know
  • How Observability Is Redefining Developer Roles
  • Router4j: A Free Alternative to Google Maps for Route and Distance Calculation

Trending

  • Driving DevOps With Smart, Scalable Testing
  • Prioritizing Cloud Security Risks: A Developer's Guide to Tackling Security Debt
  • AI-Driven Root Cause Analysis in SRE: Enhancing Incident Resolution
  • How to Perform Custom Error Handling With ANTLR
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Simplifying Multi-Cloud Observability With Open Source

Simplifying Multi-Cloud Observability With Open Source

As cloud workloads become increasingly sophisticated, adopting an open-source and vendor-agnostic approach is key to streamlining organizational operations.

By 
Siri Varma Vegiraju user avatar
Siri Varma Vegiraju
DZone Core CORE ·
Sep. 25, 24 · Analysis
Likes (2)
Comment
Save
Tweet
Share
5.5K Views

Join the DZone community and get the full member experience.

Join For Free

Gartner predicts by 2028, 50% of enterprises will utilize the cloud. The growth has also seen an increase in different strategies for organizations to use the cloud. Initially, organizations were completely on-prem, and then they were hybrid, where some workloads were still on-prem but some were migrated to the cloud. Eventually, companies started moving to multi-cloud where they use more than one cloud provider to host their workloads. A recent Oracle survey indicates that 98% of enterprises are either considering or already implementing a multi-cloud strategy.

So what are the motivations for these enterprises to move towards multi-cloud?

Motivations for Multi-Cloud

Data Sovereignty

Every country has its own data privacy and protection laws. The European Union has the GDPR, and the United States, India, China, and Japan have similar laws. It is the responsibility of the company serving customers in these regions to abide by these laws or face regulatory challenges.

One reason organizations want to use multiple clouds is when they identify the current cloud provider does not support their requirements.

Cloud Vendor Lock-In

Cloud vendor offerings keep changing. Old services are deprecated, new services are created, costs change, and regions go down. 

Enterprise companies want to stay resilient to these changes and ensure none of the above affects their business operations. Using the multi-cloud strategy, organizations can develop architectures that don't take a dependency on a specific platform.

Cost Optimization

Each cloud provider has their strong offerings. Some offer free ingress/egress, discounted storage, and computing. Multi-cloud can help leverage these efficiencies as organizations are not tied to a specific vendor.

Observability

Observability is the bread and butter of any service. It answers questions such as, "Are we reaching our SLAs and SLOs?" and, "How is the user experience?" At its core, observability consists of three building blocks: metrics, logs, and traces. 

  • Metrics – Provide the numerical measure of the current state of the system
  • Logs – Give stack trace or any other metadata required for debugging the system
  • Traces – Provide the entire lifecycle of a request in a distributed microservice architecture

Why Observability Needs a Different Approach for Multi-Cloud

In a world where an organization relies on just one cloud, observability is not complicated. You have one SDK, dashboard, and schema that users have to understand. 

C#
 
// Azure Monitor
public static void sendToAzure Monitor(String metricName, double value) {

    // Implement Azure Monitor logic
    MetricsQueryClient client = new MetricsQueryClient (/* authentication details */);
    MetricData metricData = new MetricData()
        .withName (metricName)
        .withValue(value)..
    QueryResponse response = client.query( /* query details */);
}


Now, imagine you are operating in a multi-cloud environment. There is more than one SDK to maintain. The previous code snippet will turn into this nightmare.

C#
 
// AWS CloudWatch
public static void sendToAWSCloudWatch(String metricName, double value) {
 
    AmazonCloudWatch cloudWatch AmazonCloudWatchClientBuilder.defaultClient();
    PutMetricDataRequest request = new PutMetricDataRequest()
      .withNamespace("MyNamespace")
      .withMetricData(new MetricDatum()..
    PutMetricDataResult result = cloudwatch.putMetricData(request);
}
                      
// Implement Azure Monitor logic
public static void sendToAzure Monitor(String metricName, double value) {
  
    MetricsQueryClient client = new MetricsQueryClient(/* authentication details */);
    MetricData metricData = new MetricData()
        .withName (metricName)
        .withValue(value)..	
    QueryResponse response = client.query(/" query details */);
}

// Oracle Cloud Monitoring
public static void sendToOracle(String metricName, double value) {
  
    MonitoringClient client = new MonitoringClient(/* authentication details */);
    PutMetricsDataRequest request = PutMetricsDataRequest.builder()
    .metricData(/* build metric data */)
    .namespace("MyNamespace")
    .build();...
    PutMetricsDataResponse response = client.putMetricsData(request);
}


Some of the other problems include:

  • Understanding schema and SDK internals
  • Getting to know the nuances of how observability is implemented by each cloud provider

What we discussed until now is just barely scratching the surface. Operations will turn into a huge pain because the on-call has to context switch between multiple cloud implementations and understand varying data formats. On average, a company uses nine different monitoring tools to manage applications, infrastructure, and user experience, which is just not scalable.

How do we solve this? How do we make life easier for the developers? 

The crux of the problem lies in being vendor agnostic. Being so will help us offer a single-pane-of-glass experience for our developers.

Open Source and OpenTelemetry

OpenTelemetry facilitates this experience. 

  • It provides a single open-source standard to emit metrics, logs, and traces.
  • All the major cloud providers (e.g., AWS, Google Cloud, Azure, and Oracle) support this standard.
  • Most importantly, it is vendor-agnostic.

How Does OpenTelemetry Work?

Before OpenTelemetry

Before OpenTelemetry

Before OpenTelemetry, observability looked something like the above. In this example, we use Azure Monitor and Log Analytics to emit metrics and logs from our service.

  • Step 1: The service imported Azure Monitor SDK as a dependency.
  • Step 2: We would write code specific to Azure monitor client to emit metrics
  • Step 3: Metrics would show up in the Azure monitor dashboard.

After OpenTelemetry

After OpenTelemetry

  • Step 1: The service uses language-specific OpenTelemetry SDK.
  • Step 2: Each cloud provider has their own OpenTelemetry Exporter. This exporter is responsible for translating the metrics from the SDK in a way the provider understands. AWS, Azure, Google Cloud, and Jaeger, for example, have other exporters.
  • Step 3: Metrics show up automatically in the corresponding cloud provider dashboard. In this case, it's Azure.

Simply put, the service owners are not locked to a specific implementation. They end up using the open-source standard to emit observability data, and vendors take care of translating this data into a language they understand.

Here is an example of how OpenTelemetry works with different cloud providers.

Example of how OpenTelemetry works with different cloud providers

A code snippet of how emitting metrics to different vendors becomes easy:

C#
 
// Set up namespace to emit metrics
var meter = new Meter("MyCompany.MyProduct.MyLibrary", "1.0");
var requestCounter = meter.CreateCounter<long>("requests_processed");

// Set up OpenTelemetry for metrics
using var meterProvider = Sdk.CreateMeterProviderBuilder()
    .AddMeter("MyCompany.MyProduct.MyLibrary") // Specify which meters to collect metrics from // Export metrics to console
    .AddConsoleExporter()
    .AddAzureMonitorExporter()
    .AddPrometheusExporter(opt =>
    {
      opt.HttpListenerPrefixes = new string[] { "http://localhost:9464/" }; // Prometheus endpoint
    })
    .AddOtlpExporter(opt =>
    {
      opt.Endpoint = new Uri("http://localhost:4317"); // Set OTLP endpoint
    }).Build();

// Emit metrics
requestCounter.Add(1);


If we need to emit metrics or logs to another provider, it is as easy as:

  • Importing the dependency/package in Java/C# (there is support for other languages as well)
  • Adding their Exporter to the list of Exporters above

Now that we have emitted data, it would also be good to have a unified experience to view this data. Using Grafana, all the data emitted to different cloud providers can be exported to one single place.

Grafana

Similarly, tools like Jaegar help export trace data. 

Final Thought

There you go, we've developed an observability stack that can seamlessly scale, regardless of how many cloud providers the organization uses.

Observability Open source Software development kit Cloud Data Types

Opinions expressed by DZone contributors are their own.

Related

  • Front-End Troubleshooting Using OpenTelemetry
  • 11 Observability Tools You Should Know
  • How Observability Is Redefining Developer Roles
  • Router4j: A Free Alternative to Google Maps for Route and Distance Calculation

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!