# Getting correct service map when using SetService

**URL:** <https://discuss.elastic.co/t/getting-correct-service-map-when-using-setservice/362655>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [July 7, 2024, 12:44pm UTC](https://discuss.elastic.co/t/getting-correct-service-map-when-using-setservice/362655 "2024-07-07T12:44:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monty241](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monty241/32/81681_2.png) [@monty241](https://discuss.elastic.co/u/monty241)\
**Post date:** [July 7, 2024, 12:44pm UTC](https://discuss.elastic.co/t/getting-correct-service-map-when-using-setservice/362655/1 "2024-07-07T12:44:50Z")

</div>

The method `SetService` is used to signal an external call to another service as in code below.

However, although the transactions nicely wrap in the calling service, the service map in Elastic 8.14.0 does not display the external service as visible in picture.

Is there some way to make the external service becoming visible in the service map?

## Transactions

Both services are identified nicely:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a9d8132ced6611b178537afdb6901e6cd450d69e.png)

The master and external transaction are both visible:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/0/80b17594a3fee2fb1be39e812d391083f8784cf7.png)

On the external service, the transaction is also visible:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/b/abf400e78b94debe1e4533b51ce1261748ad3721.png)

## Service Map

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/3/831f5a04bea028eb74fcf9e939e4b86f079e2aee.png)

## Code

```auto
            Configure();

            CancellationToken cancellationToken = CancellationToken.None;

            ITransaction? transaction = Elastic.Apm.Agent.Tracer.StartTransaction("Master Txn", ApiConstants.TypeUnknown, null);

            //
            // External transaction.
            //
            try
            {
                var dist = Elastic.Apm.Agent.Tracer.CurrentSpan?.OutgoingDistributedTracingData ?? transaction?.OutgoingDistributedTracingData;

                ITransaction? externalTransaction = Elastic.Apm.Agent.Tracer.StartTransaction("External Action", ApiConstants.TypeUnknown, dist);

                externalTransaction?.SetService("External System Called", "DEFAULT");

                try
                {
                    Thread.Sleep(2000);
                }
                finally
                {
                    externalTransaction?.End();
                }
            }
            finally
            {
                transaction?.End();
            }

            //
            // Time to send to Elastic server.
            //
            Thread.Sleep(5000);

```
