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:
The master and external transaction are both visible:
On the external service, the transaction is also visible:
Service Map
Code
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);