Open
Description
Library name and version
Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0"
Query/Question
Hi,
I have issue with the access token which is exposed in logs, for the SignalR related requests.
builder.Services.AddOpenTelemetry().UseAzureMonitor(options =>
{
options.ConnectionString = appInsightsConnectionString;
});
In application insights, I can see access_token under "request" and "traces" tables.
I tried to write Processer, but no luck with that
public class MaskingTelemetryProcessor : BaseProcessor<Activity>
{
public override void OnEnd(Activity data)
{
if (data.Kind == ActivityKind.Server)
{
var queryString = data.GetTagItem("url.query") as string;
if (!string.IsNullOrEmpty(queryString) && queryString.Contains("access_token"))
{
Console.WriteLine(queryString);
var queryParameters = System.Web.HttpUtility.ParseQueryString(queryString);
if (queryParameters["access_token"] != null)
{
queryParameters["access_token"] = "***";
data.SetTag("url.query", queryParameters.ToString());
}
}
}
base.OnEnd(data);
Please, help to understand how to filter out the access token.
Setting this to Warning doesn't help. Moreover, middleware is also not clear - as token is needed for SignalR to authenticate properly.
The thread was started in scope of SignalR, but was refused as "not related" to the SignalR's context.
Azure/azure-signalr#1770
Please advise. Thanks
Environment
net8
"Microsoft.AspNetCore.SignalR.Core" Version="1.2.0"
Metadata
Metadata
Assignees
Labels
This issue points to a problem in the data-plane of the library.Monitor OpenTelemetry DistroWorkflow: This issue is responsible by Azure service team.Issues that are reported by GitHub users external to the Azure organization.Workflow: This issue needs attention from Azure service team or SDK teamThe issue doesn't require a change to the product in order to be resolved. Most issues start as that