Artificial intelligence (AI) sale across hardware, software, and services totaled about $196 billion last year, according to Grand View Research. But analysts expect that figure to surge 820% by 2030, such that annual AI spending exceeds $1.8 trillion at the end of the decade. Investors hoping to benefit should be positioning their portfolios today, and they should be diversifying beyond Nvidia.

With that in mind, Alphabet (GOOGL 1.27%) (GOOG 1.13%) and Datadog (DDOG 1.47%) stand out as worthwhile long-term investments. The companies have strong footholds in relevant markets, and the stocks trade reasonable valuations compared to future growth prospects.

Here's what you should know.

1. Alphabet

Alphabet reported first-quarter financial results that beat expectations on the top and bottom lines. Revenue rose 15% to $80.5 billion on especially strong momentum in Google Cloud, the segment comprising cloud infrastructure and platform services, as well as the Google Workspace applications. Meanwhile, GAAP net income soared 61% to $1.89 per diluted share because of disciplined cost control, something management continues to prioritize.

The investment thesis for Alphabet is simple. Its Google subsidiary has a strong presence in two growing markets, digital advertising and cloud computing, and the company is using its artificial intelligence (AI) expertise to create new monetization opportunities within those markets.

To elaborate, Google is the largest digital advertiser in the world. Its market share is declining because of competition from Amazon and others ad tech companies. However, Google is still expected to account for 27% of digital ad spending next year, and it could recapture lost market share with help from artificial intelligence. For instance, Google is using generative AI to improve the search experience for internet users and streamline the creation of advertising campaigns for media buyers. Management says the initial feedback is positive.

Meanwhile, Google Cloud Platform is the third-largest cloud services provider. Here, the company has gained 3 points of market share over the last four years, such that it accounted for 11% of cloud infrastructure and platform services revenue in the fourth quarter. Investments in AI product development (like Gemini) could help the company maintain that momentum. CEO Sundar Pichai hinted at that during the latest earnings call, noting that 90% of generative AI unicorns are Google Cloud customers.

Going forward, the online advertising and cloud computing markets are forecasted to expand at annual rates of 16% and 14%, respectively, through 2030. Wall Street expects Alphabet to grow sales at 10.5% annually over the next five years, but I think the company could surprise analysts to the upside given the secular tailwinds behind its business. In that context, its current valuation of 7 times sales appears reasonable.

2. Datadog

Datadog reported fourth-quarter results that beat what Wall Street expected. Revenue rose 26% to $590 million and non-GAAP net income more than doubled to reach $0.44 per diluted share. But the stock still slipped following the report because of a disappointing outlook. Specifically, management estimated that non-GAAP earnings would increase 21% in the first quarter, but Wall Street expected 39% growth. Even so, the investment thesis remains intact.

Datadog sells observability and security software that helps businesses monitor the performance of IT infrastructure and applications. Its platform incorporates artificial intelligence to hasten problem resolution, and it integrates 19 products to support vendor consolidation. In other words, businesses need not deploy point products from different vendors; they can choose the more efficient path of getting their observability software through one platform.

Datadog's platform strategy and product innovation have won praise from analysts. The company has been recognized as a leader in several observability software verticals, including application performance monitoring and AI for IT operations. It also has a strong position in the server monitoring, cloud infrastructure monitoring, and database monitoring markets. Finally, Datadog ranked second on the 2023 Fortune Future 50 list, an annual report that scores the largest companies in the world based on long-term growth prospects.

Going forward, demand for observability software should increase as IT environments become more complex. That means technology shifts like cloud computing and artificial intelligence should be major tailwinds for Datadog. Indeed, the company said adoption of AI integrations jumped 75% sequentially in the fourth quarter, meaning customers are rapidly deploying Datadog software to monitor large language models and generative AI applications.

Last year, Alex Zukin of Wolfe Research said the rise of generative AI could make Datadog "the fastest growing software company," and Sanjit Singh at Morgan Stanley selected Datadog as one of the software companies best positioned to monetize generative AI. As for the rest of Wall Street, analysts expect Datadog to grow sales at 25% annually over the next five years. That consensus estimate makes its current valuation of 21.6 times sales look reasonable. Patient investors should feel confident in buying a small position in this growth stock today.