mirror of
https://github.com/actions/runner.git
synced 2025-12-20 06:29:53 +00:00
Publish job telemetry to run-service. (#3545)
* Publish job telemetry to run-service. * .
This commit is contained in:
@@ -27,6 +27,9 @@ namespace GitHub.Actions.RunService.WebApi
|
||||
[DataMember(Name = "annotations", EmitDefaultValue = false)]
|
||||
public IList<Annotation> Annotations { get; set; }
|
||||
|
||||
[DataMember(Name = "telemetry", EmitDefaultValue = false)]
|
||||
public IList<Telemetry> Telemetry { get; set; }
|
||||
|
||||
[DataMember(Name = "environmentUrl", EmitDefaultValue = false)]
|
||||
public string EnvironmentUrl { get; set; }
|
||||
}
|
||||
|
||||
20
src/Sdk/RSWebApi/Contracts/Telemetry.cs
Normal file
20
src/Sdk/RSWebApi/Contracts/Telemetry.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Sdk.RSWebApi.Contracts
|
||||
{
|
||||
[DataContract]
|
||||
public struct Telemetry
|
||||
{
|
||||
public Telemetry(string message, string type)
|
||||
{
|
||||
Message = message;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
[DataMember(Name = "message", EmitDefaultValue = false)]
|
||||
public string Message { get; set; }
|
||||
|
||||
[DataMember(Name = "type", EmitDefaultValue = false)]
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
@@ -126,6 +127,7 @@ namespace GitHub.Actions.RunService.WebApi
|
||||
IList<StepResult> stepResults,
|
||||
IList<Annotation> jobAnnotations,
|
||||
string environmentUrl,
|
||||
IList<Telemetry> telemetry,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
HttpMethod httpMethod = new HttpMethod("POST");
|
||||
@@ -138,6 +140,7 @@ namespace GitHub.Actions.RunService.WebApi
|
||||
StepResults = stepResults,
|
||||
Annotations = jobAnnotations,
|
||||
EnvironmentUrl = environmentUrl,
|
||||
Telemetry = telemetry,
|
||||
};
|
||||
|
||||
requestUri = new Uri(requestUri, "completejob");
|
||||
|
||||
Reference in New Issue
Block a user