-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: load built-in aspects from binary instead of resolving YAML (#517)
The built-in orchestrion aspects must be loaded from the running binary instead of being loaded from disk. This ensures the correct version of aspects is being used even if the running version is not the one declared in `go.mod` (which cannot always be the case anyway). In addition to this, `orchestrion pin` should upgrade `go.mod` to the running version of `orchestrion` if it's newer than what's already in there; and we default-install `dd-trace-go.v1@main` for now (pending the next release). This change also changes the `go` directive in the `go.mod` files to be pinned to the `.0` patch level of the current lowest supported go minor, instead of pinning it to the latest available one (which is unnessary and can be inconvenient to users).
- Loading branch information
1 parent
30ee622
commit 0f72b63
Showing
19 changed files
with
127 additions
and
153 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
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,6 +1,6 @@ | ||
module github.com/DataDog/orchestrion/_docs | ||
|
||
go 1.22.10 | ||
go 1.22.0 | ||
|
||
replace github.com/DataDog/orchestrion => .. | ||
|
||
|
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,6 +1,6 @@ | ||
module github.com/DataDog/orchestrion | ||
|
||
go 1.22.10 | ||
go 1.22.0 | ||
|
||
require ( | ||
github.com/charmbracelet/lipgloss v1.0.0 | ||
|
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2023-present Datadog, Inc. | ||
|
||
package config | ||
|
||
import ( | ||
"github.com/DataDog/orchestrion/internal/injector/aspect" | ||
"github.com/DataDog/orchestrion/internal/injector/aspect/advice" | ||
"github.com/DataDog/orchestrion/internal/injector/aspect/advice/code" | ||
"github.com/DataDog/orchestrion/internal/injector/aspect/context" | ||
"github.com/DataDog/orchestrion/internal/injector/aspect/join" | ||
) | ||
|
||
var builtIn = configGo{ | ||
pkgPath: "github.com/DataDog/orchestrion", | ||
yaml: &configYML{ | ||
aspects: []*aspect.Aspect{ | ||
{ | ||
ID: "built.WithOrchestrion", | ||
TracerInternal: true, // This is safe to apply in the tracer itself | ||
JoinPoint: join.AllOf( | ||
join.ValueDeclaration(join.MustTypeName("bool")), | ||
join.OneOf( | ||
join.DeclarationOf("github.com/DataDog/orchestrion/runtime/built", "WithOrchestrion"), | ||
join.Directive("dd:orchestrion-enabled"), | ||
), | ||
), | ||
Advice: []advice.Advice{ | ||
advice.AssignValue( | ||
code.MustTemplate("true", nil, context.GoLangVersion{}), | ||
), | ||
}, | ||
}, | ||
}, | ||
name: "<built-in>", | ||
meta: configYMLMeta{ | ||
name: "built.WithOrchestrion & //dd:orchestrion-enabled", | ||
description: "Flip a boolean to true if Orchestrion is enabled.", | ||
icon: "cog", | ||
caveats: "This aspect allows introducing conditional logic based on whether" + | ||
"Orchestrion has been used to instrument an application or not. This should" + | ||
"generally be avoided, but can be useful to ensure the application (or tests)" + | ||
"is running with instrumentation.", | ||
}, | ||
}, | ||
} |
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,5 +1,5 @@ | ||
pkgpath: github.com/DataDog/orchestrion | ||
yaml: | ||
name: orchestrion.yml | ||
name: <built-in> | ||
aspects: | ||
- Initialize to true | ||
- built.WithOrchestrion |
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
Oops, something went wrong.