Skip to content

Commit

Permalink
fixing lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramadon committed Dec 4, 2024
1 parent b14a43c commit 14528bd
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 91 deletions.
2 changes: 1 addition & 1 deletion extension/agenthealth/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestExtension(t *testing.T) {
assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost()))
requestHandlers, responseHandlers := extension.Handlers()
// user agent, client stats, stats
assert.Len(t, requestHandlers, 3)
assert.Len(t, requestHandlers, 2)
// client stats
assert.Len(t, responseHandlers, 1)
cfg.IsUsageDataEnabled = false
Expand Down
2 changes: 1 addition & 1 deletion extension/agenthealth/handler/stats/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
)

type Stats struct {
CpuPercent *float64 `json:"cpu,omitempty"`
CPUPercent *float64 `json:"cpu,omitempty"`
MemoryBytes *uint64 `json:"mem,omitempty"`
FileDescriptorCount *int32 `json:"fd,omitempty"`
ThreadCount *int32 `json:"th,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion extension/agenthealth/handler/stats/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo
statusCodeHandler := provider.NewStatusCodeHandler(statusCodeFilter)

if statusCodeEnabled {
requestHandlers = append(requestHandlers, statusCodeHandler)
responseHandlers = append(responseHandlers, statusCodeHandler)
statsProviders = append(statsProviders, provider.GetStatsProvider())
}
Expand Down
5 changes: 1 addition & 4 deletions extension/agenthealth/handler/stats/provider/statuscode.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ func NewStatusCodeHandler(filter agent.OperationsFilter) *StatusCodeHandler {
return handler
}

// HandleRequest is a no-op for the StatusCodeHandler.
func (h *StatusCodeHandler) HandleRequest(ctx context.Context, _ *http.Request) {}

// HandleResponse processes the HTTP response to update status code stats.
func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) {
operation := awsmiddleware.GetOperationName(ctx)
Expand Down Expand Up @@ -99,7 +96,7 @@ func GetStatsProvider() agent.StatsProvider {
}

// Stats returns the current statistics for a given operation.
func (p *SingletonStatsProvider) Stats(operation string) agent.Stats {
func (p *SingletonStatsProvider) Stats(_ string) agent.Stats {
p.mu.Lock()
defer p.mu.Unlock()

Expand Down
44 changes: 22 additions & 22 deletions internal/tls/testdata/server.crt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
-----BEGIN CERTIFICATE-----
MIIEGDCCAgCgAwIBAgIQXfs/Q5GFuLc7NUTyz//9iTANBgkqhkiG9w0BAQsFADAS
MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIwNDA4MDEwM1oXDTI0MTIwNDA5MDEw
M1owFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBALOxmj9qUrnzbNku4gJOe5sBI0UKhhtMXsKL3UlwBHP9MLrwj0vB
qYmNrrBxD5ROApBCGn0nhRu64R0fZfWdyt/fPMRMWAeg/XGg93g2MsiusBte1MeH
aqtxuHLy2qIGGO0GFslLGWVgg4MffIySwzr/ThsNSig/xo6yl8c7nUSdc/Ln1Lhb
8hZXO8FGL+pzGhJ6OG+QJGugbq9eD2vfyGlLCpCbmDmCqoeHAySveiMbt9U2CZZq
yKTBNth9//1dLcHVs5T7Hdupg02M/kd42kPgYk3oQfd0q94NAi0q07zXZQxaDQQu
3BRYG3XlPbzPk8A2nRE2xpuAoghkoHxWxDkCAwEAAaNnMGUwDgYDVR0PAQH/BAQD
AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgw
FoAUTnL74edc4aTk4B25twKhJJH5eTUwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG
9w0BAQsFAAOCAgEAv59o9jRL3czcK4Vt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 additions & 26 deletions internal/tls/testdata/server.key
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCzsZo/alK582zZ
LuICTnubASNFCoYbTF7Ci91JcARz/TC68I9LwamJja6wcQ+UTgKQQhp9J4UbuuEd
H2X1ncrf3zzETFgHoP1xoPd4NjLIrrAbXtTHh2qrcbhy8tqiBhjtBhbJSxllYIOD
H3yMksM6/04bDUooP8aOspfHO51EnXPy59S4W/IWVzvBRi/qcxoSejhvkCRroG6v
Xg9r38hpSwqQm5g5gqqHhwMkr3ojG7fVNgmWasikwTbYff/9XS3B1bOU+x3bqYNN
jP5HeNpD4GJN6EH3dKveDQItKtO812UMWg0ELtwUWBt15T28z5PANp0RNsabgKII
ZKB8VsQ5AgMBAAECggEAaanQwuN5e8CpS9hmq+aMhmwX2jxC+YBh5FIsMEe/Rpkm
c3aLPIfHcowuobAJ8jIhDcThIKEBg3nTb7WL1e8QYa46ZE9kIDBJd+yoODbei+U0
xxNvWVjGn8PCK02kxEuDkrTW50zSxSsIii0UpvCR/nor6npZFevSjQx1dYEXjEVx
sGmGVWPhpWUJquE5D9xe9cBuVO2PAsQpr61p+OwAL61qUbHl8gdGfbg/FMoNLrwD
XWbL+JCmpRfcMwFlMaWdu4bx6PQlL8M+wH7avN96R1WxqRNP3JhwmgJeuBjIlMPQ
Kj8AasIEaSjicGzoK51jP5FPke+XxUpL50wPJr0JRQKBgQDWXe+MpyEDnkcm/X1/
hgHOlrmmVSlu1qJD8kNbUl3SmbP3fMUPbW42yVBcEgYw2m1aVstXRA5TzVVioEpV
RxRSwaZln7JGDeg1o8F2fCI6y6cvpwzQeWN33Gd+Aq/GC/51ixi4AMQ+hhJ4XZM+
v3sE/r9gCRmD01yQgQr0nh2yYwKBgQDWl8IrarCJ0c+3jRzxMaXGhgvVwLIAR65L
qYv36lsmuaasF0H5NAwogu7zJCoj2942vh14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9l++yGVKMyfXqNLQyyJfMJ
PvVLZb56t51Z0E+XzO0sLactIUg7iJWE1RPn7ryK1aqQqcUpimCE7t1AsNFfy5w6
WwX9RR4xhXJcL6yO77D58w==
-----END PRIVATE KEY-----
50 changes: 25 additions & 25 deletions internal/tls/testdata/tls-ca.crt
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290
IENBMB4XDTI0MTIwNDA4MDEwN1oXDTM0MTIwNDA4MDEwN1owEjEQMA4GA1UEChMH
Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALrAg9X/yUUr
rKkjf6tYVJTgrIBJiOjy+CkwyaewzuUrQQxHE2ZnDHAI56ChGBAuJfOCLDIjO90d
+0YjhdM8IctiuARtxRbGOOtfgsep6k2q6RobROMUgMfTWyh2s/uYF6/SVghgi3ev
VKQosTizWVeCrT3AtV9e2ESoHKI8pdLi5OYEZXiYdLffyscd2ig/v2gCnJgLiyn4
SCg+ho9or8fpMDzaXFMFEiVVqUXUDLJXuJDONNj3UgB3ZOq4e67bHOaJ71ct6hDA
6O3AhpF1OvtN8zjLbMm0vpmn+P9p7VzzvWQT+LDmL6ppi4GF1VqUOHfmwcbmvrwq
xfscLF7AG6B4vyVCngDjztNRLFtWDs9IUK7NcVgrrHrsZHTTHXZaCS27ggp5c4Ea
1rZsuZ/o1htt0u9Mb5YuUi4b8v40vvbAkq4k12vqCXQN9A9nLygWwibrAMrXUZaM
3bCCYH9O+pOtVsgjO3twFYp5li6r5Nswalt475LijRBTlzIAuygLWskI2q/iFiDc
j/EC2bd4sUL2b1ugJkvZcHXsPLqSNzw1HpTIoZAjFsU8Dzkxyt12qTGDir2TLpHv
UiJdcLKPSm3QRT1Y2mr/fNxzX7m3yMWcAzXt2gMreaO9gqTrWdrhSKg3XEBlwqYr
jdUpseNUn0urtXOf7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kBYAVIt3BIhgGxBoteyxnIcpsJT2bID0/JdVpUilrPAAS5p/8EFWCNd
ubzXn02Zo1ROwrSZkI9kYH6/KAitkcWS92mwmrhbnBJD8+oxOWqIFjEJIi8JqpHn
qpnLwJVbZlU/TwPChwa3D1+5GxUTUFS8ZNIR1gji2RtxW2YkdsGFqEIhx0OHOFlZ
vNx3JG47MEoCfWqID+T3kl0dU3E77ky6G5iVtAJ9Rg5x4Wfd3o/eus/++Rvk2rA/
n2OwLW67dIPTfXyxgv+cnMZ/KqhY0Nnd2Pg=
-----END CERTIFICATE-----
22 changes: 11 additions & 11 deletions translator/translate/otel/extension/agenthealth/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ var (
)

type translator struct {
name string
operations []string
isUsageDataEnabled bool
factory extension.Factory
statuscodeonly bool
name string
operations []string
isUsageDataEnabled bool
factory extension.Factory
isStatusCodeEnabled bool
}

var _ common.Translator[component.Config] = (*translator)(nil)

func NewTranslatorWithStatusCode(name component.DataType, operations []string, statuscodeonly bool) common.Translator[component.Config] {
return &translator{
name: name.String(),
operations: operations,
factory: agenthealth.NewFactory(),
isUsageDataEnabled: envconfig.IsUsageDataEnabled(),
statuscodeonly: statuscodeonly,
name: name.String(),
operations: operations,
factory: agenthealth.NewFactory(),
isUsageDataEnabled: envconfig.IsUsageDataEnabled(),
isStatusCodeEnabled: statuscodeonly,
}
}

Expand All @@ -70,7 +70,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) {
if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok {
cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData
}
cfg.IsStatusCodeEnabled = t.statuscodeonly
cfg.IsStatusCodeEnabled = t.isStatusCodeEnabled
cfg.Stats = &agent.StatsConfig{
Operations: t.operations,
UsageFlags: map[agent.Flag]any{
Expand Down

0 comments on commit 14528bd

Please sign in to comment.