Skip to content

Commit

Permalink
chore(Splunk): expose orchestrator to Splunk (#5243)
Browse files Browse the repository at this point in the history
* expose orchestrator to splunk

* update test case

* fix format
  • Loading branch information
CCFenner authored Jan 21, 2025
1 parent 9069d81 commit cf368e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/splunk/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Details struct {
type MonitoringData struct {
PipelineUrlHash string `json:"PipelineUrlHash,omitempty"`
BuildUrlHash string `json:"BuildUrlHash,omitempty"`
Orchestrator string `json:"Orchestrator,omitempty"`
StageName string `json:"StageName,omitempty"`
StepName string `json:"StepName,omitempty"`
ExitCode string `json:"ExitCode,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions pkg/splunk/splunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func (s *Splunk) prepareTelemetry(telemetryData telemetry.Data) MonitoringData {
monitoringData := MonitoringData{
PipelineUrlHash: telemetryData.PipelineURLHash,
BuildUrlHash: telemetryData.BuildURLHash,
Orchestrator: telemetryData.Orchestrator,
StageName: telemetryData.StageName,
StepName: telemetryData.BaseData.StepName,
ExitCode: telemetryData.CustomData.ErrorCode,
Expand Down
5 changes: 4 additions & 1 deletion pkg/splunk/splunk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ func Test_prepareTelemetry(t *testing.T) {
{name: "Testing prepare telemetry information",
args: args{
telemetryData: telemetry.Data{
BaseData: telemetry.BaseData{},
BaseData: telemetry.BaseData{
Orchestrator: "Jenkins",
},
CustomData: telemetry.CustomData{
Duration: "1234",
ErrorCode: "0",
Expand All @@ -365,6 +367,7 @@ func Test_prepareTelemetry(t *testing.T) {
want: MonitoringData{
PipelineUrlHash: "",
BuildUrlHash: "",
Orchestrator: "Jenkins",
StageName: "",
StepName: "",
ExitCode: "0",
Expand Down

0 comments on commit cf368e6

Please sign in to comment.