Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinyouzeng committed May 8, 2024
1 parent f41fad8 commit f776416
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Masa.Scheduler.Contracts.Server.Infrastructure.Utils;

public static class HttpUtils
{
private static ActivitySource _source = new ActivitySource("Masa.Scheduler.Background");
public static ActivitySource ActivitySource { get; private set; } = new ActivitySource("Masa.Scheduler.Background");

public static HttpMethod ConvertHttpMethod(HttpMethods methods)
{
Expand Down Expand Up @@ -36,7 +36,7 @@ public static void AddHttpHeader(HttpClient client, List<KeyValuePair<string, st

public static Activity? SetTraceParent(string? traceId, string? spanId)
{
return _source.StartActivity("Background Task", ActivityKind.Consumer, $"00-{traceId}-{spanId}-01");
return ActivitySource.StartActivity("Background Task", ActivityKind.Consumer, $"00-{traceId}-{spanId}-01");
}

public static Uri GetRequestUrl(string requestUrl, List<KeyValuePair<string, string>> httpParameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static IServiceCollection AddSchedulerObservable(this IServiceCollection
{
builder.SetResourceBuilder(resources);
builder.AddOtlpExporter(options => options.Endpoint = uri);
builder.AddSource("Masa.Scheduler.Background");
builder.AddSource(HttpUtils.ActivitySource.Name);
},
builder =>
{
Expand Down

0 comments on commit f776416

Please sign in to comment.