Skip to content

Commit

Permalink
internal/telemetry: export Products field (DataDog#2500)
Browse files Browse the repository at this point in the history
  • Loading branch information
katiehockman authored Jan 11, 2024
1 parent 8de8527 commit 7d7770f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions ddtrace/opentelemetry/span_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ func waitForPayload(ctx context.Context, payloads chan string) (string, error) {
}

func TestSpanResourceNameDefault(t *testing.T) {
t.Skip("Currently broken on CI, but passes locally. Tracking issue: https://github.com/DataDog/dd-trace-go/issues/2499")

assert := assert.New(t)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
Expand Down
2 changes: 1 addition & 1 deletion internal/telemetry/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func BoolConfig(key string, val bool) Configuration {

// ProductsPayload is the top-level key for the app-product-change payload.
type ProductsPayload struct {
Products `json:"products"`
Products Products `json:"products"`
}

// Products specifies information about available products.
Expand Down
4 changes: 2 additions & 2 deletions internal/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func (c *client) productChange(namespace Namespace, enabled bool) {
products := new(ProductsPayload)
switch namespace {
case NamespaceAppSec:
products.AppSec = ProductDetails{Enabled: enabled}
products.Products.AppSec = ProductDetails{Enabled: enabled}
case NamespaceProfilers:
products.Profiler = ProductDetails{Enabled: enabled}
products.Products.Profiler = ProductDetails{Enabled: enabled}
case NamespaceTracers:
// Nothing to do
default:
Expand Down
2 changes: 1 addition & 1 deletion internal/telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestProductEnabled(t *testing.T) {

assert.Equal(t, RequestTypeAppProductChange, body.RequestType)
var productsPayload = body.Payload.(*ProductsPayload)
assert.True(t, productsPayload.Profiler.Enabled)
assert.True(t, productsPayload.Products.Profiler.Enabled)
}

func TestConfigChange(t *testing.T) {
Expand Down

0 comments on commit 7d7770f

Please sign in to comment.