Is my understanding of transactions and spans off?

I'm trying to figure out how to use APM. Specifically in my PHP application. It's Symfony 6, so no automatic instrumentation. I'm also new to any kind of APM at all. I've done a bit of reading on the subject, but not enough to really know anything.

If I'm reading the API docs correctly, I think you basically break down your application into transactions, and then use spans to break up each transaction into sub-pieces. Right? So one "task" would be a transaction, and then each piece of business logic in that task would be span? Or you could have a transaction for a request, and each method called during that request could be a span. Is that at all how it is supposed to work?

(FYI, I have data being sent to ES and visible in Kibana->Observability->APM->Services. So I'm not going into how I installed the extension.)

Here's pretty much what I've been doing:

Say you have a script that gets called via the command line and it looks something like:

cli.php:

<php
// load config
$connection = new FooCon($user,$host,$pass);
$data = $connection->loadData();
$processor = new BarDataProcessor();
$processor->process($data);

Now, to start gathering APM data, I'd add:

$transaction = ElasticApm::beginCurrentTransaction(
      'cli_php',
      'cli_method'
    );

To the start of cli.php.

And:

$transaction->end();

To the end of cli.php.

That part seems to work. I can see the 'cli_php' transaction in Kibana. But when I try to add spans into the mix, it does not work the way I think it should.

So, I think that what I want to do is add spans in the FooCon and BarDataProcessor classes. Then we could have a nice graph of which spans are taking up the most time per transaction.

To do that, inside of the classes, at the start of each method, I added:

$transaction = ElasticApm::getCurrentTransaction();
$span = $transaction->beginChildSpan('method_key', 'method_type'); 
// I also tried a unique type per span as well, basically duplicating the method_key value.

(getCurrentTransaction() should grab the transaction I started in cli.php, right?)

And $span->end() right before every return and/or the end of the method.

But I never saw the Time spent by span type graph get broken up based on either of the first 2 parameters in beginChildSpan(). And I can't find any graph based on just the 'span_name' parameter either.

What I've ended up doing is creating a new transaction for every span. The does help get me the data I need, but seems like it isn't how it is supposed to work...

So, what am I missing?

I'm running ELK 8.13.4. apm-agent-php 1.13.0.

Thanks in advance!