Skip to content

Commit

Permalink
fix minor linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Oct 4, 2024
1 parent 320605d commit 0f63b8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions comp/core/agenttelemetry/impl/agenttelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ type atel struct {
cancel context.CancelFunc
}

// Provides defines the output of the agenttelemetry component
type Provides struct {
compdef.Out

Comp agenttelemetry.Component
Endpoint api.AgentEndpointProvider
}

// Requires declares the input types to the constructor
type Requires struct {
compdef.In

Expand Down Expand Up @@ -135,6 +137,7 @@ func createAtel(
}
}

// NewComponent creates a new agent telemetry component.
func NewComponent(deps Requires) Provides {
a := createAtel(
deps.Config,
Expand Down
5 changes: 5 additions & 0 deletions comp/core/agenttelemetry/impl/agenttelemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ func TestTwoProfilesOnTheSameScheduleGenerateSinglePayload(t *testing.T) {

// Single payload whcich has sub-payloads for each metric
requestType, ok := payload["request_type"]
assert.True(t, ok)
assert.Equal(t, "agent-metrics", requestType)
metricsPayload, ok := payload["payload"].(map[string]interface{})
assert.True(t, ok)
Expand Down Expand Up @@ -600,6 +601,7 @@ func TestOneProfileWithOneMetricMultipleContextsGenerateTwoPayloads(t *testing.T

// One payloads each has the same metric (different tags)
requestType, ok := payload["request_type"]
assert.True(t, ok)
assert.Equal(t, "message-batch", requestType)
metricPayloads, ok := payload["payload"].([]interface{})
assert.True(t, ok)
Expand All @@ -608,6 +610,7 @@ func TestOneProfileWithOneMetricMultipleContextsGenerateTwoPayloads(t *testing.T
// 2 metrics
// 1-st
payload1, ok := metricPayloads[0].(map[string]interface{})
assert.True(t, ok)
requestType1, ok := payload1["request_type"]
assert.True(t, ok)
assert.Equal(t, "agent-metrics", requestType1)
Expand All @@ -621,6 +624,7 @@ func TestOneProfileWithOneMetricMultipleContextsGenerateTwoPayloads(t *testing.T

// 2-nd
payload2, ok := metricPayloads[1].(map[string]interface{})
assert.True(t, ok)
requestType2, ok := payload2["request_type"]
assert.True(t, ok)
assert.Equal(t, "agent-metrics", requestType2)
Expand Down Expand Up @@ -672,6 +676,7 @@ func TestOneProfileWithTwoMetricGenerateSinglePayloads(t *testing.T) {

// Single payload whcich has sub-payloads for each metric
requestType, ok := payload["request_type"]
assert.True(t, ok)
assert.Equal(t, "agent-metrics", requestType)
metricsPayload, ok := payload["payload"].(map[string]interface{})
assert.True(t, ok)
Expand Down

0 comments on commit 0f63b8a

Please sign in to comment.