Investor sentiment has deteriorated throughout the year, as persistent inflation and rapidly rising interest rates have called the economy's strength into question. During that time, Roku (ROKU -1.60%) and Datadog (DDOG -1.32%) have seen their share prices slip 84% and 58%, respectively. Both stocks currently sit near a 52-week low.

Some Wall Street analysts see that as a buying opportunity. For instance, Jason Bazinet of Citigroup has a price target of $125 per share on Roku, implying 164% upside from its 52-week low of $47.27. And Fatima Boolani of Citigroup has a price target of $170 per share on Datadog, which implies 125% upside from its 52-week low of $75.53.

Investors should never put too much faith in near-term price targets, but they can be useful for spotting overlooked opportunities. In this case, the market is consumed by economic uncertainty, so much so that many investors fail to see the long-term potential Roku and Datadog possess.

Here's why both stocks are worth buying today.

1. Roku: The top streaming platform

It's no surprise that the economic downturn was hard on Roku. The business is built around digital advertising, and many brands cut their ad budgets to compensate for weakening consumer demand brought on by persistent inflation. That domino effect led Roku to deliver some disappointing financial results. Over the past year, revenue rose just 31% to $3 billion -- a big deceleration from 72% growth in the prior year -- and cash from operations plunged 66% to $73 million.

However, the long-term investment thesis is unchanged. In the U.S. alone, connected TV (CTV) ad spend is expected to grow at 20% annually to reach $39 billion by 2026, according to eMarketer, and analysts at BMO Capital Markets say that figure could hit $100 billion by 2030. That puts Roku in front of a big addressable market, and it's well-positioned to cash in on that opportunity.

Roku was a pioneer in the streaming industry. It brought the first streaming player to market in 2008, featuring the only operating system (Roku OS) designed specifically for TV. In fact, Roku OS is still the only operating system purpose-built for TV. Other streaming platforms rely on modified mobile operating systems, but that approach often creates problems for viewers.

Purpose-built software tends to be more user-friendly. For instance, Roku suffered fewer video start failures than any other streaming platform in the second quarter. It also tied for lowest buffering rate and ranked second in video start time.

As a result, the Roku brand carries weight with consumers. Its hardware products (streaming players, audio devices, smart TVs) have earned a reputation for quality and reliability, and that advantage has carried Roku to the top of the industry.

In fact, Roku accounted for 23.1% of global streaming devices in the second quarter, and it powered 30.5% of global streaming time. In both categories, Roku has nearly twice as much market share as the next closest competitor. That makes Roku a valuable partner to content publishers and advertisers.

The company also took steps to further differentiate its platform. The Roku Channel is an ad-supported service that features free movies, TV episodes, and live channels, and it has the makings of a powerful growth driver. As Roku engages more viewers and earns more advertising revenue, its ability to license and produce quality content for The Roku Channel improves, creating a virtuous cycle.

In fact, Roku saw signs of success with that endeavor. In the second quarter, The Roku Channel once again ranked among the top five channels on the platform in the U.S., due in part to Roku's growing library of original content.

On that note, Roku should benefit greatly as brands allocate more ad dollars to CTV in the coming years. And with shares trading at 2.4 times sales -- a bargain compared to the three-year average of 14.4 times sales -- this growth stock is worth buying today.

That said, Roku is best viewed as a long-term investment. There is no guarantee the stock will deliver triple-digit returns in the next year.

2. Datadog: A leader in monitoring software

Datadog is a monitoring and security software company. Its robust product suite provides real-time observability across applications, networks, and infrastructure, allowing customers to ensure the performance and security of their IT ecosystems.

The Datadog platform also incorporates a powerful artificial intelligence (AI) engine known as Watchdog. That engine can help customers prevent problems by surfacing proactive insights, and it can reduce time to resolution through automated alerts and root cause analysis.

Additionally, Datadog offers more than 500 out-of-the-box integrations to simplify adoption and accelerate time to value for customers. Its platform is designed to be cloud agnostic, meaning it can be deployed across enterprise data centers, private clouds, and public clouds. Those qualities powered rapid adoption.

Datadog increased its customer base by 29% over the past year, and the average customer spent over 30% more. That compounding effect naturally led to remarkable financial results. Revenue soared 79% to $1.4 billion. The company generated $354 million in free cash flow (FCF), attaining an impressive FCF margin of nearly 26%.

Investors have good reason to believe Datadog can maintain that momentum. Management puts its addressable market at $53 billion in 2025, and the company already enjoys a strong market position across several monitoring software verticals.

For instance, research company Gartner recently ranked Datadog as a leader in application performance monitoring, and G2 Grid recently recognized Datadog as a leader in cloud infrastructure monitoring and log monitoring. Those accolades hint at a bright future for the company, and its monitoring software will only become more critical as businesses continue to invest in digital transformation projects.

Currently, shares trade at 19.2 times sales, an absolute bargain compared to the three-year average of 38.6 times sales. That's why this growth stock is worth buying right now, though investors should look at Datadog as a long-term investment. Triple-digit returns in the next year may be too optimistic.