-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Kusto Tracing for self-hosted runner. #405
Conversation
if (credData != null && | ||
credData.Data.TryGetValue("clientId", out var clientId)) | ||
{ | ||
_userAgents.Add(new ProductInfoHeaderValue($"RunnerId", clientId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only self-hosted runner has the oauth app clientid
var additionalHeaders = new Dictionary<string, string>(); | ||
if (!string.IsNullOrEmpty(orchestrationId)) | ||
{ | ||
additionalHeaders["X-VSS-OrchestrationId"] = orchestrationId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this Header will make everything on the service for this request has the same orchestrationid (activitylog/producttrace)
{ | ||
var jwt = JsonWebToken.Create(accessToken); | ||
var claims = jwt.ExtractClaims(); | ||
orchestrationId = claims.FirstOrDefault(x => string.Equals(x.Type, "orchid", StringComparison.OrdinalIgnoreCase))?.Value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orchestrationid is part of the token's claims
d70fa9c
to
7fb3b57
Compare
7fb3b57
to
7d85f77
Compare
Adding following telemetry for self-hosted runner