public async Task <IActionResult> Data() { var client = new HttpClient(); using (var request = new HttpRequestMessage(HttpMethod.Get, _configuration.GetValue <System.String>("secondUrl"))) { using (var activity = new ActivitySource("NETCONF2020.MyApplication").StartActivity("MyCustomActivity")) { activity?.SetTag("customKey", "customValue"); activity?.SetTag("customInteger", 42); } var response = await client.SendAsync(request); return(Content(await response.Content.ReadAsStringAsync())); } }