Skip to content
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

Migrate from OpenTracing to OpenTelemetry #1548

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions agent/pipeline_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"strings"

"github.com/buildkite/agent/v3/env"
"github.com/buildkite/agent/v3/tracetools"
"github.com/buildkite/agent/v3/yamltojson"
"github.com/buildkite/interpolate"

Expand Down Expand Up @@ -61,24 +60,6 @@ func (p PipelineParser) Parse() (*PipelineParserResult, error) {
return &PipelineParserResult{pipeline: pipeline}, nil
}

// Propagate distributed tracing context to the new pipelines if available
if tracing, has := p.Env.Get(tracetools.EnvVarTraceContextKey); has {
var envVars yaml.MapSlice
if envMap, has := mapSliceItem("env", pipeline); has {
envVars = envMap.Value.(yaml.MapSlice)
} else {
envVars = yaml.MapSlice{}
}
envVars = append(envVars, yaml.MapItem{
Key: tracetools.EnvVarTraceContextKey,
Value: tracing,
})
// Since the actual env vars MapSlice is nested under the top level MapSlice,
// updating the env vars doesn't actually update the pipeline. So we have to
// replace it.
pipeline = upsertSliceItem("env", pipeline, envVars)
}

// Preprocess any env that are defined in the top level block and place them into env for
// later interpolation into env blocks
if item, ok := mapSliceItem("env", pipeline); ok {
Expand Down
Loading