-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1369 from DataDog/rodrigo.roca/refactor-trace-com…
…mand [ci-visibility] Trace command: add support for Github, Gitlab, Azure, AWS and Buildkite
- Loading branch information
Showing
6 changed files
with
263 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
import type {AxiosPromise, AxiosResponse} from 'axios' | ||
|
||
export const CIRCLECI = 'circleci' | ||
export const JENKINS = 'jenkins' | ||
import {CI_ENGINES} from '../../helpers/ci' | ||
|
||
export const SUPPORTED_PROVIDERS = [CIRCLECI, JENKINS] as const | ||
export const SUPPORTED_PROVIDERS = [ | ||
CI_ENGINES.GITHUB, | ||
CI_ENGINES.GITLAB, | ||
CI_ENGINES.JENKINS, | ||
CI_ENGINES.CIRCLECI, | ||
CI_ENGINES.AWSCODEPIPELINE, | ||
CI_ENGINES.AZURE, | ||
CI_ENGINES.BUILDKITE, | ||
] as const | ||
export type Provider = typeof SUPPORTED_PROVIDERS[number] | ||
|
||
export interface Payload { | ||
ci_provider: string | ||
span_id: string | ||
command: string | ||
custom: { | ||
id: string | ||
parent_id?: string | ||
} | ||
// Data is a map of CI-provider-specific environment variables | ||
data: Record<string, string> | ||
name: string | ||
start_time: string | ||
end_time: string | ||
error_message: string | ||
exit_code: number | ||
is_error: boolean | ||
measures: Partial<Record<string, number>> | ||
name: string | ||
start_time: string | ||
tags: Partial<Record<string, string>> | ||
measures: Partial<Record<string, number>> | ||
} | ||
|
||
export interface APIHelper { | ||
reportCustomSpan(customSpan: Payload, provider: Provider): AxiosPromise<AxiosResponse> | ||
reportCustomSpan(customSpan: Payload): AxiosPromise<AxiosResponse> | ||
} |
Oops, something went wrong.