VOOZH about

URL: https://thenewstack.io/metrics-logs-and-traces-more-similar-than-they-appear/

⇱ Metrics, Logs and Traces: More Similar Than They Appear? - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2023-04-06 06:59:03
Metrics, Logs and Traces: More Similar Than They Appear?
sponsor-influxdata,sponsored-post-contributed,
Data / Observability / Operations

Metrics, Logs and Traces: More Similar Than They Appear?

They require different approaches for storage and querying, making it a challenge to use a single solution. But InfluxDB is working to consolidate them into one.
Apr 6th, 2023 6:59am by Andrew Lamb
👁 Featued image for: Metrics, Logs and Traces: More Similar Than They Appear?
InfluxData sponsored this post.

Time series data has unique characteristics that distinguish it from other types of data. But even within the scope of time series data, there are different types of data that require different workloads. Metrics, traces and logs are all different, making it a challenge to design a single solution that can handle all three data types.

While the data structure for all three types is generally the same, the query patterns for each workload differs. Systems designed to store time series data don’t all handle those different query patterns the same. We see this challenge reflected in the time series marketplace, where there are three classes of software for metrics, traces and logs.

Solutions like InfluxDB, Grafana, Prometheus and others can collect, store, analyze and visualize metric data. Jaeger is available for end-to-end distributed tracing, and recent updates to InfluxDB make it a viable option as well. For logs, a common solution is the so-called ELK stack, which consists of Elasticsearch, Logstash and Kibana, but a solution like Loki can handle logs too.

Logs are the most challenging type of time series data to work with, so let’s dive into why that’s the case.

InfluxData is the creator of InfluxDB, the leading time series platform. More than 1,900 customers use InfluxDB to collect, store, and analyze all time series data at any scale. Developers can query and analyze their time-stamped data to predict, respond, and adapt in real-time.
Learn More
The latest from InfluxData

Data Model

As mentioned above, all time series data can use the same data model. InfluxDB’s line protocol provides a helpful example.

“`measurement,tag1=value,tag2=value field1=value,field2=value timestamp“`

Here, the measurement functions, like the name of a table and the timestamp, are exactly that. The tags and fields are key-value pairs, where tags function as metadata and fields represent the data you want to collect, store, analyze and/or visualize.

A series is the unique combination of measurement and tag values, so the more tags you have, the more unique series you have. We call this cardinality, and when cardinality gets too high, it can affect performance. This issue is typical for all approaches based on a log-structured merge-tree (LSM), which is a common solution for metrics systems.

Parsing Log Data

Let’s say that we’re using log data to debug an application. The raw output from a log can look like this:

"level=debug msg=\"Not resuming any session\" log.target=rustls::client::hs log.module_path=rustls::client::hs log.file=/usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.8/src/client/hs.rs log.line=127 target=\"log\" time=1675710426464848718\n"

If we look closely, we can start to parse this data into key-value pairs that we can then use in our data model.

level=debug
log.target=rustls::client::hs
log.module_path=rustls::client::hs log.file=/usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.8/src/client/hs.rs
log.line=127
target=\”log\”
msg=”Not resuming any session”
time=1675710426464848718

At this point, we can start to make some decisions about which keys should be tags (metadata) and which are fields. Querying against tags enables developers to slice and dice data along almost any dimension. But the more tags that exist, the more resources it takes to run each query, which ultimately affects performance.

If we look at another log file, the problem starts to become clearer. Here we already parsed the log file as key-value pairs.

level=debug
msg=\”Processing request\”
request=\”Request { method: GET, uri: http://10.144.148.50:8080/metrics, version: HTTP/2.0, headers: {\\\”user-agent\\\”: \\\”Prometheus/2.38.0\\\”, \\\”accept\\\”: \\\”application/openmetrics-text;version=1.0.0,application/openmetrics-text;version=0.0.1;q=0.75,text/plain;version=0.0.4;q=0.5,*/*;q=0.1\\\”, \\\”accept-encoding\\\”: \\\”gzip\\\”, \\\”x-prometheus-scrape-timeout-seconds\\\”: \\\”10\\\”, \\\”x-forwarded-proto\\\”: \\\”http\\\”, \\\”x-request-id\\\”: \\\”001052e8-d898-4b4b-9e21-0b0a4918970a\\\”}, body: Body(Streaming) }\”
target=\”ioxd_common::http\”
location=\”ioxd_common/src/http/mod.rs:121\”
time=1675710425927921595

If we compare the two log files, we see four common tags: `level`, `msg`, `target` and `time`. There are also several unique tags: `log.target`, `log.module_path`, `log.file`, `log.line`, `request` and `location`. As a result, each log is a series because it contains a unique tag combination. When we consider how many individual logs exist when debugging an application, it’s easy to see how complicated querying that data becomes.

One contributing factor to this situation is a lack of naming consistency for attributes within an application. For example, if you’re debugging an application, each process may need different information, so naturally, the developers create attributes, which each become a key value, for that specific process. Expanding this practice across an entire application results in thousands of different keys because every process is doing something different.

To complicate matters even more, an attribute like “error” could have a tag key of `e`, `error`, `err`, `err_code` or any other descriptive permutation a developer can come up with. Sure, it’s possible in theory to clean and standardize an attribute like error, but that also creates a lot of work and requires you to know every permutation to ensure nothing slips through the cracks.

In short, logs not only generate a lot of data, but also generate a lot of unique data. That means the database likely needs to store the data differently than other types of time series data, and query patterns must account for the shape of log data.

Comparing Logs and Traces

Traces can create cardinality issues too. However, there are some key differences when we think about tracing.

The total number of keys from a trace tends to be more consistent. This is because there are a finite number of points within an application, and the output of those processes contains fewer programmer-defined elements. The result is more structured output. In other words, the tag keys are more likely to be the same, such as “`spanID“`, but their values are unbounded (for instance, trace and span IDs).

Unbounded tag values also contribute to higher cardinality. However, the key difference between traces and logs is that traces are more likely to have one unbounded element (tag values), while logs have two unbounded elements (tag keys and tag values). Metrics, by contrast, tend to have both bounded tag keys and tag values. Each of these combinations requires different approaches for storage and querying, which is why it’s such a challenge to use a single solution for all three data types.

Fortunately, there is hope on the horizon. InfluxDB has long handled metrics well, but with the release of its new database core, InfluxDB IOx, it can now manage high cardinality tracing data, in addition to metric and raw event data, in a single solution. Efforts to consolidate the three classes of time series applications into one continue as the team behind InfluxDB sets its sights on logs.

InfluxData is the creator of InfluxDB, the leading time series platform. More than 1,900 customers use InfluxDB to collect, store, and analyze all time series data at any scale. Developers can query and analyze their time-stamped data to predict, respond, and adapt in real-time.
Learn More
The latest from InfluxData
TRENDING STORIES
After spending many years as C/C++ systems programmer (databases and compilers), and a stint working on machine learning startups (as one does), Andrew Lamb now works at InfluxData with Paul Dix and a talented team of engineers on InfluxDB IOx,...
Read more from Andrew Lamb
InfluxData sponsored this post.
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Pragma.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
👁 Image
Join the millions of developers using InfluxDB to predict, respond, and adapt in real-time.