Costco (COST -0.55%) has a track record many investors would appreciate. The company has increased revenue, profit, and return on invested capital over time. And Costco stock has well surpassed the performance of the S&P 500 Index. For instance, Costco has climbed nearly 200% over the past five years, while the S&P 500 increased 48%.

In spite of difficult economic times, Costco continues to report strong earnings. Net sales for the fiscal year ended Aug. 28 climbed in the double digits. And net income reached more than $5.8 billion. Can this strength continue? Let's check out one green flag for Costco -- and one red flag.

The green flag: Membership growth

To shop at Costco, you have to pay an annual membership fee. The basic fee is $60. For double that, you get an executive membership and various benefits that go along with it. The great news for Costco is that membership keeps on growing.

Excluding the effect of foreign currencies, membership fee income in the fiscal fourth quarter rose 10%. And renewal rates reached record highs. The renewal rate for the U.S. and Canada hit 92.6%, and the worldwide renewal rate surpassed 90%.

This is important because it shows people don't just join Costco for a brief time. They see value in the membership and keep coming back. That's a great sign for future revenue.

Importantly, executive memberships are also climbing. They increased by 1.2 million from the third quarter to the fourth quarter to total more than 29 million. Growth here is key because these types of members account for more than 70% of Costco's sales worldwide.

So, by looking at the trends in membership, it's clear Costco has many more bright days on the horizon.

The red flag: Rising inflation

Costco has managed today's environment of rising inflation well. The company, as mentioned above, reported growth in earnings in the most recent quarter and the full fiscal year. And Costco even said it's starting to see some improvement.

Still, Costco said higher commodities prices and higher wages as well as supply chain problems continue to be around. In fact, in the fourth quarter, price inflation was 8%. That's compared to 7% in the previous quarter.

But, as Costco said, even if the situation seems to be evolving in a positive way, the troubles aren't over. The pricing environment changes from week to week.

It's also important to keep in mind that Costco customers face higher inflation too. So, they may cut back spending on certain items. That could weigh on the retailer in the near term.

The key words here are "near term." Inflation is a major challenge today. But this situation is temporary. It may not hurt Costco over the long term.

Costco must manage today's inflationary pressures properly to maintain its financial health once the situation improves. So far, the company's earnings show it's up to the task.

Which flag to follow?

I don't have to hesitate here. That's because I always take a long-term view. And that means I'll go with the green flag. Costco's membership numbers are climbing -- even during today's troubled times. The company has a solid earnings track record, and this earnings strength continues.

Rising inflation may weigh on earnings. But I don't expect this to be a lasting problem.

As for Costco's share price, it hasn't reflected the company's resilience. The stock is down 13% so far this year. That leaves Costco trading at about 33 times forward earnings estimates -- down from more than 45 a few months ago.

Once today's economic environment improves, Costco could make its way back to that higher valuation -- and beyond. And that may result in big gains for those who hold onto this retail giant for the long haul.