From f3d2e3307ae8b2bc8c8c304922cedc63a4837295 Mon Sep 17 00:00:00 2001 From: Parampreet Singh <50599809+Paramadon@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:56:44 -0500 Subject: [PATCH 01/14] Adding Statuscode Handler to Agent Health Extension (#1423) --- .golangci.yml | 2 +- extension/agenthealth/config.go | 5 +- extension/agenthealth/config_test.go | 4 +- extension/agenthealth/extension.go | 29 +++- extension/agenthealth/extension_test.go | 23 ++- extension/agenthealth/factory.go | 6 +- extension/agenthealth/factory_test.go | 4 +- .../agenthealth/handler/stats/agent/agent.go | 120 ++++++++++--- .../handler/stats/agent/agent_test.go | 86 ++++++++- .../agenthealth/handler/stats/handler.go | 32 +++- .../agenthealth/handler/stats/handler_test.go | 30 +++- .../handler/stats/provider/process.go | 2 +- .../handler/stats/provider/process_test.go | 25 ++- .../handler/stats/provider/statuscode.go | 163 ++++++++++++++++++ .../handler/stats/provider/statuscode_test.go | 130 ++++++++++++++ .../outputs/cloudwatchlogs/cloudwatchlogs.go | 2 +- .../otel/extension/agenthealth/translator.go | 22 ++- .../extension/agenthealth/translator_test.go | 8 +- 18 files changed, 621 insertions(+), 72 deletions(-) create mode 100644 extension/agenthealth/handler/stats/provider/statuscode.go create mode 100644 extension/agenthealth/handler/stats/provider/statuscode_test.go diff --git a/.golangci.yml b/.golangci.yml index f4fbed2f51..88f10bb240 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -59,4 +59,4 @@ linters: - nonamedreturns issues: - new-from-rev: 3221f76 \ No newline at end of file + new-from-rev: 9af4477 \ No newline at end of file diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index dd1f94c06c..53c6901fff 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -10,8 +10,9 @@ import ( ) type Config struct { - IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` - Stats agent.StatsConfig `mapstructure:"stats"` + IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` + Stats *agent.StatsConfig `mapstructure:"stats,omitempty"` + IsStatusCodeEnabled bool `mapstructure:"is_status_code_enabled,omitempty"` } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/config_test.go b/extension/agenthealth/config_test.go index ee0ef301f6..967c681619 100644 --- a/extension/agenthealth/config_test.go +++ b/extension/agenthealth/config_test.go @@ -26,11 +26,11 @@ func TestLoadConfig(t *testing.T) { }, { id: component.NewIDWithName(TypeStr, "1"), - want: &Config{IsUsageDataEnabled: false, Stats: agent.StatsConfig{Operations: []string{agent.AllowAllOperations}}}, + want: &Config{IsUsageDataEnabled: false, Stats: nil}, }, { id: component.NewIDWithName(TypeStr, "2"), - want: &Config{IsUsageDataEnabled: true, Stats: agent.StatsConfig{Operations: []string{"ListBuckets"}}}, + want: &Config{IsUsageDataEnabled: true, Stats: &agent.StatsConfig{Operations: []string{"ListBuckets"}}}, }, } for _, testCase := range testCases { diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 14ab08eb57..213d252e91 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -9,6 +9,7 @@ import ( "go.uber.org/zap" "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/useragent" ) @@ -24,11 +25,31 @@ var _ awsmiddleware.Extension = (*agentHealth)(nil) func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { var responseHandlers []awsmiddleware.ResponseHandler requestHandlers := []awsmiddleware.RequestHandler{useragent.NewHandler(ah.cfg.IsUsageDataEnabled)} - if ah.cfg.IsUsageDataEnabled { - req, res := stats.NewHandlers(ah.logger, ah.cfg.Stats) - requestHandlers = append(requestHandlers, req...) - responseHandlers = append(responseHandlers, res...) + + if !ah.cfg.IsUsageDataEnabled { + ah.logger.Debug("Usage data is disabled, skipping stats handlers") + return requestHandlers, responseHandlers + } + + statusCodeEnabled := ah.cfg.IsStatusCodeEnabled + + var statsResponseHandlers []awsmiddleware.ResponseHandler + var statsRequestHandlers []awsmiddleware.RequestHandler + var statsConfig agent.StatsConfig + var agentStatsEnabled bool + + if ah.cfg.Stats != nil { + statsConfig = *ah.cfg.Stats + agentStatsEnabled = true + } else { + agentStatsEnabled = false } + + statsRequestHandlers, statsResponseHandlers = stats.NewHandlers(ah.logger, statsConfig, statusCodeEnabled, agentStatsEnabled) + + requestHandlers = append(requestHandlers, statsRequestHandlers...) + responseHandlers = append(responseHandlers, statsResponseHandlers...) + return requestHandlers, responseHandlers } diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 504dc8c50e..d29be58aac 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -10,11 +10,13 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/component/componenttest" "go.uber.org/zap" + + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) func TestExtension(t *testing.T) { ctx := context.Background() - cfg := &Config{IsUsageDataEnabled: true} + cfg := &Config{IsUsageDataEnabled: true, IsStatusCodeEnabled: true, Stats: &agent.StatsConfig{Operations: []string{"ListBuckets"}}} extension := NewAgentHealth(zap.NewNop(), cfg) assert.NotNil(t, extension) assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost())) @@ -22,6 +24,25 @@ func TestExtension(t *testing.T) { // user agent, client stats, stats assert.Len(t, requestHandlers, 3) // client stats + assert.Len(t, responseHandlers, 2) + cfg.IsUsageDataEnabled = false + requestHandlers, responseHandlers = extension.Handlers() + // user agent + assert.Len(t, requestHandlers, 1) + assert.Len(t, responseHandlers, 0) + assert.NoError(t, extension.Shutdown(ctx)) +} + +func TestExtensionStatusCodeOnly(t *testing.T) { + ctx := context.Background() + cfg := &Config{IsUsageDataEnabled: true, IsStatusCodeEnabled: true} + extension := NewAgentHealth(zap.NewNop(), cfg) + assert.NotNil(t, extension) + assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost())) + requestHandlers, responseHandlers := extension.Handlers() + // user agent, client stats, stats + assert.Len(t, requestHandlers, 1) + // client stats assert.Len(t, responseHandlers, 1) cfg.IsUsageDataEnabled = false requestHandlers, responseHandlers = extension.Handlers() diff --git a/extension/agenthealth/factory.go b/extension/agenthealth/factory.go index e8e97587a5..e075846c08 100644 --- a/extension/agenthealth/factory.go +++ b/extension/agenthealth/factory.go @@ -8,8 +8,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/extension" - - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) var ( @@ -28,9 +26,7 @@ func NewFactory() extension.Factory { func createDefaultConfig() component.Config { return &Config{ IsUsageDataEnabled: true, - Stats: agent.StatsConfig{ - Operations: []string{agent.AllowAllOperations}, - }, + Stats: nil, } } diff --git a/extension/agenthealth/factory_test.go b/extension/agenthealth/factory_test.go index 4899dfb425..a36a81f246 100644 --- a/extension/agenthealth/factory_test.go +++ b/extension/agenthealth/factory_test.go @@ -10,13 +10,11 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/extension/extensiontest" - - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) func TestCreateDefaultConfig(t *testing.T) { cfg := NewFactory().CreateDefaultConfig() - assert.Equal(t, &Config{IsUsageDataEnabled: true, Stats: agent.StatsConfig{Operations: []string{agent.AllowAllOperations}}}, cfg) + assert.Equal(t, &Config{IsUsageDataEnabled: true, Stats: nil}, cfg) assert.NoError(t, componenttest.CheckConfigStruct(cfg)) } diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 83237d54e6..d80303510d 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -15,28 +15,29 @@ const ( ) type Stats struct { - CpuPercent *float64 `json:"cpu,omitempty"` - MemoryBytes *uint64 `json:"mem,omitempty"` - FileDescriptorCount *int32 `json:"fd,omitempty"` - ThreadCount *int32 `json:"th,omitempty"` - LatencyMillis *int64 `json:"lat,omitempty"` - PayloadBytes *int `json:"load,omitempty"` - StatusCode *int `json:"code,omitempty"` - SharedConfigFallback *int `json:"scfb,omitempty"` - ImdsFallbackSucceed *int `json:"ifs,omitempty"` - AppSignals *int `json:"as,omitempty"` - EnhancedContainerInsights *int `json:"eci,omitempty"` - RunningInContainer *int `json:"ric,omitempty"` - RegionType *string `json:"rt,omitempty"` - Mode *string `json:"m,omitempty"` - EntityRejected *int `json:"ent,omitempty"` + CPUPercent *float64 `json:"cpu,omitempty"` + MemoryBytes *uint64 `json:"mem,omitempty"` + FileDescriptorCount *int32 `json:"fd,omitempty"` + ThreadCount *int32 `json:"th,omitempty"` + LatencyMillis *int64 `json:"lat,omitempty"` + PayloadBytes *int `json:"load,omitempty"` + StatusCode *int `json:"code,omitempty"` + SharedConfigFallback *int `json:"scfb,omitempty"` + ImdsFallbackSucceed *int `json:"ifs,omitempty"` + AppSignals *int `json:"as,omitempty"` + EnhancedContainerInsights *int `json:"eci,omitempty"` + RunningInContainer *int `json:"ric,omitempty"` + RegionType *string `json:"rt,omitempty"` + Mode *string `json:"m,omitempty"` + EntityRejected *int `json:"ent,omitempty"` + StatusCodes map[string][5]int `json:"codes,omitempty"` //represents status codes 200,400,408,413,429, } // Merge the other Stats into the current. If the field is not nil, // then it'll overwrite the existing one. func (s *Stats) Merge(other Stats) { - if other.CpuPercent != nil { - s.CpuPercent = other.CpuPercent + if other.CPUPercent != nil { + s.CPUPercent = other.CPUPercent } if other.MemoryBytes != nil { s.MemoryBytes = other.MemoryBytes @@ -80,6 +81,26 @@ func (s *Stats) Merge(other Stats) { if other.EntityRejected != nil { s.EntityRejected = other.EntityRejected } + if other.StatusCodes != nil { + if s.StatusCodes == nil { + s.StatusCodes = make(map[string][5]int) + } + + for key, value := range other.StatusCodes { + if existing, ok := s.StatusCodes[key]; ok { + s.StatusCodes[key] = [5]int{ + existing[0] + value[0], // 200 + existing[1] + value[1], // 400 + existing[2] + value[2], // 408 + existing[3] + value[3], // 413 + existing[4] + value[4], // 429 + } + } else { + s.StatusCodes[key] = value + } + } + } + } func (s *Stats) Marshal() (string, error) { @@ -104,6 +125,29 @@ func (of OperationsFilter) IsAllowed(operationName string) bool { return of.allowAll || of.operations.Contains(operationName) } +type StatsConfig struct { + // Operations are the allowed operation names to gather stats for. + Operations []string `mapstructure:"operations,omitempty"` + // UsageFlags are the usage flags to set on start up. + UsageFlags map[Flag]any `mapstructure:"usage_flags,omitempty"` +} + +var StatusCodeOperations = []string{ // all the operations that are allowed + "PutRetentionPolicy", + "DescribeInstances", + "DescribeTags", + "DescribeVolumes", + "DescribeContainerInstances", + "DescribeServices", + "DescribeTaskDefinition", + "ListServices", + "ListTasks", + "DescribeTasks", + "CreateLogGroup", + "CreateLogStream", + "AssumeRole", +} + func NewOperationsFilter(operations ...string) OperationsFilter { allowed := collections.NewSet[string](operations...) return OperationsFilter{ @@ -112,9 +156,41 @@ func NewOperationsFilter(operations ...string) OperationsFilter { } } -type StatsConfig struct { - // Operations are the allowed operation names to gather stats for. - Operations []string `mapstructure:"operations,omitempty"` - // UsageFlags are the usage flags to set on start up. - UsageFlags map[Flag]any `mapstructure:"usage_flags,omitempty"` +// NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. +func NewStatusCodeOperationsFilter() OperationsFilter { + return NewOperationsFilter(StatusCodeOperations...) +} + +// GetShortOperationName maps long operation names to short ones. +func GetShortOperationName(operation string) string { + switch operation { + case "PutRetentionPolicy": + return "prp" + case "DescribeInstances": + return "di" + case "DescribeTags": + return "dt" + case "DescribeTasks": + return "dts" + case "DescribeVolumes": + return "dv" + case "DescribeContainerInstances": + return "dci" + case "DescribeServices": + return "ds" + case "DescribeTaskDefinition": + return "dtd" + case "ListServices": + return "ls" + case "ListTasks": + return "lt" + case "CreateLogGroup": + return "clg" + case "CreateLogStream": + return "cls" + case "AssumeRole": + return "ar" + default: + return "" + } } diff --git a/extension/agenthealth/handler/stats/agent/agent_test.go b/extension/agenthealth/handler/stats/agent/agent_test.go index c379facc19..7a82904fa4 100644 --- a/extension/agenthealth/handler/stats/agent/agent_test.go +++ b/extension/agenthealth/handler/stats/agent/agent_test.go @@ -11,17 +11,17 @@ import ( ) func TestMerge(t *testing.T) { - stats := &Stats{CpuPercent: aws.Float64(1.2)} - assert.EqualValues(t, 1.2, *stats.CpuPercent) + stats := &Stats{CPUPercent: aws.Float64(1.2)} + assert.EqualValues(t, 1.2, *stats.CPUPercent) assert.Nil(t, stats.MemoryBytes) stats.Merge(Stats{ - CpuPercent: aws.Float64(1.3), + CPUPercent: aws.Float64(1.3), MemoryBytes: aws.Uint64(123), }) - assert.EqualValues(t, 1.3, *stats.CpuPercent) + assert.EqualValues(t, 1.3, *stats.CPUPercent) assert.EqualValues(t, 123, *stats.MemoryBytes) stats.Merge(Stats{ - CpuPercent: aws.Float64(1.5), + CPUPercent: aws.Float64(1.5), MemoryBytes: aws.Uint64(133), FileDescriptorCount: aws.Int32(456), ThreadCount: aws.Int32(789), @@ -36,7 +36,7 @@ func TestMerge(t *testing.T) { RegionType: aws.String("RegionType"), Mode: aws.String("Mode"), }) - assert.EqualValues(t, 1.5, *stats.CpuPercent) + assert.EqualValues(t, 1.5, *stats.CPUPercent) assert.EqualValues(t, 133, *stats.MemoryBytes) assert.EqualValues(t, 456, *stats.FileDescriptorCount) assert.EqualValues(t, 789, *stats.ThreadCount) @@ -52,6 +52,76 @@ func TestMerge(t *testing.T) { assert.EqualValues(t, "Mode", *stats.Mode) } +func TestMergeWithStatusCodes(t *testing.T) { + stats := &Stats{ + StatusCodes: map[string][5]int{ + "operation1": {1, 2, 3, 4, 5}, + }, + } + + stats.Merge(Stats{ + StatusCodes: map[string][5]int{ + "operation1": {2, 3, 4, 5, 6}, // Existing operation with new values + "operation2": {0, 1, 2, 3, 4}, // New operation + }, + }) + + assert.Equal(t, [5]int{3, 5, 7, 9, 11}, stats.StatusCodes["operation1"]) // Values should sum + assert.Equal(t, [5]int{0, 1, 2, 3, 4}, stats.StatusCodes["operation2"]) // New operation added + + stats.Merge(Stats{ + StatusCodes: nil, + }) + + assert.Equal(t, [5]int{3, 5, 7, 9, 11}, stats.StatusCodes["operation1"]) + assert.Equal(t, [5]int{0, 1, 2, 3, 4}, stats.StatusCodes["operation2"]) +} + +func TestMarshalWithStatusCodes(t *testing.T) { + testCases := map[string]struct { + stats *Stats + want string + }{ + "WithEmptyStatusCodes": { + stats: &Stats{ + StatusCodes: map[string][5]int{}, + }, + want: "", + }, + "WithStatusCodes": { + stats: &Stats{ + StatusCodes: map[string][5]int{ + "operation1": {1, 2, 3, 4, 5}, + "operation2": {0, 1, 2, 3, 4}, + }, + }, + want: `"codes":{"operation1":[1,2,3,4,5],"operation2":[0,1,2,3,4]}`, + }, + } + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + got, err := testCase.stats.Marshal() + assert.NoError(t, err) + assert.Contains(t, testCase.want, got) + }) + } +} + +func TestMergeFullWithStatusCodes(t *testing.T) { + stats := &Stats{ + CPUPercent: aws.Float64(1.0), + StatusCodes: map[string][5]int{"operation1": {1, 0, 0, 0, 0}}, + } + stats.Merge(Stats{ + CPUPercent: aws.Float64(2.0), + StatusCodes: map[string][5]int{"operation1": {0, 1, 0, 0, 0}, "operation2": {1, 1, 1, 1, 1}}, + }) + + assert.Equal(t, 2.0, *stats.CPUPercent) + assert.Equal(t, [5]int{1, 1, 0, 0, 0}, stats.StatusCodes["operation1"]) + assert.Equal(t, [5]int{1, 1, 1, 1, 1}, stats.StatusCodes["operation2"]) +} + func TestMarshal(t *testing.T) { testCases := map[string]struct { stats *Stats @@ -63,7 +133,7 @@ func TestMarshal(t *testing.T) { }, "WithPartial": { stats: &Stats{ - CpuPercent: aws.Float64(1.2), + CPUPercent: aws.Float64(1.2), MemoryBytes: aws.Uint64(123), ThreadCount: aws.Int32(789), PayloadBytes: aws.Int(5678), @@ -72,7 +142,7 @@ func TestMarshal(t *testing.T) { }, "WithFull": { stats: &Stats{ - CpuPercent: aws.Float64(1.2), + CPUPercent: aws.Float64(1.2), MemoryBytes: aws.Uint64(123), FileDescriptorCount: aws.Int32(456), ThreadCount: aws.Int32(789), diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 7e12f12b5c..a755f6f140 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -21,12 +21,34 @@ const ( headerKeyAgentStats = "X-Amz-Agent-Stats" ) -func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { - filter := agent.NewOperationsFilter(cfg.Operations...) - clientStats := client.NewHandler(filter) - stats := newStatsHandler(logger, filter, []agent.StatsProvider{clientStats, provider.GetProcessStats(), provider.GetFlagsStats()}) +func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bool, agentStatsEnabled bool) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { + var requestHandlers []awsmiddleware.RequestHandler + var responseHandlers []awsmiddleware.ResponseHandler + var statsProviders []agent.StatsProvider + + if !statusCodeEnabled && !agentStatsEnabled { + return nil, nil + } + + if statusCodeEnabled { + statusCodeFilter := agent.NewStatusCodeOperationsFilter() + statusCodeStatsProvider := provider.GetStatusCodeStatsProvider() + statusCodeHandler := provider.NewStatusCodeHandler(statusCodeStatsProvider, statusCodeFilter) + responseHandlers = append(responseHandlers, statusCodeHandler) + statsProviders = append(statsProviders, statusCodeStatsProvider) + } + + if agentStatsEnabled { + filter := agent.NewOperationsFilter(cfg.Operations...) + clientStats := client.NewHandler(filter) + statsProviders = append(statsProviders, clientStats, provider.GetProcessStats(), provider.GetFlagsStats()) + responseHandlers = append(responseHandlers, clientStats) + stats := newStatsHandler(logger, filter, statsProviders) + requestHandlers = append(requestHandlers, clientStats, stats) + } + agent.UsageFlags().SetValues(cfg.UsageFlags) - return []awsmiddleware.RequestHandler{stats, clientStats}, []awsmiddleware.ResponseHandler{clientStats} + return requestHandlers, responseHandlers } type statsHandler struct { diff --git a/extension/agenthealth/handler/stats/handler_test.go b/extension/agenthealth/handler/stats/handler_test.go index f40bebd481..30e603c02a 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -40,12 +40,16 @@ func TestStatsHandler(t *testing.T) { StatusCode: aws.Int(200), ImdsFallbackSucceed: aws.Int(1), SharedConfigFallback: aws.Int(1), + StatusCodes: map[string][5]int{ + "pmd": {1, 0, 0, 0, 0}, + "di": {0, 1, 0, 0, 0}, + }, } handler := newStatsHandler( zap.NewNop(), agent.NewOperationsFilter(), []agent.StatsProvider{ - newMockStatsProvider(&agent.Stats{CpuPercent: aws.Float64(1.2)}), + newMockStatsProvider(&agent.Stats{CPUPercent: aws.Float64(1.2)}), newMockStatsProvider(&agent.Stats{MemoryBytes: aws.Uint64(123)}), newMockStatsProvider(stats), }, @@ -59,15 +63,31 @@ func TestStatsHandler(t *testing.T) { assert.Equal(t, "", req.Header.Get(headerKeyAgentStats)) handler.filter = agent.NewOperationsFilter(agent.AllowAllOperations) handler.HandleRequest(ctx, req) - assert.Equal(t, `"cpu":1.2,"mem":123,"fd":456,"th":789,"lat":1234,"load":5678,"code":200,"scfb":1,"ifs":1`, req.Header.Get(headerKeyAgentStats)) + assert.Equal(t, `"cpu":1.2,"mem":123,"fd":456,"th":789,"lat":1234,"load":5678,"code":200,"scfb":1,"ifs":1,"codes":{"di":[0,1,0,0,0],"pmd":[1,0,0,0,0]}`, req.Header.Get(headerKeyAgentStats)) stats.StatusCode = aws.Int(404) stats.LatencyMillis = nil handler.HandleRequest(ctx, req) - assert.Equal(t, `"cpu":1.2,"mem":123,"fd":456,"th":789,"load":5678,"code":404,"scfb":1,"ifs":1`, req.Header.Get(headerKeyAgentStats)) + assert.Equal(t, `"cpu":1.2,"mem":123,"fd":456,"th":789,"load":5678,"code":404,"scfb":1,"ifs":1,"codes":{"di":[0,1,0,0,0],"pmd":[1,0,0,0,0]}`, req.Header.Get(headerKeyAgentStats)) } -func TestNewHandlers(t *testing.T) { - requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}) +func TestNewHandlersWithStatusCodeOnly(t *testing.T) { + requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, false) + assert.Len(t, requestHandlers, 0) + assert.Len(t, responseHandlers, 1) +} +func TestNewHandlersWithAgentStatsOnly(t *testing.T) { + requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, false, true) assert.Len(t, requestHandlers, 2) assert.Len(t, responseHandlers, 1) } + +func TestNewHandlersWithStatusCodeAndAgenthStats(t *testing.T) { + requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, true) + assert.Len(t, requestHandlers, 2) + assert.Len(t, responseHandlers, 2) +} +func TestNewHandlersWithoutStatusCodeAndAgenthStats(t *testing.T) { + requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, false, false) + assert.Len(t, requestHandlers, 0) + assert.Len(t, responseHandlers, 0) +} diff --git a/extension/agenthealth/handler/stats/provider/process.go b/extension/agenthealth/handler/stats/provider/process.go index 4e88ebbee5..e6687c9188 100644 --- a/extension/agenthealth/handler/stats/provider/process.go +++ b/extension/agenthealth/handler/stats/provider/process.go @@ -75,7 +75,7 @@ func (p *processStats) updateLoop() { func (p *processStats) refresh() { p.stats.Store(agent.Stats{ - CpuPercent: p.cpuPercent(), + CPUPercent: p.cpuPercent(), MemoryBytes: p.memoryBytes(), FileDescriptorCount: p.fileDescriptorCount(), ThreadCount: p.threadCount(), diff --git a/extension/agenthealth/handler/stats/provider/process_test.go b/extension/agenthealth/handler/stats/provider/process_test.go index 19fac625fb..7a350265eb 100644 --- a/extension/agenthealth/handler/stats/provider/process_test.go +++ b/extension/agenthealth/handler/stats/provider/process_test.go @@ -64,11 +64,11 @@ func TestProcessStats(t *testing.T) { mock := &mockProcessMetrics{} provider := newProcessStats(mock, time.Millisecond) got := provider.getStats() - assert.NotNil(t, got.CpuPercent) + assert.NotNil(t, got.CPUPercent) assert.NotNil(t, got.MemoryBytes) assert.NotNil(t, got.FileDescriptorCount) assert.NotNil(t, got.ThreadCount) - assert.EqualValues(t, 1, *got.CpuPercent) + assert.EqualValues(t, 1, *got.CPUPercent) assert.EqualValues(t, 2, *got.MemoryBytes) assert.EqualValues(t, 3, *got.FileDescriptorCount) assert.EqualValues(t, 4, *got.ThreadCount) @@ -77,6 +77,25 @@ func TestProcessStats(t *testing.T) { mock.mu.Unlock() provider.refresh() assert.Eventually(t, func() bool { - return provider.getStats() == agent.Stats{} + return isAgentStatsReset(provider.getStats()) }, 5*time.Millisecond, time.Millisecond) } + +func isAgentStatsReset(stats agent.Stats) bool { + return stats.CPUPercent == nil && + stats.MemoryBytes == nil && + stats.FileDescriptorCount == nil && + stats.ThreadCount == nil && + stats.LatencyMillis == nil && + stats.PayloadBytes == nil && + stats.StatusCode == nil && + stats.SharedConfigFallback == nil && + stats.ImdsFallbackSucceed == nil && + stats.AppSignals == nil && + stats.EnhancedContainerInsights == nil && + stats.RunningInContainer == nil && + stats.RegionType == nil && + stats.Mode == nil && + stats.EntityRejected == nil && + len(stats.StatusCodes) == 0 +} diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go new file mode 100644 index 0000000000..17daaee6b0 --- /dev/null +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -0,0 +1,163 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + +package provider + +import ( + "context" + "net/http" + "sync" + "time" + + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" +) + +const ( + statusResetInterval = 5 * time.Minute + statusHandlerID = "cloudwatchagent.StatusCodeHandler" +) + +var ( + statusCodeProviderSingleton *StatusCodeProvider + StatusCodeProviderOnce sync.Once +) + +// StatusCodeProvider handles processing of status codes and maintains stats. +type StatusCodeProvider struct { + currentStats map[string]*[5]int + mu sync.RWMutex + statusCodeChan chan statusCodeEntry + stopChan chan struct{} + resetTicker *time.Ticker + completedStats chan agent.Stats +} + +type statusCodeEntry struct { + operation string + statusCode int +} + +func GetStatusCodeStatsProvider() *StatusCodeProvider { + StatusCodeProviderOnce.Do(func() { + provider := &StatusCodeProvider{ + currentStats: make(map[string]*[5]int), + statusCodeChan: make(chan statusCodeEntry, 1000), + stopChan: make(chan struct{}), + resetTicker: time.NewTicker(statusResetInterval), + completedStats: make(chan agent.Stats, 1), // buffered channel + } + provider.startProcessing() + statusCodeProviderSingleton = provider + }) + return statusCodeProviderSingleton +} + +func (sp *StatusCodeProvider) startProcessing() { + go func() { + for { + select { + case entry := <-sp.statusCodeChan: + sp.processStatusCode(entry) + case <-sp.resetTicker.C: + sp.RotateStats() + case <-sp.stopChan: + sp.resetTicker.Stop() + return + } + } + }() +} + +func (sp *StatusCodeProvider) EnqueueStatusCode(operation string, statusCode int) { + sp.statusCodeChan <- statusCodeEntry{operation: operation, statusCode: statusCode} +} + +func (sp *StatusCodeProvider) processStatusCode(entry statusCodeEntry) { + sp.mu.Lock() + defer sp.mu.Unlock() + + stats, exists := sp.currentStats[entry.operation] + if !exists { + stats = &[5]int{} + sp.currentStats[entry.operation] = stats + } + + switch entry.statusCode { + case 200: + stats[0]++ + case 400: + stats[1]++ + case 408: + stats[2]++ + case 413: + stats[3]++ + case 429: + stats[4]++ + } +} + +func (sp *StatusCodeProvider) RotateStats() { + sp.mu.Lock() + newStats := agent.Stats{ + StatusCodes: make(map[string][5]int, len(sp.currentStats)), + } + for op, stats := range sp.currentStats { + newStats.StatusCodes[op] = *stats + } + sp.currentStats = make(map[string]*[5]int) + sp.mu.Unlock() + + select { + case existingStats := <-sp.completedStats: + existingStats.Merge(newStats) + newStats = existingStats + default: + } + + sp.completedStats <- newStats +} + +func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { + select { + case stats := <-sp.completedStats: + return stats + default: + return agent.Stats{} + } +} + +type StatusCodeHandler struct { + StatusCodeProvider *StatusCodeProvider + filter agent.OperationsFilter +} + +func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsFilter) *StatusCodeHandler { + return &StatusCodeHandler{ + StatusCodeProvider: provider, + filter: filter, + } +} + +func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { + operation := awsmiddleware.GetOperationName(ctx) + if !h.filter.IsAllowed(operation) { + return + } + + operation = agent.GetShortOperationName(operation) + if operation == "" { + return + } + + h.StatusCodeProvider.EnqueueStatusCode(operation, r.StatusCode) +} + +func (h *StatusCodeHandler) ID() string { + return statusHandlerID +} + +func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { + return awsmiddleware.After +} diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go new file mode 100644 index 0000000000..247fecda15 --- /dev/null +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -0,0 +1,130 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + +package provider_test + +import ( + "sync" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "go.uber.org/zap" + + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/provider" +) + +func TestNewHandlers(t *testing.T) { + logger := zap.NewNop() // Use a no-op logger for testing + cfg := agent.StatsConfig{ + Operations: []string{"TestOperation"}, + } + + t.Run("Only StatusCodeEnabled", func(t *testing.T) { + requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, true, false) + + assert.Nil(t, requestHandlers, "Request handlers should not be nil") + assert.NotNil(t, responseHandlers, "Response handlers should not be nil") + assert.Len(t, requestHandlers, 0, "There should be 0 request handlers") + assert.Len(t, responseHandlers, 1, "There should be 1 response handler") + + assert.IsType(t, &provider.StatusCodeHandler{}, responseHandlers[0], "First response handler should be StatusCodeHandler") + }) + + t.Run("Only AgentStatsEnabled", func(t *testing.T) { + requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, false, true) + + assert.NotNil(t, requestHandlers, "Request handlers should not be nil") + assert.NotNil(t, responseHandlers, "Response handlers should not be nil") + assert.GreaterOrEqual(t, len(requestHandlers), 2, "There should be at least 2 request handlers") + assert.GreaterOrEqual(t, len(responseHandlers), 1, "There should be at least 1 response handler") + }) + + t.Run("Both Enabled", func(t *testing.T) { + requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, true, true) + + assert.NotNil(t, requestHandlers, "Request handlers should not be nil") + assert.NotNil(t, responseHandlers, "Response handlers should not be nil") + assert.GreaterOrEqual(t, len(requestHandlers), 2, "There should be at least 3 request handlers") + assert.GreaterOrEqual(t, len(responseHandlers), 2, "There should be at least 2 response handlers") + }) + + t.Run("Neither Enabled", func(t *testing.T) { + requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, false, false) + + assert.Nil(t, requestHandlers, "Request handlers should be nil") + assert.Nil(t, responseHandlers, "Response handlers should be nil") + }) +} + +func TestSingleton(t *testing.T) { + instance1 := provider.GetStatusCodeStatsProvider() + instance2 := provider.GetStatusCodeStatsProvider() + + if instance1 != instance2 { + t.Errorf("Expected both instances to be the same, but they are different") + } + + instance1.EnqueueStatusCode("DescribeInstances", 200) + stats1 := instance1.Stats("") + stats2 := instance2.Stats("") + + if stats1.StatusCodes["DescribeInstances"][0] != stats2.StatusCodes["DescribeInstances"][0] { + t.Errorf("Expected the state to be the same across instances, but it differs") + } +} + +func TestStatsResetRace(t *testing.T) { + sp := provider.GetStatusCodeStatsProvider() + + // Pre-populate some stats through the normal channel + sp.EnqueueStatusCode("op1", 200) + sp.EnqueueStatusCode("op2", 400) + + // Give time for the stats to be processed + time.Sleep(10 * time.Millisecond) + + // Trigger a rotation to get some stats in the completedStats channel + sp.RotateStats() + + var wg sync.WaitGroup + wg.Add(3) + + // Goroutine 1: Continuously call the Stats method + go func() { + defer wg.Done() + for i := 0; i < 100; i++ { + stats := sp.Stats("") + if stats.StatusCodes != nil { + total := 0 + for _, counts := range stats.StatusCodes { + for _, count := range counts { + total += count + } + } + assert.Greater(t, total, 0, "Should have some status codes counted") + } + } + }() + + // Goroutine 2: Add new status codes + go func() { + defer wg.Done() + for i := 0; i < 100; i++ { + sp.EnqueueStatusCode("op3", 200) + } + }() + + // Goroutine 3: Trigger rotations + go func() { + defer wg.Done() + for i := 0; i < 3; i++ { + time.Sleep(1 * time.Millisecond) + sp.RotateStats() + } + }() + + wg.Wait() +} diff --git a/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go b/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go index e1b0f4f457..bbec34db90 100644 --- a/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go +++ b/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go @@ -403,7 +403,7 @@ func init() { zap.NewNop(), &agenthealth.Config{ IsUsageDataEnabled: envconfig.IsUsageDataEnabled(), - Stats: agent.StatsConfig{Operations: []string{"PutLogEvents"}}, + Stats: &agent.StatsConfig{Operations: []string{"PutLogEvents"}}, }, ), } diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index ef39f9390c..5e1d4c0b9b 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -31,14 +31,25 @@ var ( ) type translator struct { - name string - operations []string - isUsageDataEnabled bool - factory extension.Factory + 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, isStatusCodeEnabled bool) common.Translator[component.Config] { + return &translator{ + name: name.String(), + operations: operations, + factory: agenthealth.NewFactory(), + isUsageDataEnabled: envconfig.IsUsageDataEnabled(), + isStatusCodeEnabled: isStatusCodeEnabled, + } +} + func NewTranslator(name component.DataType, operations []string) common.Translator[component.Config] { return &translator{ name: name.String(), @@ -59,7 +70,8 @@ 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.Stats = agent.StatsConfig{ + cfg.IsStatusCodeEnabled = t.isStatusCodeEnabled + cfg.Stats = &agent.StatsConfig{ Operations: t.operations, UsageFlags: map[agent.Flag]any{ agent.FlagMode: context.CurrentContext().ShortMode(), diff --git a/translator/translate/otel/extension/agenthealth/translator_test.go b/translator/translate/otel/extension/agenthealth/translator_test.go index 989372e04a..41501ab0bf 100644 --- a/translator/translate/otel/extension/agenthealth/translator_test.go +++ b/translator/translate/otel/extension/agenthealth/translator_test.go @@ -35,7 +35,7 @@ func TestTranslate(t *testing.T) { isEnvUsageData: true, want: &agenthealth.Config{ IsUsageDataEnabled: true, - Stats: agent.StatsConfig{ + Stats: &agent.StatsConfig{ Operations: operations, UsageFlags: usageFlags, }, @@ -46,7 +46,7 @@ func TestTranslate(t *testing.T) { isEnvUsageData: true, want: &agenthealth.Config{ IsUsageDataEnabled: false, - Stats: agent.StatsConfig{ + Stats: &agent.StatsConfig{ Operations: operations, UsageFlags: usageFlags, }, @@ -57,7 +57,7 @@ func TestTranslate(t *testing.T) { isEnvUsageData: false, want: &agenthealth.Config{ IsUsageDataEnabled: false, - Stats: agent.StatsConfig{ + Stats: &agent.StatsConfig{ Operations: operations, UsageFlags: usageFlags, }, @@ -68,7 +68,7 @@ func TestTranslate(t *testing.T) { isEnvUsageData: true, want: &agenthealth.Config{ IsUsageDataEnabled: true, - Stats: agent.StatsConfig{ + Stats: &agent.StatsConfig{ Operations: operations, UsageFlags: usageFlags, }, From ad90d9eec84194f2bea2b8f2e49fa9844597da46 Mon Sep 17 00:00:00 2001 From: okankoAMZ <107267850+okankoAMZ@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:00:03 -0800 Subject: [PATCH 02/14] End-to-End Build Workflow (#1416) Co-authored-by: Musa --- .github/workflows/build-test-artifacts.yml | 9 ++- .github/workflows/e2e-build.yml | 68 ++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/e2e-build.yml diff --git a/.github/workflows/build-test-artifacts.yml b/.github/workflows/build-test-artifacts.yml index ca12788fc7..e5fdb5cfd9 100644 --- a/.github/workflows/build-test-artifacts.yml +++ b/.github/workflows/build-test-artifacts.yml @@ -16,6 +16,12 @@ on: - '!.github/workflows/integration-test.yml' - '!.github/workflows/application-signals-e2e-test.yml' workflow_dispatch: + workflow_call: + inputs: + test-image-before-upload: + description: "Run Test on the new container image" + default: true + type: boolean concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -87,6 +93,7 @@ jobs: StartIntegrationTests: needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ] + if: ${{inputs.test-image-before-upload == null || inputs.test-image-before-upload}} runs-on: ubuntu-latest steps: - run: gh workflow run integration-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }} @@ -96,7 +103,7 @@ jobs: StartApplicationSignalsE2ETests: needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ] # Workflow only runs against main - if: ${{ contains(github.ref_name, 'main') }} + if: ${{ contains(github.ref_name, 'main') && (inputs.test-image-before-upload == null ||inputs.test-image-before-upload) }} runs-on: ubuntu-latest steps: - run: gh workflow run application-signals-e2e-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }} diff --git a/.github/workflows/e2e-build.yml b/.github/workflows/e2e-build.yml new file mode 100644 index 0000000000..3acba7112f --- /dev/null +++ b/.github/workflows/e2e-build.yml @@ -0,0 +1,68 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: MIT + +name: Build End-to-End Test Artifacts +env: + OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" +on: + workflow_dispatch: + inputs: + operator-branch: + required: false + type: string + description: 'Branch of the operator to test' + default: 'main' + workflow_call: + inputs: + operator-branch: + required: false + type: string + description: 'Branch of the operator to test' + default: 'main' + +jobs: + GetLatestOperatorCommitSHA: + runs-on: ubuntu-latest + outputs: + operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} + operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} + steps: + - name: Checkout the target repo + uses: actions/checkout@v3 + with: + repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} + ref: ${{inputs.operator-branch}} + path: operator-repo + + - name: Get latest commit SHA + id: get_latest_sha + run: | + cd operator-repo + latest_sha=$(git rev-parse HEAD) + echo "::set-output name=operator_sha::$latest_sha" + BuildAgent: + uses: ./.github/workflows/build-test-artifacts.yml + concurrency: + group: "Build-Test-Artifacts-${{github.ref_name}}" + cancel-in-progress: true + secrets: inherit + permissions: + id-token: write + contents: read + with: + test-image-before-upload: false + BuildOperator: + needs: [GetLatestOperatorCommitSHA] + uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main + concurrency: + group: ${{ github.workflow }}-operator-${{ inputs.operator-branch}} + cancel-in-progress: true + secrets: inherit + with: + tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} + test-image-before-upload: false + + + From 2a7f43b1181550f9465bade436bbc70fd01e6d12 Mon Sep 17 00:00:00 2001 From: Musa Date: Mon, 16 Dec 2024 15:42:38 -0500 Subject: [PATCH 03/14] Implement EKS E2E Testing Workflow (#1445) --- .github/workflows/build-test-artifacts.yml | 9 +- .github/workflows/e2e-build.yml | 68 --------- .github/workflows/e2e-test.yml | 151 +++++++++++++++++++ .github/workflows/eks-e2e-test.yml | 160 +++++++++++++++++++++ 4 files changed, 318 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/e2e-build.yml create mode 100644 .github/workflows/e2e-test.yml create mode 100644 .github/workflows/eks-e2e-test.yml diff --git a/.github/workflows/build-test-artifacts.yml b/.github/workflows/build-test-artifacts.yml index e5fdb5cfd9..5509982f33 100644 --- a/.github/workflows/build-test-artifacts.yml +++ b/.github/workflows/build-test-artifacts.yml @@ -16,6 +16,11 @@ on: - '!.github/workflows/integration-test.yml' - '!.github/workflows/application-signals-e2e-test.yml' workflow_dispatch: + inputs: + test-image-before-upload: + description: "Run Test on the new container image" + default: true + type: boolean workflow_call: inputs: test-image-before-upload: @@ -93,7 +98,7 @@ jobs: StartIntegrationTests: needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ] - if: ${{inputs.test-image-before-upload == null || inputs.test-image-before-upload}} + if: ${{ inputs.test-image-before-upload }} runs-on: ubuntu-latest steps: - run: gh workflow run integration-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }} @@ -103,7 +108,7 @@ jobs: StartApplicationSignalsE2ETests: needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ] # Workflow only runs against main - if: ${{ contains(github.ref_name, 'main') && (inputs.test-image-before-upload == null ||inputs.test-image-before-upload) }} + if: ${{ contains(github.ref_name, 'main') && inputs.test-image-before-upload }} runs-on: ubuntu-latest steps: - run: gh workflow run application-signals-e2e-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }} diff --git a/.github/workflows/e2e-build.yml b/.github/workflows/e2e-build.yml deleted file mode 100644 index 3acba7112f..0000000000 --- a/.github/workflows/e2e-build.yml +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: MIT - -name: Build End-to-End Test Artifacts -env: - OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" -on: - workflow_dispatch: - inputs: - operator-branch: - required: false - type: string - description: 'Branch of the operator to test' - default: 'main' - workflow_call: - inputs: - operator-branch: - required: false - type: string - description: 'Branch of the operator to test' - default: 'main' - -jobs: - GetLatestOperatorCommitSHA: - runs-on: ubuntu-latest - outputs: - operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} - operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} - steps: - - name: Checkout the target repo - uses: actions/checkout@v3 - with: - repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} - ref: ${{inputs.operator-branch}} - path: operator-repo - - - name: Get latest commit SHA - id: get_latest_sha - run: | - cd operator-repo - latest_sha=$(git rev-parse HEAD) - echo "::set-output name=operator_sha::$latest_sha" - BuildAgent: - uses: ./.github/workflows/build-test-artifacts.yml - concurrency: - group: "Build-Test-Artifacts-${{github.ref_name}}" - cancel-in-progress: true - secrets: inherit - permissions: - id-token: write - contents: read - with: - test-image-before-upload: false - BuildOperator: - needs: [GetLatestOperatorCommitSHA] - uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main - concurrency: - group: ${{ github.workflow }}-operator-${{ inputs.operator-branch}} - cancel-in-progress: true - secrets: inherit - with: - tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} - target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} - repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} - test-image-before-upload: false - - - diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml new file mode 100644 index 0000000000..2ae0342a81 --- /dev/null +++ b/.github/workflows/e2e-test.yml @@ -0,0 +1,151 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: MIT + +name: Run E2E Tests +env: + TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours + ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" + CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" + CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" + CWA_GITHUB_TEST_REPO_BRANCH: "main" + TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} + TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} + OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" + +on: + workflow_dispatch: + inputs: + region: + required: false + type: string + description: 'AWS Region to run tests in' + default: 'us-west-2' + operator-branch: + required: false + type: string + description: 'Branch of the operator to test' + default: 'main' + helm-charts-branch: + required: false + type: string + description: 'Branch of the helm charts to test' + default: 'main' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }}-parent + cancel-in-progress: true + +jobs: + GetLatestOperatorCommitSHA: + runs-on: ubuntu-latest + outputs: + operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} + operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} + steps: + - name: Checkout the target repo + uses: actions/checkout@v3 + with: + repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} + ref: ${{inputs.operator-branch}} + path: operator-repo + + - name: Get latest commit SHA + id: get_latest_sha + run: | + cd operator-repo + latest_sha=$(git rev-parse HEAD) + echo "::set-output name=operator_sha::$latest_sha" + + BuildAgent: + uses: ./.github/workflows/build-test-artifacts.yml + concurrency: + group: "Build-Test-Artifacts-${{github.ref_name}}" + cancel-in-progress: true + secrets: inherit + permissions: + id-token: write + contents: read + with: + test-image-before-upload: false + + BuildOperator: + needs: [GetLatestOperatorCommitSHA] + uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main + concurrency: + group: ${{ github.workflow }}-operator-${{ inputs.operator-branch}} + cancel-in-progress: true + secrets: inherit + with: + tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} + test-image-before-upload: false + + OutputEnvVariables: + needs: [ BuildAgent, BuildOperator ] + name: 'OutputEnvVariables' + runs-on: ubuntu-latest + outputs: + CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} + CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} + CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} + ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} + ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} + steps: + - uses: actions/checkout@v3 + with: + repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} + ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} + + - name: Set up Go 1.x + uses: actions/setup-go@v4 + with: + go-version: ~1.22.2 + + - name: SetOutputs + id: set-outputs + run: | + echo "::set-output name=CWA_GITHUB_TEST_REPO_NAME::${{ env.CWA_GITHUB_TEST_REPO_NAME }}" + echo "::set-output name=CWA_GITHUB_TEST_REPO_URL::${{ env.CWA_GITHUB_TEST_REPO_URL }}" + echo "::set-output name=CWA_GITHUB_TEST_REPO_BRANCH::${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" + echo "::set-output name=ECR_INTEGRATION_TEST_REPO::cwagent-integration-test" + echo "::set-output name=ECR_OPERATOR_REPO::$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" + echo "::set-output name=ECR_TARGET_ALLOCATOR_REPO::$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" + + - name: Echo test variables + run: | + echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" + echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" + echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" + echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" + echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" + echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" + + GenerateTestMatrix: + needs: [BuildAgent, BuildOperator] + name: 'GenerateTestMatrix' + runs-on: ubuntu-latest + outputs: + eks_e2e_matrix: ${{ steps.set-matrix.outputs.eks_e2e_matrix }} + steps: + - uses: actions/checkout@v3 + with: + repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} + ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} + + - name: Set up Go 1.x + uses: actions/setup-go@v4 + with: + go-version: ~1.22.2 + + - name: Generate matrix + id: set-matrix + run: | + go run generator/test_case_generator.go -e2e + echo "::set-output name=eks_e2e_matrix::$(echo $(cat generator/resources/eks_e2e_complete_test_matrix.json))" + + - name: Echo test plan matrix + run: | + echo "eks_e2e_matrix: ${{ steps.set-matrix.outputs.eks_e2e_matrix }}" \ No newline at end of file diff --git a/.github/workflows/eks-e2e-test.yml b/.github/workflows/eks-e2e-test.yml new file mode 100644 index 0000000000..31edb07b0a --- /dev/null +++ b/.github/workflows/eks-e2e-test.yml @@ -0,0 +1,160 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: MIT + +name: Reusable EKS E2E Test + +env: + TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours + +on: + workflow_call: + inputs: + terraform_dir: + required: true + type: string + job_id: + required: true + type: string + test_props: + required: true + type: string + test_repo_name: + required: true + type: string + test_repo_url: + required: true + type: string + test_repo_branch: + required: true + type: string + cloudwatch_agent_repository: + required: true + type: string + cloudwatch_agent_tag: + required: true + type: string + cloudwatch_agent_operator_repository: + required: true + type: string + cloudwatch_agent_target_allocator_repository: + required: false + type: string + cloudwatch_agent_operator_tag: + required: true + type: string + region: + required: true + type: string + helm_charts_branch: + required: true + type: string + terraform_assume_role: + required: true + type: string + agent_config: + required: true + type: string + prometheus_config: + required: false + type: string + default: "" + otel_config: + required: false + type: string + default: "" + sample_app: + required: true + type: string + +jobs: + EKSE2ETest: + name: 'EKSE2ETest' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arrays: ${{ fromJson(inputs.test_props) }} + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v3 + with: + repository: ${{inputs.test_repo_name}} + ref: ${{inputs.test_repo_branch}} + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ inputs.terraform_assume_role }} + aws-region: ${{ inputs.region }} + role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} + + - name: Cache if success + id: cache_if_success + uses: actions/cache@v3 + with: + path: go.mod + key: ${{inputs.region}}-${{ github.sha }}-${{ matrix.arrays.os }}-${{ matrix.arrays.arc }}-${{ matrix.arrays.test_dir }} + + - name: Login ECR + id: login-ecr + if: steps.cache_if_success.outputs.cache-hit != 'true' + uses: aws-actions/amazon-ecr-login@v2 + + - name: Verify Terraform version + if: steps.cache_if_success.outputs.cache-hit != 'true' + run: terraform --version + + - name: Terraform apply + if: steps.cache_if_success.outputs.cache-hit != 'true' + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + timeout_minutes: 60 + retry_wait_seconds: 5 + command: | + if [ "${{ inputs.terraform_dir }}" != "" ]; then + cd "${{ inputs.terraform_dir }}" + else + cd terraform/eks/e2e + fi + + terraform init + if terraform apply --auto-approve \ + -var="region=${{ inputs.region }}" \ + -var="k8s_version=${{ matrix.arrays.k8s_version }}" \ + -var="helm_charts_branch=${{ inputs.helm_charts_branch }}" \ + -var="cloudwatch_agent_repository_url=${{ steps.login-ecr.outputs.registry }}" \ + -var="cloudwatch_agent_repository=${{ inputs.cloudwatch_agent_repository }}" \ + -var="cloudwatch_agent_tag=${{ inputs.cloudwatch_agent_tag }}" \ + -var="cloudwatch_agent_operator_repository_url=${{ steps.login-ecr.outputs.registry }}" \ + -var="cloudwatch_agent_operator_repository=${{ inputs.cloudwatch_agent_operator_repository }}" \ + -var="cloudwatch_agent_operator_tag=${{ inputs.cloudwatch_agent_operator_tag }}" \ + -var="cloudwatch_agent_target_allocator_repository_url=${{ steps.login-ecr.outputs.registry }}" \ + -var="cloudwatch_agent_target_allocator_repository=${{ inputs.cloudwatch_agent_target_allocator_repository }}" \ + -var="cloudwatch_agent_target_allocator_tag=${{ inputs.cloudwatch_agent_operator_tag }}" \ + -var="test_dir=${{ matrix.arrays.test_dir }}" \ + -var="agent_config=${{ inputs.agent_config }}" \ + -var="prometheus_config=${{ inputs.prometheus_config }}" \ + -var="otel_config=${{ inputs.otel_config }}" \ + -var="sample_app=${{ inputs.sample_app }}"; then + terraform destroy --auto-approve + else + terraform destroy --auto-approve && exit 1 + fi + + - name: Terraform destroy + if: ${{ cancelled() || failure() }} + uses: nick-fields/retry@v2 + with: + max_attempts: 3 + timeout_minutes: 8 + retry_wait_seconds: 5 + command: | + if [ "${{ inputs.terraform_dir }}" != "" ]; then + cd "${{ inputs.terraform_dir }}" + else + cd terraform/eks/e2e + fi + terraform destroy --auto-approve From b462f7ff9a6cfd9845c49da1602b110875ac169a Mon Sep 17 00:00:00 2001 From: Parampreet Singh <50599809+Paramadon@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:02:00 -0500 Subject: [PATCH 04/14] Add Status Code Metrics for API Calls in the Agent (#1442) --- .golangci.yml | 1 - Makefile | 6 +- .../ecsservicediscovery/servicediscovery.go | 17 +- .../servicediscovery_test.go | 42 + plugins/inputs/prometheus/prometheus.go | 35 +- .../outputs/cloudwatchlogs/cloudwatchlogs.go | 5 +- .../processors/awsentity/processor_test.go | 13 - plugins/processors/ec2tagger/config.go | 2 + plugins/processors/ec2tagger/ec2tagger.go | 21 +- .../sampleConfig/advanced_config_darwin.yaml | 15 +- .../sampleConfig/advanced_config_linux.yaml | 15 +- .../sampleConfig/advanced_config_windows.yaml | 11 +- .../sampleConfig/amp_config_linux.yaml | 335 +-- .../appsignals_and_ecs_config.yaml | 1460 ++++----- .../appsignals_and_eks_config.yaml | 1173 ++++---- .../appsignals_and_k8s_config.yaml | 1177 ++++---- .../appsignals_fallback_and_eks_config.yaml | 2597 +++++++++-------- .../appsignals_over_fallback_config.yaml | 2597 +++++++++-------- .../sampleConfig/base_appsignals_config.yaml | 1161 ++++---- .../base_appsignals_fallback_config.yaml | 2243 +++++++------- .../base_container_insights_config.yaml | 12 +- .../sampleConfig/basic_config_linux.yaml | 11 +- .../sampleConfig/basic_config_windows.yaml | 13 +- .../sampleConfig/collectd_config_linux.yaml | 10 +- .../sampleConfig/compass_linux_config.yaml | 11 +- .../sampleConfig/complete_darwin_config.yaml | 37 +- .../sampleConfig/complete_linux_config.yaml | 46 +- .../sampleConfig/complete_windows_config.yaml | 13 +- .../sampleConfig/config_with_env.yaml | 8 + .../sampleConfig/container_insights_jmx.yaml | 12 +- .../sampleConfig/delta_config_linux.yaml | 23 +- .../sampleConfig/delta_net_config_linux.yaml | 11 +- .../sampleConfig/drop_origin_linux.yaml | 21 +- .../emf_and_kubernetes_config.yaml | 10 +- .../emf_and_kubernetes_with_gpu_config.yaml | 196 +- .../emf_and_kubernetes_with_kueue_config.yaml | 8 + .../ignore_append_dimensions.yaml | 13 +- .../sampleConfig/invalid_input_linux.yaml | 9 + .../sampleConfig/jmx_config_linux.yaml | 19 +- .../sampleConfig/jmx_eks_config_linux.yaml | 7 +- .../kubernetes_on_prem_config.yaml | 14 +- .../kueue_container_insights_config.yaml | 8 + .../sampleConfig/log_ecs_metric_only.yaml | 8 + .../tocwconfig/sampleConfig/log_filter.yaml | 64 +- .../sampleConfig/log_only_config_windows.yaml | 64 +- .../logs_and_kubernetes_config.yaml | 15 +- .../sampleConfig/no_skip_log_timestamp.yaml | 64 +- .../no_skip_log_timestamp_windows.yaml | 64 +- .../otlp_metrics_cloudwatchlogs_config.yaml | 250 +- .../sampleConfig/otlp_metrics_config.yaml | 219 +- .../procstat_memory_swap_config.yaml | 122 +- .../prometheus_combined_config_linux.yaml | 16 +- .../sampleConfig/prometheus_config_linux.yaml | 8 + .../prometheus_config_windows.yaml | 8 + .../prometheus_otel_config_linux.yaml | 8 +- .../sampleConfig/skip_log_timestamp.yaml | 64 +- .../skip_log_timestamp_default.yaml | 64 +- .../skip_log_timestamp_default_windows.yaml | 64 +- .../skip_log_timestamp_windows.yaml | 64 +- .../sampleConfig/standard_config_linux.yaml | 13 +- ...ndard_config_linux_with_common_config.yaml | 9 + .../sampleConfig/standard_config_windows.yaml | 9 + ...ard_config_windows_with_common_config.yaml | 13 +- .../sampleConfig/statsd_config_linux.yaml | 10 +- .../sampleConfig/statsd_config_windows.yaml | 10 +- .../sampleConfig/statsd_ecs_config.yaml | 100 +- .../sampleConfig/statsd_eks_config.yaml | 122 +- .../sampleConfig/trace_config_linux.yaml | 8 + .../sampleConfig/trace_config_windows.yaml | 8 + .../windows_eventlog_only_config.yaml | 18 +- translator/tocwconfig/tocwconfig_test.go | 1 + .../otel/extension/agenthealth/translator.go | 7 +- .../pipeline/applicationsignals/translator.go | 3 + .../applicationsignals/translator_test.go | 14 +- .../pipeline/containerinsights/translator.go | 5 +- .../containerinsights/translator_test.go | 6 +- .../containerinsightsjmx/translator.go | 1 + .../containerinsightsjmx/translator_test.go | 2 +- .../otel/pipeline/emf_logs/translator.go | 4 +- .../otel/pipeline/emf_logs/translator_test.go | 8 +- .../otel/pipeline/host/translator.go | 2 + .../otel/pipeline/host/translator_test.go | 14 +- .../translate/otel/pipeline/jmx/translator.go | 2 +- .../otel/pipeline/prometheus/translator.go | 5 +- .../pipeline/prometheus/translator_test.go | 4 +- .../otel/pipeline/xray/translator.go | 3 +- .../otel/pipeline/xray/translator_test.go | 6 +- .../ec2taggerprocessor/translator.go | 2 + .../processor/resourcedetection/translator.go | 9 +- .../awscontainerinsight/translator.go | 5 + 90 files changed, 7816 insertions(+), 7211 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 88f10bb240..33fff94918 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -51,7 +51,6 @@ linters: - goimports - gosec - gosimple - - govet - ineffassign - misspell - revive diff --git a/Makefile b/Makefile index 03e22d2f20..da9c8294a0 100644 --- a/Makefile +++ b/Makefile @@ -25,9 +25,9 @@ WIN_BUILD = GOOS=windows GOARCH=amd64 go build -trimpath -buildmode=${CWAGENT_BU DARWIN_BUILD_AMD64 = CGO_ENABLED=1 GO111MODULE=on GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="${LDFLAGS}" -o $(BUILD_SPACE)/bin/darwin_amd64 DARWIN_BUILD_ARM64 = CGO_ENABLED=1 GO111MODULE=on GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="${LDFLAGS}" -o $(BUILD_SPACE)/bin/darwin_arm64 -IMAGE_REGISTRY = amazon -IMAGE_REPO = cloudwatch-agent -IMAGE_TAG = $(VERSION) +IMAGE_REGISTRY = 730335384949.dkr.ecr.us-west-2.amazonaws.com +IMAGE_REPO = cwagent +IMAGE_TAG = latest IMAGE = $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(IMAGE_TAG) DOCKER_BUILD_FROM_SOURCE = docker build -t $(IMAGE) -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/source/Dockerfile DOCKER_WINDOWS_BUILD_FROM_SOURCE = docker build -t $(IMAGE) -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/source/Dockerfile.Windows diff --git a/internal/ecsservicediscovery/servicediscovery.go b/internal/ecsservicediscovery/servicediscovery.go index 47efd6d2f3..8584733aa0 100644 --- a/internal/ecsservicediscovery/servicediscovery.go +++ b/internal/ecsservicediscovery/servicediscovery.go @@ -8,6 +8,7 @@ import ( "sync" "time" + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ecs" @@ -23,6 +24,7 @@ type ServiceDiscovery struct { stats ProcessorStats clusterProcessors []Processor + Configurer *awsmiddleware.Configurer } func (sd *ServiceDiscovery) init() { @@ -31,8 +33,21 @@ func (sd *ServiceDiscovery) init() { } configProvider := credentialConfig.Credentials() sd.svcEcs = ecs.New(configProvider, aws.NewConfig().WithRegion(sd.Config.TargetClusterRegion).WithMaxRetries(AwsSdkLevelRetryCount)) + + if sd.Configurer != nil { + if err := sd.Configurer.Configure(awsmiddleware.SDKv1(&sd.svcEcs.Handlers)); err != nil { + log.Printf("ERROR: Failed to configure ECS client: %v", err) + } + } + sd.svcEc2 = ec2.New(configProvider, aws.NewConfig().WithRegion(sd.Config.TargetClusterRegion).WithMaxRetries(AwsSdkLevelRetryCount)) + if sd.Configurer != nil { + if err := sd.Configurer.Configure(awsmiddleware.SDKv1(&sd.svcEc2.Handlers)); err != nil { + log.Printf("ERROR: Failed to configure EC2 client: %v", err) + } + } + sd.initClusterProcessorPipeline() } @@ -70,8 +85,8 @@ func StartECSServiceDiscovery(sd *ServiceDiscovery, shutDownChan chan interface{ func (sd *ServiceDiscovery) work() { sd.stats.ResetStats() - var err error var clusterTasks []*DecoratedTask + var err error for _, p := range sd.clusterProcessors { clusterTasks, err = p.Process(sd.Config.TargetCluster, clusterTasks) // Ignore partial result to avoid overwriting existing targets diff --git a/internal/ecsservicediscovery/servicediscovery_test.go b/internal/ecsservicediscovery/servicediscovery_test.go index cb86890598..06803e8ed3 100644 --- a/internal/ecsservicediscovery/servicediscovery_test.go +++ b/internal/ecsservicediscovery/servicediscovery_test.go @@ -7,7 +7,9 @@ import ( "sync" "testing" + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) func Test_ServiceDiscovery_InitPipelines(t *testing.T) { @@ -70,3 +72,43 @@ func Test_StartECSServiceDiscovery_BadClusterConfig(t *testing.T) { StartECSServiceDiscovery(p, nil, &wg) assert.Equal(t, 0, len(p.clusterProcessors)) } + +func Test_StartECSServiceDiscovery_WithConfigurer(t *testing.T) { + var wg sync.WaitGroup + var requestHandlers []awsmiddleware.RequestHandler + + handler := new(awsmiddleware.MockHandler) + handler.On("ID").Return("mock") + handler.On("Position").Return(awsmiddleware.After) + handler.On("HandleRequest", mock.Anything, mock.Anything) + handler.On("HandleResponse", mock.Anything, mock.Anything) + requestHandlers = append(requestHandlers, handler) + middleware := new(awsmiddleware.MockMiddlewareExtension) + middleware.On("Handlers").Return( + requestHandlers, + []awsmiddleware.ResponseHandler{handler}, + ) + c := awsmiddleware.NewConfigurer(middleware.Handlers()) + + config := ServiceDiscoveryConfig{ + TargetCluster: "test", + TargetClusterRegion: "us-east-1", + } + p := &ServiceDiscovery{Config: &config, Configurer: c} + wg.Add(1) + StartECSServiceDiscovery(p, nil, &wg) + assert.Equal(t, 0, len(p.clusterProcessors)) +} + +func Test_StartECSServiceDiscovery_WithoutConfigurer(t *testing.T) { + var wg sync.WaitGroup + + config := ServiceDiscoveryConfig{ + TargetCluster: "test", + TargetClusterRegion: "us-east-1", + } + p := &ServiceDiscovery{Config: &config, Configurer: nil} + wg.Add(1) + StartECSServiceDiscovery(p, nil, &wg) + assert.Equal(t, 0, len(p.clusterProcessors)) +} diff --git a/plugins/inputs/prometheus/prometheus.go b/plugins/inputs/prometheus/prometheus.go index 5497421cd2..703d54212d 100644 --- a/plugins/inputs/prometheus/prometheus.go +++ b/plugins/inputs/prometheus/prometheus.go @@ -7,9 +7,13 @@ import ( _ "embed" "sync" + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/plugins/inputs" + "go.uber.org/zap" + "github.com/aws/amazon-cloudwatch-agent/cfg/envconfig" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth" "github.com/aws/amazon-cloudwatch-agent/internal/ecsservicediscovery" ) @@ -23,6 +27,7 @@ type Prometheus struct { mbCh chan PrometheusMetricBatch shutDownChan chan interface{} wg sync.WaitGroup + middleware awsmiddleware.Middleware } func (p *Prometheus) SampleConfig() string { @@ -39,8 +44,10 @@ func (p *Prometheus) Gather(_ telegraf.Accumulator) error { func (p *Prometheus) Start(accIn telegraf.Accumulator) error { mth := NewMetricsTypeHandler() + receiver := &metricsReceiver{pmbCh: p.mbCh} - handler := &metricsHandler{mbCh: p.mbCh, + handler := &metricsHandler{ + mbCh: p.mbCh, acc: accIn, calculator: NewCalculator(), filter: NewMetricsFilter(), @@ -48,10 +55,22 @@ func (p *Prometheus) Start(accIn telegraf.Accumulator) error { mtHandler: mth, } - ecssd := &ecsservicediscovery.ServiceDiscovery{Config: p.ECSSDConfig} + var configurer *awsmiddleware.Configurer + var ecssd *ecsservicediscovery.ServiceDiscovery + needEcssd := true + + if p.middleware != nil { + configurer = awsmiddleware.NewConfigurer(p.middleware.Handlers()) + if configurer != nil { + ecssd = &ecsservicediscovery.ServiceDiscovery{Config: p.ECSSDConfig, Configurer: configurer} + needEcssd = false + } + } + if needEcssd { + ecssd = &ecsservicediscovery.ServiceDiscovery{Config: p.ECSSDConfig} + } - // Start ECS Service Discovery when in ECS - // https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-Setup-autodiscovery-ecs.html + // Launch ECS Service Discovery as a goroutine p.wg.Add(1) go ecsservicediscovery.StartECSServiceDiscovery(ecssd, p.shutDownChan, &p.wg) @@ -77,6 +96,14 @@ func init() { return &Prometheus{ mbCh: make(chan PrometheusMetricBatch, 10000), shutDownChan: make(chan interface{}), + middleware: agenthealth.NewAgentHealth( + zap.NewNop(), + &agenthealth.Config{ + IsUsageDataEnabled: envconfig.IsUsageDataEnabled(), + IsStatusCodeEnabled: true, + }, + ), } + }) } diff --git a/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go b/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go index bbec34db90..84a124abab 100644 --- a/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go +++ b/plugins/outputs/cloudwatchlogs/cloudwatchlogs.go @@ -402,8 +402,9 @@ func init() { middleware: agenthealth.NewAgentHealth( zap.NewNop(), &agenthealth.Config{ - IsUsageDataEnabled: envconfig.IsUsageDataEnabled(), - Stats: &agent.StatsConfig{Operations: []string{"PutLogEvents"}}, + IsUsageDataEnabled: envconfig.IsUsageDataEnabled(), + Stats: &agent.StatsConfig{Operations: []string{"PutLogEvents"}}, + IsStatusCodeEnabled: true, }, ), } diff --git a/plugins/processors/awsentity/processor_test.go b/plugins/processors/awsentity/processor_test.go index bd263e0a4f..f865bf4fec 100644 --- a/plugins/processors/awsentity/processor_test.go +++ b/plugins/processors/awsentity/processor_test.go @@ -54,19 +54,6 @@ func newAddToMockEntityStore(rs *mockEntityStore) func(entitystore.LogGroupName, } } -func newMockGetMetricAttributesFromEntityStore() func() map[string]*string { - mockPlatform := "AWS::EC2" - mockInstanceID := "i-123456789" - mockAutoScalingGroup := "auto-scaling" - return func() map[string]*string { - return map[string]*string{ - entitystore.PlatformType: &mockPlatform, - entitystore.InstanceIDKey: &mockInstanceID, - entitystore.ASGKey: &mockAutoScalingGroup, - } - } -} - func newMockGetServiceNameAndSource(service, source string) func() (string, string) { return func() (string, string) { return service, source diff --git a/plugins/processors/ec2tagger/config.go b/plugins/processors/ec2tagger/config.go index 1b0549de6e..9119139567 100644 --- a/plugins/processors/ec2tagger/config.go +++ b/plugins/processors/ec2tagger/config.go @@ -38,6 +38,8 @@ type Config struct { Filename string `mapstructure:"shared_credential_file,omitempty"` Token string `mapstructure:"token,omitempty"` IMDSRetries int `mapstructure:"imds_retries,omitempty"` + + MiddlewareID *component.ID `mapstructure:"middleware,omitempty"` } // Verify Config implements Processor interface. diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 52e9423100..89bb33a1bc 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -10,6 +10,7 @@ import ( "sync" "time" + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2/ec2iface" @@ -56,6 +57,7 @@ type Tagger struct { ec2API ec2iface.EC2API volumeSerialCache volume.Cache + Configurer *awsmiddleware.Configurer sync.RWMutex //to protect ec2TagCache } @@ -63,7 +65,6 @@ type Tagger struct { func newTagger(config *Config, logger *zap.Logger) *Tagger { _, cancel := context.WithCancel(context.Background()) mdCredentialConfig := &configaws.CredentialConfig{} - p := &Tagger{ Config: config, logger: logger, @@ -280,14 +281,12 @@ func (t *Tagger) ebsVolumesRetrieved() bool { // Start acts as input validation and serves the purpose of updating ec2 tags and ebs volumes if necessary. // It will be called when OTel is enabling each processor -func (t *Tagger) Start(ctx context.Context, _ component.Host) error { +func (t *Tagger) Start(ctx context.Context, host component.Host) error { t.shutdownC = make(chan bool) t.ec2TagCache = map[string]string{} - if err := t.deriveEC2MetadataFromIMDS(ctx); err != nil { return err } - t.tagFilters = []*ec2.Filter{ { Name: aws.String("resource-type"), @@ -298,12 +297,11 @@ func (t *Tagger) Start(ctx context.Context, _ component.Host) error { Values: aws.StringSlice([]string{t.ec2MetadataRespond.instanceId}), }, } - + // if the customer said 'AutoScalingGroupName' (the CW dimension), do what they mean not what they said + // and filter for the EC2 tag name called 'aws:autoscaling:groupName' useAllTags := len(t.EC2InstanceTagKeys) == 1 && t.EC2InstanceTagKeys[0] == "*" - if !useAllTags && len(t.EC2InstanceTagKeys) > 0 { // if the customer said 'AutoScalingGroupName' (the CW dimension), do what they mean not what they said - // and filter for the EC2 tag name called 'aws:autoscaling:groupName' for i, key := range t.EC2InstanceTagKeys { if cwDimensionASG == key { t.EC2InstanceTagKeys[i] = Ec2InstanceTagKeyASG @@ -315,7 +313,6 @@ func (t *Tagger) Start(ctx context.Context, _ component.Host) error { Values: aws.StringSlice(t.EC2InstanceTagKeys), }) } - if len(t.EC2InstanceTagKeys) > 0 || len(t.EBSDeviceKeys) > 0 { ec2CredentialConfig := &configaws.CredentialConfig{ AccessKey: t.AccessKey, @@ -327,6 +324,13 @@ func (t *Tagger) Start(ctx context.Context, _ component.Host) error { Region: t.ec2MetadataRespond.region, } t.ec2API = t.ec2Provider(ec2CredentialConfig) + + if client, ok := t.ec2API.(*ec2.EC2); ok { + if t.Config.MiddlewareID != nil { + awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&client.Handlers)) + } + } + go func() { //Async start of initial retrieval to prevent block of agent start t.initialRetrievalOfTagsAndVolumes() t.refreshLoopToUpdateTagsAndVolumes() @@ -336,7 +340,6 @@ func (t *Tagger) Start(ctx context.Context, _ component.Host) error { } else { t.setStarted() } - return nil } diff --git a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml index 64d81aaa17..6c425849d1 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml @@ -17,6 +17,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 @@ -38,10 +45,11 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - ImageId - InstanceId - InstanceType + - ImageId imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_cpu: @@ -71,6 +79,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: @@ -80,11 +89,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_disk - - telegraf_netstat - telegraf_swap - telegraf_cpu + - telegraf_disk - telegraf_mem + - telegraf_netstat metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml index b202e49fd9..5dddb3f844 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml @@ -17,13 +17,20 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict @@ -38,10 +45,11 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_cpu: @@ -79,6 +87,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: @@ -88,13 +97,13 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_nvidia_smi - telegraf_cpu - telegraf_disk - telegraf_mem - telegraf_netstat - telegraf_swap - telegraf_ethtool - - telegraf_nvidia_smi metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml index 0b7068462e..bd3e45ed9e 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml @@ -17,6 +17,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 @@ -32,6 +39,7 @@ processors: - InstanceId - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_win_perf_counters/1492679118: @@ -72,6 +80,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: @@ -81,13 +90,13 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_win_perf_counters/2073218482 - telegraf_win_perf_counters/2039663244 - telegraf_win_perf_counters/4283769065 - telegraf_win_perf_counters/1492679118 - telegraf_win_perf_counters/3610923661 - telegraf_win_perf_counters/3446270237 - telegraf_win_perf_counters/3762679655 - - telegraf_win_perf_counters/2073218482 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml index d32905f7ca..db8306774d 100644 --- a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml @@ -1,168 +1,177 @@ exporters: - awscloudwatch: - drop_original_metrics: - CPU_USAGE_IDLE: true - cpu_time_active: true - force_flush_interval: 1m0s - max_datums_per_call: 1000 - max_values_per_datum: 150 - middleware: agenthealth/metrics - namespace: CWAgent - region: us-west-2 - resource_to_telemetry_conversion: - enabled: true - rollup_dimensions: - - - ImageId - - - InstanceId - - InstanceType - - - d1 - - [ ] - prometheusremotewrite/amp: - add_metric_suffixes: true - auth: - authenticator: sigv4auth - compression: "" - disable_keep_alives: false - endpoint: https://aps-workspaces.us-west-2.amazonaws.com/workspaces/ws-12345/api/v1/remote_write - export_created_metric: - enabled: false - http2_ping_timeout: 0s - http2_read_idle_timeout: 0s - max_batch_size_bytes: 3000000 - namespace: "" - proxy_url: "" - read_buffer_size: 0 - remote_write_queue: - enabled: true - num_consumers: 5 - queue_size: 10000 - resource_to_telemetry_conversion: - clear_after_copy: true - enabled: true - retry_on_failure: - enabled: true - initial_interval: 50ms - randomization_factor: 0.5 - multiplier: 1.5 - max_interval: 30s - max_elapsed_time: 5m0s - send_metadata: false - target_info: - enabled: true - timeout: 5s - tls: - ca_file: "" - cert_file: "" - include_system_ca_certs_pool: false - insecure: false - insecure_skip_verify: false - key_file: "" - max_version: "" - min_version: "" - reload_interval: 0s - server_name_override: "" - write_buffer_size: 524288 + awscloudwatch: + drop_original_metrics: + CPU_USAGE_IDLE: true + cpu_time_active: true + force_flush_interval: 1m0s + max_datums_per_call: 1000 + max_values_per_datum: 150 + middleware: agenthealth/metrics + namespace: CWAgent + region: us-west-2 + resource_to_telemetry_conversion: + enabled: true + rollup_dimensions: + - - ImageId + - - InstanceId + - InstanceType + - - d1 + - [] + prometheusremotewrite/amp: + add_metric_suffixes: true + auth: + authenticator: sigv4auth + compression: "" + disable_keep_alives: false + endpoint: https://aps-workspaces.us-west-2.amazonaws.com/workspaces/ws-12345/api/v1/remote_write + export_created_metric: + enabled: false + http2_ping_timeout: 0s + http2_read_idle_timeout: 0s + max_batch_size_bytes: 3000000 + namespace: "" + proxy_url: "" + read_buffer_size: 0 + remote_write_queue: + enabled: true + num_consumers: 5 + queue_size: 10000 + resource_to_telemetry_conversion: + clear_after_copy: true + enabled: true + retry_on_failure: + enabled: true + initial_interval: 50ms + max_elapsed_time: 5m0s + max_interval: 30s + multiplier: 1.5 + randomization_factor: 0.5 + send_metadata: false + target_info: + enabled: true + timeout: 5s + tls: + ca_file: "" + cert_file: "" + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" + write_buffer_size: 524288 extensions: - agenthealth/metrics: - is_usage_data_enabled: true - stats: - operations: - - PutMetricData - usage_flags: - mode: EC2 - region_type: ACJ - entitystore: - mode: ec2 - region: us-west-2 - sigv4auth: - assume_role: - sts_region: us-west-2 - region: us-west-2 + agenthealth/metrics: + is_usage_data_enabled: true + stats: + operations: + - PutMetricData + usage_flags: + mode: EC2 + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ + entitystore: + mode: ec2 + region: us-west-2 + sigv4auth: + assume_role: + sts_region: us-west-2 + region: us-west-2 processors: - awsentity/resource: - entity_type: Resource - platform: ec2 - batch/host/amp: - metadata_cardinality_limit: 1000 - send_batch_max_size: 0 - send_batch_size: 8192 - timeout: 1m0s - ec2tagger: - ec2_instance_tag_keys: - - AutoScalingGroupName - ec2_metadata_tags: - - InstanceType - - ImageId - - InstanceId - imds_retries: 1 - refresh_interval_seconds: 0s - rollup: - attribute_groups: - - - ImageId - - - InstanceId - - InstanceType - - - d1 - - [ ] - cache_size: 1000 - drop_original: - - CPU_USAGE_IDLE - - cpu_time_active - transform: - error_mode: propagate - flatten_data: false - log_statements: [ ] - metric_statements: - - context: metric - statements: - - set(unit, "unit") where name == "cpu_usage_idle" - - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" - - set(unit, "unit") where name == "cpu_usage_nice" - trace_statements: [ ] + awsentity/resource: + entity_type: Resource + platform: ec2 + batch/host/amp: + metadata_cardinality_limit: 1000 + send_batch_max_size: 0 + send_batch_size: 8192 + timeout: 1m0s + ec2tagger: + ec2_instance_tag_keys: + - AutoScalingGroupName + ec2_metadata_tags: + - ImageId + - InstanceId + - InstanceType + imds_retries: 1 + middleware: agenthealth/statuscode + refresh_interval_seconds: 0s + rollup: + attribute_groups: + - - ImageId + - - InstanceId + - InstanceType + - - d1 + - [] + cache_size: 1000 + drop_original: + - CPU_USAGE_IDLE + - cpu_time_active + transform: + error_mode: propagate + flatten_data: false + log_statements: [] + metric_statements: + - context: metric + statements: + - set(unit, "unit") where name == "cpu_usage_idle" + - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" + - set(unit, "unit") where name == "cpu_usage_nice" + trace_statements: [] receivers: - telegraf_cpu: - collection_interval: 10s - initial_delay: 1s - timeout: 0s + telegraf_cpu: + collection_interval: 10s + initial_delay: 1s + timeout: 0s service: - extensions: - - agenthealth/metrics - - sigv4auth - - entitystore - pipelines: - metrics/host/cloudwatch: - exporters: - - awscloudwatch - processors: - - awsentity/resource - - ec2tagger - - transform - receivers: - - telegraf_cpu - metrics/host/amp: - exporters: - - prometheusremotewrite/amp - processors: - - ec2tagger - - transform - - rollup - - batch/host/amp - receivers: - - telegraf_cpu - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } + extensions: + - agenthealth/metrics + - agenthealth/statuscode + - sigv4auth + - entitystore + pipelines: + metrics/host/amp: + exporters: + - prometheusremotewrite/amp + processors: + - ec2tagger + - transform + - rollup + - batch/host/amp + receivers: + - telegraf_cpu + metrics/host/cloudwatch: + exporters: + - awscloudwatch + processors: + - awsentity/resource + - ec2tagger + - transform + receivers: + - telegraf_cpu + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml index c2a36602fe..269ffe1816 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml @@ -1,136 +1,136 @@ exporters: awsemf/application_signals: - certificate_file_path: '' + certificate_file_path: "" detailed_metrics: false dimension_rollup_option: NoDimensionRollup disable_metric_extraction: false eks_fargate_container_insights_enabled: false - endpoint: 'https://fake_endpoint' + endpoint: https://fake_endpoint enhanced_container_insights: false imds_retries: 1 local_mode: false log_group_name: /aws/application-signals/data log_retention: 0 - log_stream_name: '' + log_stream_name: "" max_retries: 2 metric_declarations: - dimensions: - - - Environment - - Operation - - Service - - - Environment - - Service + - - Environment + - Operation + - Service + - - Environment + - Service label_matchers: - - label_names: - - Telemetry.Source - regex: ^(ServerSpan|LocalRootSpan)$ - separator: ; + - label_names: + - Telemetry.Source + regex: ^(ServerSpan|LocalRootSpan)$ + separator: ; metric_name_selectors: - - Latency - - Fault - - Error + - Latency + - Fault + - Error - dimensions: - - - Environment - - Operation - - RemoteEnvironment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteEnvironment - - RemoteOperation - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteService - - Service - - - Environment - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - - RemoteService + - - Environment + - Operation + - RemoteEnvironment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteEnvironment + - RemoteOperation + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteService + - Service + - - Environment + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - - RemoteService label_matchers: - - label_names: - - Telemetry.Source - regex: ^(ClientSpan|ProducerSpan|ConsumerSpan)$ - separator: ; + - label_names: + - Telemetry.Source + regex: ^(ClientSpan|ProducerSpan|ConsumerSpan)$ + separator: ; metric_name_selectors: - - Latency - - Fault - - Error + - Latency + - Fault + - Error - dimensions: - - - Environment - - Service + - - Environment + - Service label_matchers: - - label_names: - - Telemetry.Source - regex: ^RuntimeMetric$ - separator: ; + - label_names: + - Telemetry.Source + regex: ^RuntimeMetric$ + separator: ; metric_name_selectors: - - ^.*$ + - ^.*$ middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false num_workers: 8 output_destination: cloudwatch - profile: '' - proxy_address: '' + profile: "" + proxy_address: "" region: us-east-1 request_timeout_seconds: 30 - resource_arn: '' + resource_arn: "" resource_to_telemetry_conversion: enabled: false retain_initial_value_of_delta_metric: false - role_arn: '' - version: '1' + role_arn: "" + version: "1" awsxray/application_signals: - certificate_file_path: '' - endpoint: '' + certificate_file_path: "" + endpoint: "" imds_retries: 1 index_all_attributes: false indexed_attributes: @@ -147,12 +147,12 @@ exporters: middleware: agenthealth/traces no_verify_ssl: false num_workers: 8 - profile: '' - proxy_address: '' + profile: "" + proxy_address: "" region: us-east-1 request_timeout_seconds: 30 - resource_arn: '' - role_arn: '' + resource_arn: "" + role_arn: "" telemetry: enabled: true include_metadata: true @@ -165,6 +165,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -174,18 +181,18 @@ extensions: mode: EC2 region_type: ACJ awsproxy/application_signals: - aws_endpoint: '' + aws_endpoint: "" + certificate_file_path: "" dialer: timeout: 0s - certificate_file_path: '' - endpoint: '0.0.0.0:2000' + endpoint: 0.0.0.0:2000 imds_retries: 1 local_mode: false - profile: '' - proxy_address: '' + profile: "" + proxy_address: "" region: us-east-1 - service_name: '' - role_arn: '' + role_arn: "" + service_name: "" processors: awsapplicationsignals: limiter: @@ -195,8 +202,584 @@ processors: log_dropped_metrics: true rotation_interval: 10m0s resolvers: - - name: '' + - name: "" platform: ecs + metricstransform/application_signals: + transforms: + - action: update + aggregation_type: "" + include: jvm.cpu.recent_utilization + match_type: "" + new_name: JVMCpuRecentUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.cpu.time + match_type: "" + new_name: JVMCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.classes.loaded + match_type: "" + new_name: JVMClassLoaded + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.threads.count + match_type: "" + new_name: JVMThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.nonheap.used + match_type: "" + new_name: JVMMemoryNonHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.pool.used_after_last_gc + match_type: "" + new_name: JVMMemoryUsedAfterLastGC + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.heap.used + match_type: "" + new_name: JVMMemoryHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Old\sGen$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryOldGenUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Survivor\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemorySurvivorSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Eden\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryEdenSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.elapsed + match_type: "" + new_name: JVMGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.count + match_type: "" + new_name: JVMGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCOldGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCYoungGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCOldGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCYoungGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "0" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "1" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "2" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.thread_count$$ + match_type: regexp + new_name: PythonProcessThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu_time$$ + match_type: regexp + new_name: PythonProcessCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + match_type: regexp + new_name: PythonProcessCpuUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: vms + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessVMSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: rss + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessRSSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: @@ -229,11 +812,11 @@ processors: host.name: enabled: true tags: [] - compression: '' + compression: "" consul: - address: '' - datacenter: '' - namespace: '' + address: "" + datacenter: "" + namespace: "" resource_attributes: cloud.region: enabled: true @@ -241,7 +824,7 @@ processors: enabled: true host.name: enabled: true - token_file: '' + token_file: "" detectors: - env - ecs @@ -274,7 +857,7 @@ processors: host.type: enabled: true tags: - - '^aws:autoscaling:groupName' + - ^aws:autoscaling:groupName ecs: resource_attributes: aws.ecs.cluster.arn: @@ -285,10 +868,10 @@ processors: enabled: false aws.ecs.task.family: enabled: false - aws.ecs.task.revision: - enabled: false aws.ecs.task.id: enabled: false + aws.ecs.task.revision: + enabled: false aws.log.group.arns: enabled: false aws.log.group.names: @@ -327,7 +910,7 @@ processors: enabled: true service.version: enabled: true - endpoint: '' + endpoint: "" gcp: resource_attributes: cloud.account.id: @@ -387,9 +970,9 @@ processors: idle_conn_timeout: 1m30s k8snode: auth_type: serviceAccount - context: '' - kube_config_path: '' - node_from_env_var: '' + context: "" + kube_config_path: "" + node_from_env_var: "" resource_attributes: k8s.node.name: enabled: true @@ -417,7 +1000,7 @@ processors: enabled: true max_idle_conns: 100 openshift: - address: '' + address: "" resource_attributes: cloud.platform: enabled: true @@ -428,19 +1011,19 @@ processors: k8s.cluster.name: enabled: true tls: - ca_file: '' - cert_file: '' + ca_file: "" + cert_file: "" include_system_ca_certs_pool: false insecure: false insecure_skip_verify: false - key_file: '' - max_version: '' - min_version: '' + key_file: "" + max_version: "" + min_version: "" reload_interval: 0s - server_name_override: '' - token: '' + server_name_override: "" + token: "" override: true - proxy_url: '' + proxy_url: "" read_buffer_size: 0 system: resource_attributes: @@ -472,637 +1055,62 @@ processors: enabled: true timeout: 2s tls: - ca_file: '' - cert_file: '' + ca_file: "" + cert_file: "" include_system_ca_certs_pool: false insecure: false insecure_skip_verify: false - key_file: '' - max_version: '' - min_version: '' + key_file: "" + max_version: "" + min_version: "" reload_interval: 0s - server_name_override: '' + server_name_override: "" write_buffer_size: 0 - metricstransform/application_signals: - transforms: - - include: jvm.cpu.recent_utilization - action: update - new_name: JVMCpuRecentUtilization - aggregation_type: '' - submatch_case: '' - match_type: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.cpu.time - action: update - new_name: JVMCpuTime - aggregation_type: '' - submatch_case: '' - match_type: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.classes.loaded - action: update - new_name: JVMClassLoaded - aggregation_type: '' - submatch_case: '' - match_type: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.threads.count - action: update - new_name: JVMThreadCount - aggregation_type: '' - submatch_case: '' - match_type: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.memory.nonheap.used - action: update - new_name: JVMMemoryNonHeapUsed - aggregation_type: '' - submatch_case: '' - match_type: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.memory.pool.used_after_last_gc - action: update - new_name: JVMMemoryUsedAfterLastGC - aggregation_type: '' - submatch_case: '' - match_type: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.memory.heap.used - action: update - new_name: JVMMemoryHeapUsed - aggregation_type: '' - submatch_case: '' - match_type: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryOldGenUsed - match_type: regexp - experimental_match_labels: - name: .*Old\\sGen$ - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemorySurvivorSpaceUsed - match_type: regexp - experimental_match_labels: - name: .*Survivor\\sSpace$ - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryEdenSpaceUsed - match_type: regexp - experimental_match_labels: - name: .*Eden\\sSpace$ - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCDuration - match_type: '' - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCCount - match_type: '' - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCOldGenDuration - match_type: strict - experimental_match_labels: - name: G1 Old Generation - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCYoungGenDuration - match_type: strict - experimental_match_labels: - name: G1 Young Generation - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCOldGenCount - match_type: strict - experimental_match_labels: - name: G1 Old Generation - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCYoungGenCount - match_type: strict - experimental_match_labels: - name: G1 Young Generation - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCCount - match_type: regexp - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen0Count - match_type: regexp - experimental_match_labels: - count: '0' - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen1Count - match_type: regexp - experimental_match_labels: - count: '1' - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen2Count - match_type: regexp - experimental_match_labels: - count: '2' - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.thread_count$$ - action: update - new_name: PythonProcessThreadCount - match_type: regexp - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.cpu_time$$ - action: update - new_name: PythonProcessCpuTime - match_type: regexp - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ - action: update - new_name: PythonProcessCpuUtilization - match_type: regexp - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessVMSMemoryUsed - experimental_match_labels: - type: vms - match_type: regexp - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessRSSMemoryUsed - experimental_match_labels: - type: rss - match_type: regexp - aggregation_type: '' - submatch_case: '' - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: '' - new_label: '' - label_value: '' - new_value: '' - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: '' - experimental_scale: 0 - label: '' - label_value: '' receivers: otlp/application_signals: protocols: grpc: - endpoint: '0.0.0.0:4315' dialer: timeout: 0s + endpoint: 0.0.0.0:4315 include_metadata: false max_concurrent_streams: 0 max_recv_msg_size_mib: 0 read_buffer_size: 524288 tls: - ca_file: '' + ca_file: "" cert_file: path/to/cert.crt - client_ca_file: '' + client_ca_file: "" client_ca_file_reload: false include_system_ca_certs_pool: false key_file: path/to/key.key - max_version: '' - min_version: '' + max_version: "" + min_version: "" reload_interval: 0s transport: tcp write_buffer_size: 0 http: - endpoint: '0.0.0.0:4316' + endpoint: 0.0.0.0:4316 include_metadata: false logs_url_path: /v1/logs max_request_body_size: 0 metrics_url_path: /v1/metrics tls: - ca_file: '' + ca_file: "" cert_file: path/to/cert.crt - client_ca_file: '' + client_ca_file: "" client_ca_file_reload: false include_system_ca_certs_pool: false key_file: path/to/key.key - max_version: '' - min_version: '' + max_version: "" + min_version: "" reload_interval: 0s traces_url_path: /v1/traces service: extensions: - awsproxy/application_signals - agenthealth/traces + - agenthealth/statuscode - agenthealth/logs pipelines: metrics/application_signals: @@ -1135,6 +1143,6 @@ service: thereafter: 500 tick: 10s metrics: - address: '' + address: "" level: None traces: {} diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml index 1d71ffb03b..3ad6ee7be8 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml @@ -104,14 +104,15 @@ exporters: - Fault - Error - dimensions: - - [ Environment, Service ] + - - Environment + - Service label_matchers: - label_names: - Telemetry.Source - regex: '^RuntimeMetric$' + regex: ^RuntimeMetric$ separator: ; metric_name_selectors: - - '^.*$' + - ^.*$ middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -273,6 +274,13 @@ extensions: usage_flags: mode: EKS region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EKS + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -295,14 +303,14 @@ extensions: role_arn: "" service_name: "" entitystore: - mode: ec2 - region: us-east-1 - kubernetes_mode: EKS + kubernetes_mode: EKS + mode: ec2 + region: us-east-1 server: - listen_addr: :4311 - tls_ca_path: "/etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt" - tls_cert_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.crt" - tls_key_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.key" + listen_addr: :4311 + tls_ca_path: /etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt + tls_cert_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.crt + tls_key_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.key processors: awsapplicationsignals: limiter: @@ -324,6 +332,582 @@ processors: send_batch_max_size: 0 send_batch_size: 8192 timeout: 5s + metricstransform/application_signals: + transforms: + - action: update + aggregation_type: "" + include: jvm.cpu.recent_utilization + match_type: "" + new_name: JVMCpuRecentUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.cpu.time + match_type: "" + new_name: JVMCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.classes.loaded + match_type: "" + new_name: JVMClassLoaded + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.threads.count + match_type: "" + new_name: JVMThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.nonheap.used + match_type: "" + new_name: JVMMemoryNonHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.pool.used_after_last_gc + match_type: "" + new_name: JVMMemoryUsedAfterLastGC + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.heap.used + match_type: "" + new_name: JVMMemoryHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Old\sGen$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryOldGenUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Survivor\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemorySurvivorSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Eden\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryEdenSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.elapsed + match_type: "" + new_name: JVMGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.count + match_type: "" + new_name: JVMGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCOldGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCYoungGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCOldGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCYoungGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "0" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "1" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "2" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.thread_count$$ + match_type: regexp + new_name: PythonProcessThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu_time$$ + match_type: regexp + new_name: PythonProcessCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + match_type: regexp + new_name: PythonProcessCpuUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: vms + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessVMSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: rss + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessRSSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: @@ -611,570 +1195,6 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 - metricstransform/application_signals: - transforms: - - include: jvm.cpu.recent_utilization - action: update - new_name: JVMCpuRecentUtilization - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.cpu.time - action: update - new_name: JVMCpuTime - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.classes.loaded - action: update - new_name: JVMClassLoaded - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.threads.count - action: update - new_name: JVMThreadCount - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.nonheap.used - action: update - new_name: JVMMemoryNonHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used_after_last_gc - action: update - new_name: JVMMemoryUsedAfterLastGC - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.heap.used - action: update - new_name: JVMMemoryHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryOldGenUsed - match_type: regexp - experimental_match_labels: {"name": '.*Old\\sGen$'} - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemorySurvivorSpaceUsed - match_type: regexp - experimental_match_labels: {"name": '.*Survivor\\sSpace$'} - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryEdenSpaceUsed - match_type: regexp - experimental_match_labels: {"name": '.*Eden\\sSpace$'} - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCDuration - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCCount - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCOldGenDuration - match_type: strict - experimental_match_labels: {"name": "G1 Old Generation"} - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCYoungGenDuration - match_type: strict - experimental_match_labels: {"name": "G1 Young Generation"} - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCOldGenCount - match_type: strict - experimental_match_labels: {"name": "G1 Old Generation"} - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCYoungGenCount - match_type: strict - experimental_match_labels: {"name": "G1 Young Generation"} - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen0Count - match_type: regexp - experimental_match_labels: { "count": "0" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen1Count - match_type: regexp - experimental_match_labels: { "count": "1" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen2Count - match_type: regexp - experimental_match_labels: { "count": "2" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.thread_count$$ - action: update - new_name: PythonProcessThreadCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu_time$$ - action: update - new_name: PythonProcessCpuTime - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ - action: update - new_name: PythonProcessCpuUtilization - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessVMSMemoryUsed - experimental_match_labels: {"type": "vms"} - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessRSSMemoryUsed - experimental_match_labels: {"type": "rss"} - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -1245,9 +1265,10 @@ receivers: traces_url_path: /v1/traces service: extensions: + - agenthealth/logs + - agenthealth/statuscode - awsproxy/application_signals - agenthealth/traces - - agenthealth/logs - entitystore - server pipelines: @@ -1256,9 +1277,9 @@ service: - awsemf/application_signals processors: - metricstransform/application_signals - - awsentity/service/application_signals - resourcedetection - awsapplicationsignals + - awsentity/service/application_signals receivers: - otlp/application_signals metrics/containerinsights: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index 5b099d0315..a9a5879fc2 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml @@ -104,14 +104,15 @@ exporters: - Fault - Error - dimensions: - - [ Environment, Service ] + - - Environment + - Service label_matchers: - label_names: - Telemetry.Source - regex: '^RuntimeMetric$' + regex: ^RuntimeMetric$ separator: ; metric_name_selectors: - - '^.*$' + - ^.*$ middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -274,6 +275,13 @@ extensions: usage_flags: mode: K8E region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: K8E + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -296,14 +304,14 @@ extensions: role_arn: "" service_name: "" entitystore: - mode: ec2 - region: us-east-1 - kubernetes_mode: K8sEC2 + kubernetes_mode: K8sEC2 + mode: ec2 + region: us-east-1 server: - listen_addr: :4311 - tls_ca_path: "/etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt" - tls_cert_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.crt" - tls_key_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.key" + listen_addr: :4311 + tls_ca_path: /etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt + tls_cert_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.crt + tls_key_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.key processors: awsapplicationsignals: limiter: @@ -313,8 +321,8 @@ processors: log_dropped_metrics: true rotation_interval: 10m0s resolvers: - - name: TestCluster - platform: k8s + - name: TestCluster + platform: k8s awsentity/service/application_signals: cluster_name: TestCluster entity_type: Service @@ -325,6 +333,582 @@ processors: send_batch_max_size: 0 send_batch_size: 8192 timeout: 5s + metricstransform/application_signals: + transforms: + - action: update + aggregation_type: "" + include: jvm.cpu.recent_utilization + match_type: "" + new_name: JVMCpuRecentUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.cpu.time + match_type: "" + new_name: JVMCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.classes.loaded + match_type: "" + new_name: JVMClassLoaded + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.threads.count + match_type: "" + new_name: JVMThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.nonheap.used + match_type: "" + new_name: JVMMemoryNonHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.pool.used_after_last_gc + match_type: "" + new_name: JVMMemoryUsedAfterLastGC + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.heap.used + match_type: "" + new_name: JVMMemoryHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Old\sGen$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryOldGenUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Survivor\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemorySurvivorSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Eden\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryEdenSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.elapsed + match_type: "" + new_name: JVMGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.count + match_type: "" + new_name: JVMGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCOldGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCYoungGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCOldGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCYoungGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "0" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "1" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "2" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.thread_count$$ + match_type: regexp + new_name: PythonProcessThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu_time$$ + match_type: regexp + new_name: PythonProcessCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + match_type: regexp + new_name: PythonProcessCpuUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: vms + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessVMSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: rss + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessRSSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: @@ -612,570 +1196,6 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 - metricstransform/application_signals: - transforms: - - include: jvm.cpu.recent_utilization - action: update - new_name: JVMCpuRecentUtilization - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.cpu.time - action: update - new_name: JVMCpuTime - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.classes.loaded - action: update - new_name: JVMClassLoaded - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.threads.count - action: update - new_name: JVMThreadCount - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.nonheap.used - action: update - new_name: JVMMemoryNonHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used_after_last_gc - action: update - new_name: JVMMemoryUsedAfterLastGC - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.heap.used - action: update - new_name: JVMMemoryHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryOldGenUsed - match_type: regexp - experimental_match_labels: { "name": '.*Old\\sGen$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemorySurvivorSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Survivor\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryEdenSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Eden\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCDuration - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCCount - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCOldGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCYoungGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCOldGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCYoungGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen0Count - match_type: regexp - experimental_match_labels: { "count": "0" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen1Count - match_type: regexp - experimental_match_labels: { "count": "1" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen2Count - match_type: regexp - experimental_match_labels: { "count": "2" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.thread_count$$ - action: update - new_name: PythonProcessThreadCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu_time$$ - action: update - new_name: PythonProcessCpuTime - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ - action: update - new_name: PythonProcessCpuUtilization - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessVMSMemoryUsed - experimental_match_labels: { "type": "vms" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessRSSMemoryUsed - experimental_match_labels: { "type": "rss" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: false @@ -1226,9 +1246,10 @@ receivers: traces_url_path: /v1/traces service: extensions: + - agenthealth/logs + - agenthealth/statuscode - awsproxy/application_signals - agenthealth/traces - - agenthealth/logs - entitystore - server pipelines: @@ -1237,9 +1258,9 @@ service: - awsemf/application_signals processors: - metricstransform/application_signals - - awsentity/service/application_signals - resourcedetection - awsapplicationsignals + - awsentity/service/application_signals receivers: - otlp/application_signals metrics/containerinsights: diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index bfcea74610..3ad6ee7be8 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -1,1294 +1,1315 @@ exporters: - awsemf/application_signals: - certificate_file_path: "" - detailed_metrics: false - dimension_rollup_option: NoDimensionRollup - disable_metric_extraction: false - eks_fargate_container_insights_enabled: false - endpoint: https://fake_endpoint - enhanced_container_insights: false - imds_retries: 1 - local_mode: false - log_group_name: /aws/application-signals/data - log_retention: 0 - log_stream_name: "" - max_retries: 2 - metric_declarations: - - dimensions: - - - Environment - - Operation - - Service - - - Environment - - Service - label_matchers: - - label_names: - - Telemetry.Source - regex: ^(ServerSpan|LocalRootSpan)$ - separator: ; - metric_name_selectors: - - Latency - - Fault - - Error - - dimensions: - - - Environment - - Operation - - RemoteEnvironment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteEnvironment - - RemoteOperation - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteService - - Service - - - Environment - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - - RemoteService - label_matchers: - - label_names: - - Telemetry.Source - regex: ^(ClientSpan|ProducerSpan|ConsumerSpan)$ - separator: ; - metric_name_selectors: - - Latency - - Fault - - Error - - dimensions: - - [ Environment, Service ] - label_matchers: - - label_names: - - Telemetry.Source - regex: '^RuntimeMetric$' - separator: ; - metric_name_selectors: - - '^.*$' - middleware: agenthealth/logs - namespace: ApplicationSignals - no_verify_ssl: false - num_workers: 8 - output_destination: cloudwatch - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - resource_to_telemetry_conversion: - enabled: false - retain_initial_value_of_delta_metric: false - role_arn: "" - version: "1" - awsemf/containerinsights: - certificate_file_path: "" - detailed_metrics: false - dimension_rollup_option: NoDimensionRollup - disable_metric_extraction: true - eks_fargate_container_insights_enabled: false - endpoint: https://fake_endpoint - enhanced_container_insights: false - imds_retries: 1 - local_mode: false - log_group_name: /aws/containerinsights/{ClusterName}/performance - log_retention: 0 - log_stream_name: '{NodeName}' - max_retries: 2 - metric_declarations: - - dimensions: - - - ClusterName - - Namespace - - PodName - - - ClusterName - - - ClusterName - - Namespace - - Service - - - ClusterName - - Namespace - metric_name_selectors: - - pod_cpu_utilization - - pod_memory_utilization - - pod_network_rx_bytes - - pod_network_tx_bytes - - pod_cpu_utilization_over_pod_limit - - pod_memory_utilization_over_pod_limit - - dimensions: - - - ClusterName - - Namespace - - PodName - metric_name_selectors: - - pod_number_of_container_restarts - - dimensions: - - - ClusterName - - Namespace - - PodName - - - ClusterName - metric_name_selectors: - - pod_cpu_reserved_capacity - - pod_memory_reserved_capacity - - dimensions: - - - ClusterName - - InstanceId - - NodeName - - - ClusterName - metric_name_selectors: - - node_cpu_utilization - - node_memory_utilization - - node_network_total_bytes - - node_cpu_reserved_capacity - - node_memory_reserved_capacity - - node_number_of_running_pods - - node_number_of_running_containers - - dimensions: - - - ClusterName - metric_name_selectors: - - node_cpu_usage_total - - node_cpu_limit - - node_memory_working_set - - node_memory_limit - - dimensions: - - - ClusterName - - InstanceId - - NodeName - - - ClusterName - metric_name_selectors: - - node_filesystem_utilization - - dimensions: - - - ClusterName - - Namespace - - Service - - - ClusterName - metric_name_selectors: - - service_number_of_running_pods - - dimensions: - - - ClusterName - - Namespace - - - ClusterName - metric_name_selectors: - - namespace_number_of_running_pods - - dimensions: - - - ClusterName - metric_name_selectors: - - cluster_node_count - - cluster_failed_node_count - middleware: agenthealth/logs - namespace: ContainerInsights - no_verify_ssl: false - num_workers: 8 - output_destination: cloudwatch - parse_json_encoded_attr_values: - - Sources - - kubernetes - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - resource_to_telemetry_conversion: - enabled: true - retain_initial_value_of_delta_metric: false - role_arn: "" - version: "0" - awsxray/application_signals: - certificate_file_path: "" - endpoint: "" - imds_retries: 1 - index_all_attributes: false - indexed_attributes: - - aws.local.service - - aws.local.operation - - aws.local.environment - - aws.remote.service - - aws.remote.operation - - aws.remote.environment - - aws.remote.resource.identifier - - aws.remote.resource.type - local_mode: false - max_retries: 2 - middleware: agenthealth/traces - no_verify_ssl: false - num_workers: 8 - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - role_arn: "" - telemetry: - enabled: true - include_metadata: true + awsemf/application_signals: + certificate_file_path: "" + detailed_metrics: false + dimension_rollup_option: NoDimensionRollup + disable_metric_extraction: false + eks_fargate_container_insights_enabled: false + endpoint: https://fake_endpoint + enhanced_container_insights: false + imds_retries: 1 + local_mode: false + log_group_name: /aws/application-signals/data + log_retention: 0 + log_stream_name: "" + max_retries: 2 + metric_declarations: + - dimensions: + - - Environment + - Operation + - Service + - - Environment + - Service + label_matchers: + - label_names: + - Telemetry.Source + regex: ^(ServerSpan|LocalRootSpan)$ + separator: ; + metric_name_selectors: + - Latency + - Fault + - Error + - dimensions: + - - Environment + - Operation + - RemoteEnvironment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteEnvironment + - RemoteOperation + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteService + - Service + - - Environment + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - - RemoteService + label_matchers: + - label_names: + - Telemetry.Source + regex: ^(ClientSpan|ProducerSpan|ConsumerSpan)$ + separator: ; + metric_name_selectors: + - Latency + - Fault + - Error + - dimensions: + - - Environment + - Service + label_matchers: + - label_names: + - Telemetry.Source + regex: ^RuntimeMetric$ + separator: ; + metric_name_selectors: + - ^.*$ + middleware: agenthealth/logs + namespace: ApplicationSignals + no_verify_ssl: false + num_workers: 8 + output_destination: cloudwatch + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + resource_to_telemetry_conversion: + enabled: false + retain_initial_value_of_delta_metric: false + role_arn: "" + version: "1" + awsemf/containerinsights: + certificate_file_path: "" + detailed_metrics: false + dimension_rollup_option: NoDimensionRollup + disable_metric_extraction: true + eks_fargate_container_insights_enabled: false + endpoint: https://fake_endpoint + enhanced_container_insights: false + imds_retries: 1 + local_mode: false + log_group_name: /aws/containerinsights/{ClusterName}/performance + log_retention: 0 + log_stream_name: '{NodeName}' + max_retries: 2 + metric_declarations: + - dimensions: + - - ClusterName + - Namespace + - PodName + - - ClusterName + - - ClusterName + - Namespace + - Service + - - ClusterName + - Namespace + metric_name_selectors: + - pod_cpu_utilization + - pod_memory_utilization + - pod_network_rx_bytes + - pod_network_tx_bytes + - pod_cpu_utilization_over_pod_limit + - pod_memory_utilization_over_pod_limit + - dimensions: + - - ClusterName + - Namespace + - PodName + metric_name_selectors: + - pod_number_of_container_restarts + - dimensions: + - - ClusterName + - Namespace + - PodName + - - ClusterName + metric_name_selectors: + - pod_cpu_reserved_capacity + - pod_memory_reserved_capacity + - dimensions: + - - ClusterName + - InstanceId + - NodeName + - - ClusterName + metric_name_selectors: + - node_cpu_utilization + - node_memory_utilization + - node_network_total_bytes + - node_cpu_reserved_capacity + - node_memory_reserved_capacity + - node_number_of_running_pods + - node_number_of_running_containers + - dimensions: + - - ClusterName + metric_name_selectors: + - node_cpu_usage_total + - node_cpu_limit + - node_memory_working_set + - node_memory_limit + - dimensions: + - - ClusterName + - InstanceId + - NodeName + - - ClusterName + metric_name_selectors: + - node_filesystem_utilization + - dimensions: + - - ClusterName + - Namespace + - Service + - - ClusterName + metric_name_selectors: + - service_number_of_running_pods + - dimensions: + - - ClusterName + - Namespace + - - ClusterName + metric_name_selectors: + - namespace_number_of_running_pods + - dimensions: + - - ClusterName + metric_name_selectors: + - cluster_node_count + - cluster_failed_node_count + middleware: agenthealth/logs + namespace: ContainerInsights + no_verify_ssl: false + num_workers: 8 + output_destination: cloudwatch + parse_json_encoded_attr_values: + - Sources + - kubernetes + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + resource_to_telemetry_conversion: + enabled: true + retain_initial_value_of_delta_metric: false + role_arn: "" + version: "0" + awsxray/application_signals: + certificate_file_path: "" + endpoint: "" + imds_retries: 1 + index_all_attributes: false + indexed_attributes: + - aws.local.service + - aws.local.operation + - aws.local.environment + - aws.remote.service + - aws.remote.operation + - aws.remote.environment + - aws.remote.resource.identifier + - aws.remote.resource.type + local_mode: false + max_retries: 2 + middleware: agenthealth/traces + no_verify_ssl: false + num_workers: 8 + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + role_arn: "" + telemetry: + enabled: true + include_metadata: true extensions: - agenthealth/logs: - is_usage_data_enabled: true - stats: - operations: - - PutLogEvents - usage_flags: - mode: EKS - region_type: ACJ - agenthealth/traces: - is_usage_data_enabled: true - stats: - operations: - - PutTraceSegments - usage_flags: - mode: EKS - region_type: ACJ - awsproxy/application_signals: - aws_endpoint: "" - certificate_file_path: "" - dialer: - timeout: "0s" - endpoint: 0.0.0.0:2000 - imds_retries: 1 - local_mode: false - profile: "" - proxy_address: "" - region: us-east-1 - service_name: "" - role_arn: "" - entitystore: - mode: ec2 - region: us-east-1 - kubernetes_mode: EKS - server: - listen_addr: :4311 - tls_ca_path: "/etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt" - tls_cert_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.crt" - tls_key_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.key" -processors: - awsapplicationsignals: - limiter: - disabled: false - drop_threshold: 500 - garbage_collection_interval: 10m0s - log_dropped_metrics: true - rotation_interval: 10m0s - resolvers: - - name: TestCluster - platform: eks - awsentity/service/application_signals: - cluster_name: TestCluster - entity_type: Service - kubernetes_mode: EKS - platform: ec2 - batch/containerinsights: - metadata_cardinality_limit: 1000 - send_batch_max_size: 0 - send_batch_size: 8192 - timeout: 5s - resourcedetection: - aks: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - k8s.cluster.name: - enabled: false - azure: - resource_attributes: - azure.resourcegroup.name: - enabled: true - azure.vm.name: - enabled: true - azure.vm.scaleset.name: - enabled: true - azure.vm.size: - enabled: true - cloud.account.id: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - host.id: - enabled: true - host.name: - enabled: true - tags: [] - compression: "" - consul: - address: "" - datacenter: "" - namespace: "" - resource_attributes: - cloud.region: - enabled: true - host.id: - enabled: true - host.name: - enabled: true - token_file: "" - detectors: - - eks - - env - - ec2 - disable_keep_alives: false - docker: - resource_attributes: - host.name: - enabled: true - os.type: - enabled: true - ec2: - resource_attributes: - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - host.id: - enabled: true - host.image.id: - enabled: true - host.name: - enabled: true - host.type: - enabled: true - tags: - - ^kubernetes.io/cluster/.*$ - - ^aws:autoscaling:groupName - ecs: - resource_attributes: - aws.ecs.cluster.arn: - enabled: true - aws.ecs.launchtype: - enabled: true - aws.ecs.task.arn: - enabled: true - aws.ecs.task.family: - enabled: true - aws.ecs.task.id: - enabled: true - aws.ecs.task.revision: - enabled: true - aws.log.group.arns: - enabled: true - aws.log.group.names: - enabled: true - aws.log.stream.arns: - enabled: true - aws.log.stream.names: - enabled: true - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - eks: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - k8s.cluster.name: - enabled: false - elasticbeanstalk: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - deployment.environment: - enabled: true - service.instance.id: - enabled: true - service.version: - enabled: true - endpoint: "" - gcp: - resource_attributes: - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - faas.id: - enabled: true - faas.instance: - enabled: true - faas.name: - enabled: true - faas.version: - enabled: true - gcp.cloud_run.job.execution: - enabled: true - gcp.cloud_run.job.task_index: - enabled: true - gcp.gce.instance.hostname: - enabled: false - gcp.gce.instance.name: - enabled: false - host.id: - enabled: true - host.name: - enabled: true - host.type: - enabled: true - k8s.cluster.name: - enabled: true - heroku: - resource_attributes: - cloud.provider: - enabled: true - heroku.app.id: - enabled: true - heroku.dyno.id: - enabled: true - heroku.release.commit: - enabled: true - heroku.release.creation_timestamp: - enabled: true - service.instance.id: - enabled: true - service.name: - enabled: true - service.version: - enabled: true - http2_ping_timeout: "0s" - http2_read_idle_timeout: "0s" - idle_conn_timeout: 1m30s - k8snode: - auth_type: serviceAccount - context: "" - kube_config_path: "" - node_from_env_var: "" - resource_attributes: - k8s.node.name: - enabled: true - k8s.node.uid: - enabled: true - lambda: - resource_attributes: - aws.log.group.names: - enabled: true - aws.log.stream.names: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - faas.instance: - enabled: true - faas.max_memory: - enabled: true - faas.name: - enabled: true - faas.version: - enabled: true - max_idle_conns: 100 - openshift: - address: "" - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - k8s.cluster.name: - enabled: true - tls: - ca_file: "" - cert_file: "" - include_system_ca_certs_pool: false - insecure: false - insecure_skip_verify: false - key_file: "" - max_version: "" - min_version: "" - reload_interval: "0s" - server_name_override: "" - token: "" - override: true - proxy_url: "" - read_buffer_size: 0 - system: - resource_attributes: - host.arch: - enabled: false - host.cpu.cache.l2.size: - enabled: false - host.cpu.family: - enabled: false - host.cpu.model.id: - enabled: false - host.cpu.model.name: - enabled: false - host.cpu.stepping: - enabled: false - host.cpu.vendor.id: - enabled: false - host.id: - enabled: false - host.ip: - enabled: false - host.mac: - enabled: false - host.name: - enabled: true - os.description: - enabled: false - os.type: - enabled: true - timeout: 2s - tls: - ca_file: "" - cert_file: "" - include_system_ca_certs_pool: false - insecure: false - insecure_skip_verify: false - key_file: "" - max_version: "" - min_version: "" - reload_interval: "0s" - server_name_override: "" - write_buffer_size: 0 - metricstransform/application_signals: - transforms: - - include: jvm.cpu.recent_utilization - action: update - new_name: JVMCpuRecentUtilization - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.cpu.time - action: update - new_name: JVMCpuTime - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.classes.loaded - action: update - new_name: JVMClassLoaded - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.threads.count - action: update - new_name: JVMThreadCount - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.nonheap.used - action: update - new_name: JVMMemoryNonHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used_after_last_gc - action: update - new_name: JVMMemoryUsedAfterLastGC - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.heap.used - action: update - new_name: JVMMemoryHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryOldGenUsed - match_type: regexp - experimental_match_labels: { "name": '.*Old\\sGen$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemorySurvivorSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Survivor\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryEdenSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Eden\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCDuration - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCCount - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCOldGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCYoungGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCOldGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCYoungGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen0Count - match_type: regexp - experimental_match_labels: { "count": "0" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen1Count - match_type: regexp - experimental_match_labels: { "count": "1" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen2Count - match_type: regexp - experimental_match_labels: { "count": "2" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.thread_count$$ - action: update - new_name: PythonProcessThreadCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu_time$$ - action: update - new_name: PythonProcessCpuTime - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ - action: update - new_name: PythonProcessCpuUtilization - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessVMSMemoryUsed - experimental_match_labels: { "type": "vms" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessRSSMemoryUsed - experimental_match_labels: { "type": "rss" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" -receivers: - awscontainerinsightreceiver: - accelerated_compute_metrics: false - add_container_name_metric_label: false - add_full_pod_name_metric_label: false - add_service_as_attribute: true - certificate_file_path: "" - cluster_name: TestCluster - collection_interval: 30s - container_orchestrator: eks - enable_control_plane_metrics: false - endpoint: "" - host_ip: "" - host_name: "" - imds_retries: 1 - kube_config_path: "" - leader_lock_name: cwagent-clusterleader - leader_lock_using_config_map_only: true - local_mode: false - max_retries: 0 - no_verify_ssl: false - num_workers: 0 - prefer_full_pod_name: false - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 0 - resource_arn: "" - role_arn: "" - otlp/application_signals: - protocols: - grpc: - endpoint: 0.0.0.0:4315 + agenthealth/logs: + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: EKS + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EKS + region_type: ACJ + agenthealth/traces: + is_usage_data_enabled: true + stats: + operations: + - PutTraceSegments + usage_flags: + mode: EKS + region_type: ACJ + awsproxy/application_signals: + aws_endpoint: "" + certificate_file_path: "" dialer: - timeout: "0s" - include_metadata: false - max_concurrent_streams: 0 - max_recv_msg_size_mib: 0 - read_buffer_size: 524288 + timeout: 0s + endpoint: 0.0.0.0:2000 + imds_retries: 1 + local_mode: false + profile: "" + proxy_address: "" + region: us-east-1 + role_arn: "" + service_name: "" + entitystore: + kubernetes_mode: EKS + mode: ec2 + region: us-east-1 + server: + listen_addr: :4311 + tls_ca_path: /etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt + tls_cert_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.crt + tls_key_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.key +processors: + awsapplicationsignals: + limiter: + disabled: false + drop_threshold: 500 + garbage_collection_interval: 10m0s + log_dropped_metrics: true + rotation_interval: 10m0s + resolvers: + - name: TestCluster + platform: eks + awsentity/service/application_signals: + cluster_name: TestCluster + entity_type: Service + kubernetes_mode: EKS + platform: ec2 + batch/containerinsights: + metadata_cardinality_limit: 1000 + send_batch_max_size: 0 + send_batch_size: 8192 + timeout: 5s + metricstransform/application_signals: + transforms: + - action: update + aggregation_type: "" + include: jvm.cpu.recent_utilization + match_type: "" + new_name: JVMCpuRecentUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.cpu.time + match_type: "" + new_name: JVMCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.classes.loaded + match_type: "" + new_name: JVMClassLoaded + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.threads.count + match_type: "" + new_name: JVMThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.nonheap.used + match_type: "" + new_name: JVMMemoryNonHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.pool.used_after_last_gc + match_type: "" + new_name: JVMMemoryUsedAfterLastGC + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.heap.used + match_type: "" + new_name: JVMMemoryHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Old\sGen$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryOldGenUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Survivor\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemorySurvivorSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Eden\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryEdenSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.elapsed + match_type: "" + new_name: JVMGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.count + match_type: "" + new_name: JVMGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCOldGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCYoungGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCOldGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCYoungGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "0" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "1" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "2" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.thread_count$$ + match_type: regexp + new_name: PythonProcessThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu_time$$ + match_type: regexp + new_name: PythonProcessCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + match_type: regexp + new_name: PythonProcessCpuUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: vms + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessVMSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: rss + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessRSSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + resourcedetection: + aks: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + k8s.cluster.name: + enabled: false + azure: + resource_attributes: + azure.resourcegroup.name: + enabled: true + azure.vm.name: + enabled: true + azure.vm.scaleset.name: + enabled: true + azure.vm.size: + enabled: true + cloud.account.id: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + host.id: + enabled: true + host.name: + enabled: true + tags: [] + compression: "" + consul: + address: "" + datacenter: "" + namespace: "" + resource_attributes: + cloud.region: + enabled: true + host.id: + enabled: true + host.name: + enabled: true + token_file: "" + detectors: + - eks + - env + - ec2 + disable_keep_alives: false + docker: + resource_attributes: + host.name: + enabled: true + os.type: + enabled: true + ec2: + resource_attributes: + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + host.id: + enabled: true + host.image.id: + enabled: true + host.name: + enabled: true + host.type: + enabled: true + tags: + - ^kubernetes.io/cluster/.*$ + - ^aws:autoscaling:groupName + ecs: + resource_attributes: + aws.ecs.cluster.arn: + enabled: true + aws.ecs.launchtype: + enabled: true + aws.ecs.task.arn: + enabled: true + aws.ecs.task.family: + enabled: true + aws.ecs.task.id: + enabled: true + aws.ecs.task.revision: + enabled: true + aws.log.group.arns: + enabled: true + aws.log.group.names: + enabled: true + aws.log.stream.arns: + enabled: true + aws.log.stream.names: + enabled: true + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + eks: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + k8s.cluster.name: + enabled: false + elasticbeanstalk: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + deployment.environment: + enabled: true + service.instance.id: + enabled: true + service.version: + enabled: true + endpoint: "" + gcp: + resource_attributes: + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + faas.id: + enabled: true + faas.instance: + enabled: true + faas.name: + enabled: true + faas.version: + enabled: true + gcp.cloud_run.job.execution: + enabled: true + gcp.cloud_run.job.task_index: + enabled: true + gcp.gce.instance.hostname: + enabled: false + gcp.gce.instance.name: + enabled: false + host.id: + enabled: true + host.name: + enabled: true + host.type: + enabled: true + k8s.cluster.name: + enabled: true + heroku: + resource_attributes: + cloud.provider: + enabled: true + heroku.app.id: + enabled: true + heroku.dyno.id: + enabled: true + heroku.release.commit: + enabled: true + heroku.release.creation_timestamp: + enabled: true + service.instance.id: + enabled: true + service.name: + enabled: true + service.version: + enabled: true + http2_ping_timeout: 0s + http2_read_idle_timeout: 0s + idle_conn_timeout: 1m30s + k8snode: + auth_type: serviceAccount + context: "" + kube_config_path: "" + node_from_env_var: "" + resource_attributes: + k8s.node.name: + enabled: true + k8s.node.uid: + enabled: true + lambda: + resource_attributes: + aws.log.group.names: + enabled: true + aws.log.stream.names: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + faas.instance: + enabled: true + faas.max_memory: + enabled: true + faas.name: + enabled: true + faas.version: + enabled: true + max_idle_conns: 100 + openshift: + address: "" + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + k8s.cluster.name: + enabled: true + tls: + ca_file: "" + cert_file: "" + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" + token: "" + override: true + proxy_url: "" + read_buffer_size: 0 + system: + resource_attributes: + host.arch: + enabled: false + host.cpu.cache.l2.size: + enabled: false + host.cpu.family: + enabled: false + host.cpu.model.id: + enabled: false + host.cpu.model.name: + enabled: false + host.cpu.stepping: + enabled: false + host.cpu.vendor.id: + enabled: false + host.id: + enabled: false + host.ip: + enabled: false + host.mac: + enabled: false + host.name: + enabled: true + os.description: + enabled: false + os.type: + enabled: true + timeout: 2s tls: - ca_file: "" - cert_file: path/to/cert.crt - client_ca_file: "" - client_ca_file_reload: false - include_system_ca_certs_pool: false - key_file: path/to/key.key - max_version: "" - min_version: "" - reload_interval: 0s - transport: tcp + ca_file: "" + cert_file: "" + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" write_buffer_size: 0 - http: - endpoint: 0.0.0.0:4316 - include_metadata: false - logs_url_path: /v1/logs - max_request_body_size: 0 - metrics_url_path: /v1/metrics - tls: - ca_file: "" - cert_file: path/to/cert.crt - client_ca_file: "" - client_ca_file_reload: false - key_file: path/to/key.key - max_version: "" - min_version: "" - reload_interval: 0s - include_system_ca_certs_pool: false - traces_url_path: /v1/traces +receivers: + awscontainerinsightreceiver: + accelerated_compute_metrics: false + add_container_name_metric_label: false + add_full_pod_name_metric_label: false + add_service_as_attribute: true + certificate_file_path: "" + cluster_name: TestCluster + collection_interval: 30s + container_orchestrator: eks + enable_control_plane_metrics: false + endpoint: "" + host_ip: "" + host_name: "" + imds_retries: 1 + kube_config_path: "" + leader_lock_name: cwagent-clusterleader + leader_lock_using_config_map_only: true + local_mode: false + max_retries: 0 + no_verify_ssl: false + num_workers: 0 + prefer_full_pod_name: false + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 0 + resource_arn: "" + role_arn: "" + otlp/application_signals: + protocols: + grpc: + dialer: + timeout: 0s + endpoint: 0.0.0.0:4315 + include_metadata: false + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 + tls: + ca_file: "" + cert_file: path/to/cert.crt + client_ca_file: "" + client_ca_file_reload: false + include_system_ca_certs_pool: false + key_file: path/to/key.key + max_version: "" + min_version: "" + reload_interval: 0s + transport: tcp + write_buffer_size: 0 + http: + endpoint: 0.0.0.0:4316 + include_metadata: false + logs_url_path: /v1/logs + max_request_body_size: 0 + metrics_url_path: /v1/metrics + tls: + ca_file: "" + cert_file: path/to/cert.crt + client_ca_file: "" + client_ca_file_reload: false + include_system_ca_certs_pool: false + key_file: path/to/key.key + max_version: "" + min_version: "" + reload_interval: 0s + traces_url_path: /v1/traces service: - extensions: - - awsproxy/application_signals - - agenthealth/traces - - agenthealth/logs - - entitystore - - server - pipelines: - metrics/application_signals: - exporters: - - awsemf/application_signals - processors: - - metricstransform/application_signals - - awsentity/service/application_signals - - resourcedetection - - awsapplicationsignals - receivers: - - otlp/application_signals - metrics/containerinsights: - exporters: - - awsemf/containerinsights - processors: - - batch/containerinsights - receivers: - - awscontainerinsightreceiver - traces/application_signals: - exporters: - - awsxray/application_signals - processors: - - resourcedetection - - awsapplicationsignals - receivers: - - otlp/application_signals - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: {} + extensions: + - agenthealth/logs + - agenthealth/statuscode + - awsproxy/application_signals + - agenthealth/traces + - entitystore + - server + pipelines: + metrics/application_signals: + exporters: + - awsemf/application_signals + processors: + - metricstransform/application_signals + - resourcedetection + - awsapplicationsignals + - awsentity/service/application_signals + receivers: + - otlp/application_signals + metrics/containerinsights: + exporters: + - awsemf/containerinsights + processors: + - batch/containerinsights + receivers: + - awscontainerinsightreceiver + traces/application_signals: + exporters: + - awsxray/application_signals + processors: + - resourcedetection + - awsapplicationsignals + receivers: + - otlp/application_signals + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index 454a1bfa23..3ad6ee7be8 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -1,1294 +1,1315 @@ exporters: - awsemf/application_signals: - certificate_file_path: "" - detailed_metrics: false - dimension_rollup_option: NoDimensionRollup - disable_metric_extraction: false - eks_fargate_container_insights_enabled: false - endpoint: https://fake_endpoint - enhanced_container_insights: false - imds_retries: 1 - local_mode: false - log_group_name: /aws/application-signals/data - log_retention: 0 - log_stream_name: "" - max_retries: 2 - metric_declarations: - - dimensions: - - - Environment - - Operation - - Service - - - Environment - - Service - label_matchers: - - label_names: - - Telemetry.Source - regex: ^(ServerSpan|LocalRootSpan)$ - separator: ; - metric_name_selectors: - - Latency - - Fault - - Error - - dimensions: - - - Environment - - Operation - - RemoteEnvironment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteEnvironment - - RemoteOperation - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteService - - Service - - - Environment - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - - RemoteService - label_matchers: - - label_names: - - Telemetry.Source - regex: ^(ClientSpan|ProducerSpan|ConsumerSpan)$ - separator: ; - metric_name_selectors: - - Latency - - Fault - - Error - - dimensions: - - [ Environment, Service ] - label_matchers: - - label_names: - - Telemetry.Source - regex: '^RuntimeMetric$' - separator: ; - metric_name_selectors: - - '^.*$' - middleware: agenthealth/logs - namespace: ApplicationSignals - no_verify_ssl: false - num_workers: 8 - output_destination: cloudwatch - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - resource_to_telemetry_conversion: - enabled: false - retain_initial_value_of_delta_metric: false - role_arn: "" - version: "1" - awsemf/containerinsights: - certificate_file_path: "" - detailed_metrics: false - dimension_rollup_option: NoDimensionRollup - disable_metric_extraction: true - eks_fargate_container_insights_enabled: false - endpoint: https://fake_endpoint - enhanced_container_insights: false - imds_retries: 1 - local_mode: false - log_group_name: /aws/containerinsights/{ClusterName}/performance - log_retention: 0 - log_stream_name: '{NodeName}' - max_retries: 2 - metric_declarations: - - dimensions: - - - ClusterName - - Namespace - - PodName - - - ClusterName - - - ClusterName - - Namespace - - Service - - - ClusterName - - Namespace - metric_name_selectors: - - pod_cpu_utilization - - pod_memory_utilization - - pod_network_rx_bytes - - pod_network_tx_bytes - - pod_cpu_utilization_over_pod_limit - - pod_memory_utilization_over_pod_limit - - dimensions: - - - ClusterName - - Namespace - - PodName - metric_name_selectors: - - pod_number_of_container_restarts - - dimensions: - - - ClusterName - - Namespace - - PodName - - - ClusterName - metric_name_selectors: - - pod_cpu_reserved_capacity - - pod_memory_reserved_capacity - - dimensions: - - - ClusterName - - InstanceId - - NodeName - - - ClusterName - metric_name_selectors: - - node_cpu_utilization - - node_memory_utilization - - node_network_total_bytes - - node_cpu_reserved_capacity - - node_memory_reserved_capacity - - node_number_of_running_pods - - node_number_of_running_containers - - dimensions: - - - ClusterName - metric_name_selectors: - - node_cpu_usage_total - - node_cpu_limit - - node_memory_working_set - - node_memory_limit - - dimensions: - - - ClusterName - - InstanceId - - NodeName - - - ClusterName - metric_name_selectors: - - node_filesystem_utilization - - dimensions: - - - ClusterName - - Namespace - - Service - - - ClusterName - metric_name_selectors: - - service_number_of_running_pods - - dimensions: - - - ClusterName - - Namespace - - - ClusterName - metric_name_selectors: - - namespace_number_of_running_pods - - dimensions: - - - ClusterName - metric_name_selectors: - - cluster_node_count - - cluster_failed_node_count - middleware: agenthealth/logs - namespace: ContainerInsights - no_verify_ssl: false - num_workers: 8 - output_destination: cloudwatch - parse_json_encoded_attr_values: - - Sources - - kubernetes - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - resource_to_telemetry_conversion: - enabled: true - retain_initial_value_of_delta_metric: false - role_arn: "" - version: "0" - awsxray/application_signals: - certificate_file_path: "" - endpoint: "" - imds_retries: 1 - index_all_attributes: false - indexed_attributes: - - aws.local.service - - aws.local.operation - - aws.local.environment - - aws.remote.service - - aws.remote.operation - - aws.remote.environment - - aws.remote.resource.identifier - - aws.remote.resource.type - local_mode: false - max_retries: 2 - middleware: agenthealth/traces - no_verify_ssl: false - num_workers: 8 - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - role_arn: "" - telemetry: - enabled: true - include_metadata: true + awsemf/application_signals: + certificate_file_path: "" + detailed_metrics: false + dimension_rollup_option: NoDimensionRollup + disable_metric_extraction: false + eks_fargate_container_insights_enabled: false + endpoint: https://fake_endpoint + enhanced_container_insights: false + imds_retries: 1 + local_mode: false + log_group_name: /aws/application-signals/data + log_retention: 0 + log_stream_name: "" + max_retries: 2 + metric_declarations: + - dimensions: + - - Environment + - Operation + - Service + - - Environment + - Service + label_matchers: + - label_names: + - Telemetry.Source + regex: ^(ServerSpan|LocalRootSpan)$ + separator: ; + metric_name_selectors: + - Latency + - Fault + - Error + - dimensions: + - - Environment + - Operation + - RemoteEnvironment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteEnvironment + - RemoteOperation + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteService + - Service + - - Environment + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - - RemoteService + label_matchers: + - label_names: + - Telemetry.Source + regex: ^(ClientSpan|ProducerSpan|ConsumerSpan)$ + separator: ; + metric_name_selectors: + - Latency + - Fault + - Error + - dimensions: + - - Environment + - Service + label_matchers: + - label_names: + - Telemetry.Source + regex: ^RuntimeMetric$ + separator: ; + metric_name_selectors: + - ^.*$ + middleware: agenthealth/logs + namespace: ApplicationSignals + no_verify_ssl: false + num_workers: 8 + output_destination: cloudwatch + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + resource_to_telemetry_conversion: + enabled: false + retain_initial_value_of_delta_metric: false + role_arn: "" + version: "1" + awsemf/containerinsights: + certificate_file_path: "" + detailed_metrics: false + dimension_rollup_option: NoDimensionRollup + disable_metric_extraction: true + eks_fargate_container_insights_enabled: false + endpoint: https://fake_endpoint + enhanced_container_insights: false + imds_retries: 1 + local_mode: false + log_group_name: /aws/containerinsights/{ClusterName}/performance + log_retention: 0 + log_stream_name: '{NodeName}' + max_retries: 2 + metric_declarations: + - dimensions: + - - ClusterName + - Namespace + - PodName + - - ClusterName + - - ClusterName + - Namespace + - Service + - - ClusterName + - Namespace + metric_name_selectors: + - pod_cpu_utilization + - pod_memory_utilization + - pod_network_rx_bytes + - pod_network_tx_bytes + - pod_cpu_utilization_over_pod_limit + - pod_memory_utilization_over_pod_limit + - dimensions: + - - ClusterName + - Namespace + - PodName + metric_name_selectors: + - pod_number_of_container_restarts + - dimensions: + - - ClusterName + - Namespace + - PodName + - - ClusterName + metric_name_selectors: + - pod_cpu_reserved_capacity + - pod_memory_reserved_capacity + - dimensions: + - - ClusterName + - InstanceId + - NodeName + - - ClusterName + metric_name_selectors: + - node_cpu_utilization + - node_memory_utilization + - node_network_total_bytes + - node_cpu_reserved_capacity + - node_memory_reserved_capacity + - node_number_of_running_pods + - node_number_of_running_containers + - dimensions: + - - ClusterName + metric_name_selectors: + - node_cpu_usage_total + - node_cpu_limit + - node_memory_working_set + - node_memory_limit + - dimensions: + - - ClusterName + - InstanceId + - NodeName + - - ClusterName + metric_name_selectors: + - node_filesystem_utilization + - dimensions: + - - ClusterName + - Namespace + - Service + - - ClusterName + metric_name_selectors: + - service_number_of_running_pods + - dimensions: + - - ClusterName + - Namespace + - - ClusterName + metric_name_selectors: + - namespace_number_of_running_pods + - dimensions: + - - ClusterName + metric_name_selectors: + - cluster_node_count + - cluster_failed_node_count + middleware: agenthealth/logs + namespace: ContainerInsights + no_verify_ssl: false + num_workers: 8 + output_destination: cloudwatch + parse_json_encoded_attr_values: + - Sources + - kubernetes + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + resource_to_telemetry_conversion: + enabled: true + retain_initial_value_of_delta_metric: false + role_arn: "" + version: "0" + awsxray/application_signals: + certificate_file_path: "" + endpoint: "" + imds_retries: 1 + index_all_attributes: false + indexed_attributes: + - aws.local.service + - aws.local.operation + - aws.local.environment + - aws.remote.service + - aws.remote.operation + - aws.remote.environment + - aws.remote.resource.identifier + - aws.remote.resource.type + local_mode: false + max_retries: 2 + middleware: agenthealth/traces + no_verify_ssl: false + num_workers: 8 + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + role_arn: "" + telemetry: + enabled: true + include_metadata: true extensions: - agenthealth/logs: - is_usage_data_enabled: true - stats: - operations: - - PutLogEvents - usage_flags: - mode: EKS - region_type: ACJ - agenthealth/traces: - is_usage_data_enabled: true - stats: - operations: - - PutTraceSegments - usage_flags: - mode: EKS - region_type: ACJ - awsproxy/application_signals: - aws_endpoint: "" - dialer: - timeout: "0s" - certificate_file_path: "" - endpoint: 0.0.0.0:2000 - imds_retries: 1 - local_mode: false - profile: "" - proxy_address: "" - region: us-east-1 - service_name: "" - role_arn: "" - entitystore: - mode: ec2 - region: us-east-1 - kubernetes_mode: EKS - server: - listen_addr: :4311 - tls_ca_path: "/etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt" - tls_cert_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.crt" - tls_key_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.key" -processors: - awsapplicationsignals: - limiter: - disabled: false - drop_threshold: 500 - garbage_collection_interval: 10m0s - log_dropped_metrics: true - rotation_interval: 10m0s - resolvers: - - name: TestCluster - platform: eks - awsentity/service/application_signals: - cluster_name: TestCluster - entity_type: Service - kubernetes_mode: EKS - platform: ec2 - batch/containerinsights: - metadata_cardinality_limit: 1000 - send_batch_max_size: 0 - send_batch_size: 8192 - timeout: 5s - resourcedetection: - aks: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - k8s.cluster.name: - enabled: false - azure: - resource_attributes: - azure.resourcegroup.name: - enabled: true - azure.vm.name: - enabled: true - azure.vm.scaleset.name: - enabled: true - azure.vm.size: - enabled: true - cloud.account.id: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - host.id: - enabled: true - host.name: - enabled: true - tags: [] - compression: "" - consul: - address: "" - datacenter: "" - namespace: "" - resource_attributes: - cloud.region: - enabled: true - host.id: - enabled: true - host.name: - enabled: true - token_file: "" - detectors: - - eks - - env - - ec2 - disable_keep_alives: false - docker: - resource_attributes: - host.name: - enabled: true - os.type: - enabled: true - ec2: - resource_attributes: - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - host.id: - enabled: true - host.image.id: - enabled: true - host.name: - enabled: true - host.type: - enabled: true - tags: - - ^kubernetes.io/cluster/.*$ - - ^aws:autoscaling:groupName - ecs: - resource_attributes: - aws.ecs.cluster.arn: - enabled: true - aws.ecs.launchtype: - enabled: true - aws.ecs.task.arn: - enabled: true - aws.ecs.task.family: - enabled: true - aws.ecs.task.revision: - enabled: true - aws.ecs.task.id: - enabled: true - aws.log.group.arns: - enabled: true - aws.log.group.names: - enabled: true - aws.log.stream.arns: - enabled: true - aws.log.stream.names: - enabled: true - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - eks: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - k8s.cluster.name: - enabled: false - elasticbeanstalk: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - deployment.environment: - enabled: true - service.instance.id: - enabled: true - service.version: - enabled: true - endpoint: "" - gcp: - resource_attributes: - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - faas.id: - enabled: true - faas.instance: - enabled: true - faas.name: - enabled: true - faas.version: - enabled: true - gcp.cloud_run.job.execution: - enabled: true - gcp.cloud_run.job.task_index: - enabled: true - gcp.gce.instance.hostname: - enabled: false - gcp.gce.instance.name: - enabled: false - host.id: - enabled: true - host.name: - enabled: true - host.type: - enabled: true - k8s.cluster.name: - enabled: true - heroku: - resource_attributes: - cloud.provider: - enabled: true - heroku.app.id: - enabled: true - heroku.dyno.id: - enabled: true - heroku.release.commit: - enabled: true - heroku.release.creation_timestamp: - enabled: true - service.instance.id: - enabled: true - service.name: - enabled: true - service.version: - enabled: true - http2_ping_timeout: "0s" - http2_read_idle_timeout: "0s" - idle_conn_timeout: 1m30s - k8snode: - auth_type: serviceAccount - context: "" - kube_config_path: "" - node_from_env_var: "" - resource_attributes: - k8s.node.name: - enabled: true - k8s.node.uid: - enabled: true - lambda: - resource_attributes: - aws.log.group.names: - enabled: true - aws.log.stream.names: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - faas.instance: - enabled: true - faas.max_memory: - enabled: true - faas.name: - enabled: true - faas.version: - enabled: true - max_idle_conns: 100 - openshift: - address: "" - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - k8s.cluster.name: - enabled: true - tls: - ca_file: "" - cert_file: "" - include_system_ca_certs_pool: false - insecure: false - insecure_skip_verify: false - key_file: "" - max_version: "" - min_version: "" - reload_interval: "0s" - server_name_override: "" - token: "" - override: true - proxy_url: "" - read_buffer_size: 0 - system: - resource_attributes: - host.arch: - enabled: false - host.cpu.cache.l2.size: - enabled: false - host.cpu.family: - enabled: false - host.cpu.model.id: - enabled: false - host.cpu.model.name: - enabled: false - host.cpu.stepping: - enabled: false - host.cpu.vendor.id: - enabled: false - host.id: - enabled: false - host.ip: - enabled: false - host.mac: - enabled: false - host.name: - enabled: true - os.description: - enabled: false - os.type: - enabled: true - timeout: 2s - tls: - ca_file: "" - cert_file: "" - include_system_ca_certs_pool: false - insecure: false - insecure_skip_verify: false - key_file: "" - max_version: "" - min_version: "" - reload_interval: "0s" - server_name_override: "" - write_buffer_size: 0 - metricstransform/application_signals: - transforms: - - include: jvm.cpu.recent_utilization - action: update - new_name: JVMCpuRecentUtilization - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.cpu.time - action: update - new_name: JVMCpuTime - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.classes.loaded - action: update - new_name: JVMClassLoaded - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.threads.count - action: update - new_name: JVMThreadCount - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.nonheap.used - action: update - new_name: JVMMemoryNonHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used_after_last_gc - action: update - new_name: JVMMemoryUsedAfterLastGC - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.heap.used - action: update - new_name: JVMMemoryHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryOldGenUsed - match_type: regexp - experimental_match_labels: { "name": '.*Old\\sGen$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemorySurvivorSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Survivor\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryEdenSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Eden\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCDuration - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCCount - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCOldGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCYoungGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCOldGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCYoungGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen0Count - match_type: regexp - experimental_match_labels: { "count": "0" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen1Count - match_type: regexp - experimental_match_labels: { "count": "1" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen2Count - match_type: regexp - experimental_match_labels: { "count": "2" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.thread_count$$ - action: update - new_name: PythonProcessThreadCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu_time$$ - action: update - new_name: PythonProcessCpuTime - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ - action: update - new_name: PythonProcessCpuUtilization - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessVMSMemoryUsed - experimental_match_labels: { "type": "vms" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessRSSMemoryUsed - experimental_match_labels: { "type": "rss" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" -receivers: - awscontainerinsightreceiver: - accelerated_compute_metrics: false - add_container_name_metric_label: false - add_full_pod_name_metric_label: false - add_service_as_attribute: true - certificate_file_path: "" - cluster_name: TestCluster - collection_interval: 30s - container_orchestrator: eks - enable_control_plane_metrics: false - endpoint: "" - host_ip: "" - host_name: "" - imds_retries: 1 - kube_config_path: "" - leader_lock_name: cwagent-clusterleader - leader_lock_using_config_map_only: true - local_mode: false - max_retries: 0 - no_verify_ssl: false - num_workers: 0 - prefer_full_pod_name: false - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 0 - resource_arn: "" - role_arn: "" - otlp/application_signals: - protocols: - grpc: - endpoint: 0.0.0.0:4315 + agenthealth/logs: + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: EKS + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EKS + region_type: ACJ + agenthealth/traces: + is_usage_data_enabled: true + stats: + operations: + - PutTraceSegments + usage_flags: + mode: EKS + region_type: ACJ + awsproxy/application_signals: + aws_endpoint: "" + certificate_file_path: "" dialer: - timeout: "0s" - include_metadata: false - max_concurrent_streams: 0 - max_recv_msg_size_mib: 0 - read_buffer_size: 524288 + timeout: 0s + endpoint: 0.0.0.0:2000 + imds_retries: 1 + local_mode: false + profile: "" + proxy_address: "" + region: us-east-1 + role_arn: "" + service_name: "" + entitystore: + kubernetes_mode: EKS + mode: ec2 + region: us-east-1 + server: + listen_addr: :4311 + tls_ca_path: /etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt + tls_cert_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.crt + tls_key_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.key +processors: + awsapplicationsignals: + limiter: + disabled: false + drop_threshold: 500 + garbage_collection_interval: 10m0s + log_dropped_metrics: true + rotation_interval: 10m0s + resolvers: + - name: TestCluster + platform: eks + awsentity/service/application_signals: + cluster_name: TestCluster + entity_type: Service + kubernetes_mode: EKS + platform: ec2 + batch/containerinsights: + metadata_cardinality_limit: 1000 + send_batch_max_size: 0 + send_batch_size: 8192 + timeout: 5s + metricstransform/application_signals: + transforms: + - action: update + aggregation_type: "" + include: jvm.cpu.recent_utilization + match_type: "" + new_name: JVMCpuRecentUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.cpu.time + match_type: "" + new_name: JVMCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.classes.loaded + match_type: "" + new_name: JVMClassLoaded + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.threads.count + match_type: "" + new_name: JVMThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.nonheap.used + match_type: "" + new_name: JVMMemoryNonHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.pool.used_after_last_gc + match_type: "" + new_name: JVMMemoryUsedAfterLastGC + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.heap.used + match_type: "" + new_name: JVMMemoryHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Old\sGen$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryOldGenUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Survivor\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemorySurvivorSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Eden\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryEdenSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.elapsed + match_type: "" + new_name: JVMGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.count + match_type: "" + new_name: JVMGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCOldGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCYoungGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCOldGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCYoungGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "0" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "1" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "2" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.thread_count$$ + match_type: regexp + new_name: PythonProcessThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu_time$$ + match_type: regexp + new_name: PythonProcessCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + match_type: regexp + new_name: PythonProcessCpuUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: vms + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessVMSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: rss + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessRSSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + resourcedetection: + aks: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + k8s.cluster.name: + enabled: false + azure: + resource_attributes: + azure.resourcegroup.name: + enabled: true + azure.vm.name: + enabled: true + azure.vm.scaleset.name: + enabled: true + azure.vm.size: + enabled: true + cloud.account.id: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + host.id: + enabled: true + host.name: + enabled: true + tags: [] + compression: "" + consul: + address: "" + datacenter: "" + namespace: "" + resource_attributes: + cloud.region: + enabled: true + host.id: + enabled: true + host.name: + enabled: true + token_file: "" + detectors: + - eks + - env + - ec2 + disable_keep_alives: false + docker: + resource_attributes: + host.name: + enabled: true + os.type: + enabled: true + ec2: + resource_attributes: + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + host.id: + enabled: true + host.image.id: + enabled: true + host.name: + enabled: true + host.type: + enabled: true + tags: + - ^kubernetes.io/cluster/.*$ + - ^aws:autoscaling:groupName + ecs: + resource_attributes: + aws.ecs.cluster.arn: + enabled: true + aws.ecs.launchtype: + enabled: true + aws.ecs.task.arn: + enabled: true + aws.ecs.task.family: + enabled: true + aws.ecs.task.id: + enabled: true + aws.ecs.task.revision: + enabled: true + aws.log.group.arns: + enabled: true + aws.log.group.names: + enabled: true + aws.log.stream.arns: + enabled: true + aws.log.stream.names: + enabled: true + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + eks: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + k8s.cluster.name: + enabled: false + elasticbeanstalk: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + deployment.environment: + enabled: true + service.instance.id: + enabled: true + service.version: + enabled: true + endpoint: "" + gcp: + resource_attributes: + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + faas.id: + enabled: true + faas.instance: + enabled: true + faas.name: + enabled: true + faas.version: + enabled: true + gcp.cloud_run.job.execution: + enabled: true + gcp.cloud_run.job.task_index: + enabled: true + gcp.gce.instance.hostname: + enabled: false + gcp.gce.instance.name: + enabled: false + host.id: + enabled: true + host.name: + enabled: true + host.type: + enabled: true + k8s.cluster.name: + enabled: true + heroku: + resource_attributes: + cloud.provider: + enabled: true + heroku.app.id: + enabled: true + heroku.dyno.id: + enabled: true + heroku.release.commit: + enabled: true + heroku.release.creation_timestamp: + enabled: true + service.instance.id: + enabled: true + service.name: + enabled: true + service.version: + enabled: true + http2_ping_timeout: 0s + http2_read_idle_timeout: 0s + idle_conn_timeout: 1m30s + k8snode: + auth_type: serviceAccount + context: "" + kube_config_path: "" + node_from_env_var: "" + resource_attributes: + k8s.node.name: + enabled: true + k8s.node.uid: + enabled: true + lambda: + resource_attributes: + aws.log.group.names: + enabled: true + aws.log.stream.names: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + faas.instance: + enabled: true + faas.max_memory: + enabled: true + faas.name: + enabled: true + faas.version: + enabled: true + max_idle_conns: 100 + openshift: + address: "" + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + k8s.cluster.name: + enabled: true + tls: + ca_file: "" + cert_file: "" + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" + token: "" + override: true + proxy_url: "" + read_buffer_size: 0 + system: + resource_attributes: + host.arch: + enabled: false + host.cpu.cache.l2.size: + enabled: false + host.cpu.family: + enabled: false + host.cpu.model.id: + enabled: false + host.cpu.model.name: + enabled: false + host.cpu.stepping: + enabled: false + host.cpu.vendor.id: + enabled: false + host.id: + enabled: false + host.ip: + enabled: false + host.mac: + enabled: false + host.name: + enabled: true + os.description: + enabled: false + os.type: + enabled: true + timeout: 2s tls: - ca_file: "" - cert_file: path/to/cert.crt - client_ca_file: "" - client_ca_file_reload: false - include_system_ca_certs_pool: false - key_file: path/to/key.key - max_version: "" - min_version: "" - reload_interval: 0s - transport: tcp + ca_file: "" + cert_file: "" + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" write_buffer_size: 0 - http: - endpoint: 0.0.0.0:4316 - include_metadata: false - logs_url_path: /v1/logs - max_request_body_size: 0 - metrics_url_path: /v1/metrics - tls: - ca_file: "" - cert_file: path/to/cert.crt - client_ca_file: "" - client_ca_file_reload: false - include_system_ca_certs_pool: false - key_file: path/to/key.key - max_version: "" - min_version: "" - reload_interval: 0s - traces_url_path: /v1/traces +receivers: + awscontainerinsightreceiver: + accelerated_compute_metrics: false + add_container_name_metric_label: false + add_full_pod_name_metric_label: false + add_service_as_attribute: true + certificate_file_path: "" + cluster_name: TestCluster + collection_interval: 30s + container_orchestrator: eks + enable_control_plane_metrics: false + endpoint: "" + host_ip: "" + host_name: "" + imds_retries: 1 + kube_config_path: "" + leader_lock_name: cwagent-clusterleader + leader_lock_using_config_map_only: true + local_mode: false + max_retries: 0 + no_verify_ssl: false + num_workers: 0 + prefer_full_pod_name: false + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 0 + resource_arn: "" + role_arn: "" + otlp/application_signals: + protocols: + grpc: + dialer: + timeout: 0s + endpoint: 0.0.0.0:4315 + include_metadata: false + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 + tls: + ca_file: "" + cert_file: path/to/cert.crt + client_ca_file: "" + client_ca_file_reload: false + include_system_ca_certs_pool: false + key_file: path/to/key.key + max_version: "" + min_version: "" + reload_interval: 0s + transport: tcp + write_buffer_size: 0 + http: + endpoint: 0.0.0.0:4316 + include_metadata: false + logs_url_path: /v1/logs + max_request_body_size: 0 + metrics_url_path: /v1/metrics + tls: + ca_file: "" + cert_file: path/to/cert.crt + client_ca_file: "" + client_ca_file_reload: false + include_system_ca_certs_pool: false + key_file: path/to/key.key + max_version: "" + min_version: "" + reload_interval: 0s + traces_url_path: /v1/traces service: - extensions: - - awsproxy/application_signals - - agenthealth/traces - - agenthealth/logs - - entitystore - - server - pipelines: - metrics/application_signals: - exporters: - - awsemf/application_signals - processors: - - metricstransform/application_signals - - awsentity/service/application_signals - - resourcedetection - - awsapplicationsignals - receivers: - - otlp/application_signals - metrics/containerinsights: - exporters: - - awsemf/containerinsights - processors: - - batch/containerinsights - receivers: - - awscontainerinsightreceiver - traces/application_signals: - exporters: - - awsxray/application_signals - processors: - - resourcedetection - - awsapplicationsignals - receivers: - - otlp/application_signals - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: {} + extensions: + - agenthealth/logs + - agenthealth/statuscode + - awsproxy/application_signals + - agenthealth/traces + - entitystore + - server + pipelines: + metrics/application_signals: + exporters: + - awsemf/application_signals + processors: + - metricstransform/application_signals + - resourcedetection + - awsapplicationsignals + - awsentity/service/application_signals + receivers: + - otlp/application_signals + metrics/containerinsights: + exporters: + - awsemf/containerinsights + processors: + - batch/containerinsights + receivers: + - awscontainerinsightreceiver + traces/application_signals: + exporters: + - awsxray/application_signals + processors: + - resourcedetection + - awsapplicationsignals + receivers: + - otlp/application_signals + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 84aa3bac0f..2f8b79e011 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -104,14 +104,15 @@ exporters: - Fault - Error - dimensions: - - [ Environment, Service ] + - - Environment + - Service label_matchers: - - label_names: - - Telemetry.Source - regex: '^RuntimeMetric$' - separator: ; + - label_names: + - Telemetry.Source + regex: ^RuntimeMetric$ + separator: ; metric_name_selectors: - - '^.*$' + - ^.*$ middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -172,6 +173,13 @@ extensions: usage_flags: mode: OP region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: OP + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -205,6 +213,582 @@ processors: resolvers: - name: "" platform: generic + metricstransform/application_signals: + transforms: + - action: update + aggregation_type: "" + include: jvm.cpu.recent_utilization + match_type: "" + new_name: JVMCpuRecentUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.cpu.time + match_type: "" + new_name: JVMCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.classes.loaded + match_type: "" + new_name: JVMClassLoaded + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.threads.count + match_type: "" + new_name: JVMThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.nonheap.used + match_type: "" + new_name: JVMMemoryNonHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.pool.used_after_last_gc + match_type: "" + new_name: JVMMemoryUsedAfterLastGC + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.heap.used + match_type: "" + new_name: JVMMemoryHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Old\sGen$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryOldGenUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Survivor\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemorySurvivorSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Eden\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryEdenSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.elapsed + match_type: "" + new_name: JVMGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.count + match_type: "" + new_name: JVMGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCOldGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCYoungGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCOldGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCYoungGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "0" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "1" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "2" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.thread_count$$ + match_type: regexp + new_name: PythonProcessThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu_time$$ + match_type: regexp + new_name: PythonProcessCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + match_type: regexp + new_name: PythonProcessCpuUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: vms + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessVMSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: rss + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessRSSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: @@ -492,570 +1076,6 @@ processors: reload_interval: 0s server_name_override: "" write_buffer_size: 0 - metricstransform/application_signals: - transforms: - - include: jvm.cpu.recent_utilization - action: update - new_name: JVMCpuRecentUtilization - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.cpu.time - action: update - new_name: JVMCpuTime - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.classes.loaded - action: update - new_name: JVMClassLoaded - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.threads.count - action: update - new_name: JVMThreadCount - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.nonheap.used - action: update - new_name: JVMMemoryNonHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used_after_last_gc - action: update - new_name: JVMMemoryUsedAfterLastGC - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.heap.used - action: update - new_name: JVMMemoryHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryOldGenUsed - match_type: regexp - experimental_match_labels: { "name": '.*Old\\sGen$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemorySurvivorSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Survivor\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryEdenSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Eden\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCDuration - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCCount - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCOldGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCYoungGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCOldGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCYoungGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen0Count - match_type: regexp - experimental_match_labels: { "count": "0" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen1Count - match_type: regexp - experimental_match_labels: { "count": "1" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen2Count - match_type: regexp - experimental_match_labels: { "count": "2" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.thread_count$$ - action: update - new_name: PythonProcessThreadCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu_time$$ - action: update - new_name: PythonProcessCpuTime - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ - action: update - new_name: PythonProcessCpuUtilization - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessVMSMemoryUsed - experimental_match_labels: { "type": "vms" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessRSSMemoryUsed - experimental_match_labels: { "type": "rss" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" receivers: otlp/application_signals: protocols: @@ -1080,6 +1100,7 @@ service: extensions: - awsproxy/application_signals - agenthealth/traces + - agenthealth/statuscode - agenthealth/logs - entitystore pipelines: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index ddb31057dd..0820331549 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -1,1116 +1,1137 @@ exporters: - awsemf/application_signals: - certificate_file_path: "" - detailed_metrics: false - dimension_rollup_option: NoDimensionRollup - disable_metric_extraction: false - eks_fargate_container_insights_enabled: false - endpoint: https://fake_endpoint - enhanced_container_insights: false - imds_retries: 1 - local_mode: true - log_group_name: /aws/application-signals/data - log_retention: 0 - log_stream_name: "" - max_retries: 2 - metric_declarations: - - dimensions: - - - Environment - - Operation - - Service - - - Environment - - Service - label_matchers: - - label_names: - - Telemetry.Source - regex: ^(ServerSpan|LocalRootSpan)$ - separator: ; - metric_name_selectors: - - Latency - - Fault - - Error - - dimensions: - - - Environment - - Operation - - RemoteEnvironment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteEnvironment - - RemoteOperation - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteService - - Service - - - Environment - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteEnvironment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - - RemoteService - label_matchers: - - label_names: - - Telemetry.Source - regex: ^(ClientSpan|ProducerSpan|ConsumerSpan)$ - separator: ; - metric_name_selectors: - - Latency - - Fault - - Error - - dimensions: - - [ Environment, Service ] - label_matchers: - - label_names: - - Telemetry.Source - regex: '^RuntimeMetric$' - separator: ; - metric_name_selectors: - - '^.*$' - middleware: agenthealth/logs - namespace: ApplicationSignals - no_verify_ssl: false - num_workers: 8 - output_destination: cloudwatch - profile: AmazonCloudWatchAgent - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - resource_to_telemetry_conversion: - enabled: false - retain_initial_value_of_delta_metric: false - role_arn: "" - shared_credentials_file: - - fake-path - version: "1" - awsxray/application_signals: - certificate_file_path: "" - endpoint: https://fake_endpoint - imds_retries: 1 - index_all_attributes: false - indexed_attributes: - - aws.local.service - - aws.local.operation - - aws.local.environment - - aws.remote.service - - aws.remote.operation - - aws.remote.environment - - aws.remote.resource.identifier - - aws.remote.resource.type - local_mode: true - max_retries: 2 - middleware: agenthealth/traces - no_verify_ssl: false - num_workers: 8 - profile: AmazonCloudWatchAgent - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - role_arn: "" - shared_credentials_file: - - fake-path - telemetry: - enabled: true - include_metadata: true + awsemf/application_signals: + certificate_file_path: "" + detailed_metrics: false + dimension_rollup_option: NoDimensionRollup + disable_metric_extraction: false + eks_fargate_container_insights_enabled: false + endpoint: https://fake_endpoint + enhanced_container_insights: false + imds_retries: 1 + local_mode: true + log_group_name: /aws/application-signals/data + log_retention: 0 + log_stream_name: "" + max_retries: 2 + metric_declarations: + - dimensions: + - - Environment + - Operation + - Service + - - Environment + - Service + label_matchers: + - label_names: + - Telemetry.Source + regex: ^(ServerSpan|LocalRootSpan)$ + separator: ; + metric_name_selectors: + - Latency + - Fault + - Error + - dimensions: + - - Environment + - Operation + - RemoteEnvironment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteEnvironment + - RemoteOperation + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteService + - Service + - - Environment + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - RemoteEnvironment + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - RemoteOperation + - RemoteService + - Service + - - Environment + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - - RemoteService + label_matchers: + - label_names: + - Telemetry.Source + regex: ^(ClientSpan|ProducerSpan|ConsumerSpan)$ + separator: ; + metric_name_selectors: + - Latency + - Fault + - Error + - dimensions: + - - Environment + - Service + label_matchers: + - label_names: + - Telemetry.Source + regex: ^RuntimeMetric$ + separator: ; + metric_name_selectors: + - ^.*$ + middleware: agenthealth/logs + namespace: ApplicationSignals + no_verify_ssl: false + num_workers: 8 + output_destination: cloudwatch + profile: AmazonCloudWatchAgent + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + resource_to_telemetry_conversion: + enabled: false + retain_initial_value_of_delta_metric: false + role_arn: "" + shared_credentials_file: + - fake-path + version: "1" + awsxray/application_signals: + certificate_file_path: "" + endpoint: https://fake_endpoint + imds_retries: 1 + index_all_attributes: false + indexed_attributes: + - aws.local.service + - aws.local.operation + - aws.local.environment + - aws.remote.service + - aws.remote.operation + - aws.remote.environment + - aws.remote.resource.identifier + - aws.remote.resource.type + local_mode: true + max_retries: 2 + middleware: agenthealth/traces + no_verify_ssl: false + num_workers: 8 + profile: AmazonCloudWatchAgent + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + role_arn: "" + shared_credentials_file: + - fake-path + telemetry: + enabled: true + include_metadata: true extensions: - agenthealth/logs: - is_usage_data_enabled: true - stats: - operations: - - PutLogEvents - usage_flags: - mode: OP - region_type: ACJ - agenthealth/traces: - is_usage_data_enabled: true - stats: - operations: - - PutTraceSegments - usage_flags: - mode: OP - region_type: ACJ - awsproxy/application_signals: - aws_endpoint: https://fake_endpoint - dialer: - timeout: "0s" - certificate_file_path: "" - endpoint: 0.0.0.0:2000 - imds_retries: 1 - local_mode: true - profile: AmazonCloudWatchAgent - proxy_address: "" - region: us-east-1 - role_arn: "" - service_name: "" - shared_credentials_file: - - fake-path - entitystore: - mode: onPremise - profile: AmazonCloudWatchAgent - region: us-east-1 - shared_credential_file: fake-path -processors: - awsapplicationsignals: - resolvers: - - name: "" - platform: generic - resourcedetection: - aks: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - k8s.cluster.name: - enabled: false - azure: - resource_attributes: - azure.resourcegroup.name: - enabled: true - azure.vm.name: - enabled: true - azure.vm.scaleset.name: - enabled: true - azure.vm.size: - enabled: true - cloud.account.id: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - host.id: - enabled: true - host.name: - enabled: true - tags: [] - compression: "" - consul: - address: "" - datacenter: "" - namespace: "" - resource_attributes: - cloud.region: - enabled: true - host.id: - enabled: true - host.name: - enabled: true - token_file: "" - detectors: - - eks - - env - - ec2 - disable_keep_alives: false - docker: - resource_attributes: - host.name: - enabled: true - os.type: - enabled: true - ec2: - resource_attributes: - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - host.id: - enabled: true - host.image.id: - enabled: true - host.name: - enabled: true - host.type: - enabled: true - tags: - - ^kubernetes.io/cluster/.*$ - - ^aws:autoscaling:groupName - ecs: - resource_attributes: - aws.ecs.cluster.arn: - enabled: true - aws.ecs.launchtype: - enabled: true - aws.ecs.task.arn: - enabled: true - aws.ecs.task.family: - enabled: true - aws.ecs.task.id: - enabled: true - aws.ecs.task.revision: - enabled: true - aws.log.group.arns: - enabled: true - aws.log.group.names: - enabled: true - aws.log.stream.arns: - enabled: true - aws.log.stream.names: - enabled: true - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - eks: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - k8s.cluster.name: - enabled: false - elasticbeanstalk: - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - deployment.environment: - enabled: true - service.instance.id: - enabled: true - service.version: - enabled: true - endpoint: "" - gcp: - resource_attributes: - cloud.account.id: - enabled: true - cloud.availability_zone: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - faas.id: - enabled: true - faas.instance: - enabled: true - faas.name: - enabled: true - faas.version: - enabled: true - gcp.cloud_run.job.execution: - enabled: true - gcp.cloud_run.job.task_index: - enabled: true - gcp.gce.instance.hostname: - enabled: false - gcp.gce.instance.name: - enabled: false - host.id: - enabled: true - host.name: - enabled: true - host.type: - enabled: true - k8s.cluster.name: - enabled: true - heroku: - resource_attributes: - cloud.provider: - enabled: true - heroku.app.id: - enabled: true - heroku.dyno.id: - enabled: true - heroku.release.commit: - enabled: true - heroku.release.creation_timestamp: - enabled: true - service.instance.id: - enabled: true - service.name: - enabled: true - service.version: - enabled: true - http2_ping_timeout: "0s" - http2_read_idle_timeout: "0s" - idle_conn_timeout: 1m30s - k8snode: - auth_type: serviceAccount - context: "" - kube_config_path: "" - node_from_env_var: "" - resource_attributes: - k8s.node.name: - enabled: true - k8s.node.uid: - enabled: true - lambda: - resource_attributes: - aws.log.group.names: - enabled: true - aws.log.stream.names: - enabled: true - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - faas.instance: - enabled: true - faas.max_memory: - enabled: true - faas.name: - enabled: true - faas.version: - enabled: true - max_idle_conns: 100 - openshift: - address: "" - resource_attributes: - cloud.platform: - enabled: true - cloud.provider: - enabled: true - cloud.region: - enabled: true - k8s.cluster.name: - enabled: true - tls: - ca_file: "" - cert_file: "" - include_system_ca_certs_pool: false - insecure: false - insecure_skip_verify: false - key_file: "" - max_version: "" - min_version: "" - reload_interval: "0s" - server_name_override: "" - token: "" - override: true - proxy_url: "" - read_buffer_size: 0 - system: - resource_attributes: - host.arch: - enabled: false - host.cpu.cache.l2.size: - enabled: false - host.cpu.family: - enabled: false - host.cpu.model.id: - enabled: false - host.cpu.model.name: - enabled: false - host.cpu.stepping: - enabled: false - host.cpu.vendor.id: - enabled: false - host.id: - enabled: false - host.ip: - enabled: false - host.mac: - enabled: false - host.name: - enabled: true - os.description: - enabled: false - os.type: - enabled: true - timeout: 2s - tls: - ca_file: "" - cert_file: "" - include_system_ca_certs_pool: false - insecure: false - insecure_skip_verify: false - key_file: "" - max_version: "" - min_version: "" - reload_interval: "0s" - server_name_override: "" - write_buffer_size: 0 - metricstransform/application_signals: - transforms: - - include: jvm.cpu.recent_utilization - action: update - new_name: JVMCpuRecentUtilization - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.cpu.time - action: update - new_name: JVMCpuTime - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.classes.loaded - action: update - new_name: JVMClassLoaded - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.threads.count - action: update - new_name: JVMThreadCount - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.nonheap.used - action: update - new_name: JVMMemoryNonHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used_after_last_gc - action: update - new_name: JVMMemoryUsedAfterLastGC - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.heap.used - action: update - new_name: JVMMemoryHeapUsed - aggregation_type: "" - submatch_case: "" - match_type: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryOldGenUsed - match_type: regexp - experimental_match_labels: { "name": '.*Old\\sGen$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemorySurvivorSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Survivor\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.memory.pool.used - action: insert - new_name: JVMMemoryEdenSpaceUsed - match_type: regexp - experimental_match_labels: { "name": '.*Eden\\sSpace$' } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCDuration - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCCount - match_type: "" - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCOldGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.elapsed - action: insert - new_name: JVMGCYoungGenDuration - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCOldGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Old Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: jvm.gc.collections.count - action: insert - new_name: JVMGCYoungGenCount - match_type: strict - experimental_match_labels: { "name": "G1 Young Generation" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen0Count - match_type: regexp - experimental_match_labels: { "count": "0" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen1Count - match_type: regexp - experimental_match_labels: { "count": "1" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.gc_count$$ - action: insert - new_name: PythonProcessGCGen2Count - match_type: regexp - experimental_match_labels: { "count": "2" } - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.thread_count$$ - action: update - new_name: PythonProcessThreadCount - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu_time$$ - action: update - new_name: PythonProcessCpuTime - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.cpu\.utilization$$ - action: update - new_name: PythonProcessCpuUtilization - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessVMSMemoryUsed - experimental_match_labels: { "type": "vms" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - - include: ^process\.runtime\.(.*)\.memory$$ - action: insert - new_name: PythonProcessRSSMemoryUsed - experimental_match_labels: { "type": "rss" } - match_type: regexp - aggregation_type: "" - submatch_case: "" - operations: - - action: aggregate_labels - label_set: [ ] - aggregation_type: sum - experimental_scale: 0 - label: "" - new_label: "" - label_value: "" - new_value: "" - - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" -receivers: - otlp/application_signals: - protocols: - grpc: + agenthealth/logs: + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: OP + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: OP + region_type: ACJ + agenthealth/traces: + is_usage_data_enabled: true + stats: + operations: + - PutTraceSegments + usage_flags: + mode: OP + region_type: ACJ + awsproxy/application_signals: + aws_endpoint: https://fake_endpoint + certificate_file_path: "" dialer: - timeout: "0s" - endpoint: 0.0.0.0:4315 - include_metadata: false - max_concurrent_streams: 0 - max_recv_msg_size_mib: 0 - read_buffer_size: 524288 - transport: tcp + timeout: 0s + endpoint: 0.0.0.0:2000 + imds_retries: 1 + local_mode: true + profile: AmazonCloudWatchAgent + proxy_address: "" + region: us-east-1 + role_arn: "" + service_name: "" + shared_credentials_file: + - fake-path + entitystore: + mode: onPremise + profile: AmazonCloudWatchAgent + region: us-east-1 + shared_credential_file: fake-path +processors: + awsapplicationsignals: + resolvers: + - name: "" + platform: generic + metricstransform/application_signals: + transforms: + - action: update + aggregation_type: "" + include: jvm.cpu.recent_utilization + match_type: "" + new_name: JVMCpuRecentUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.cpu.time + match_type: "" + new_name: JVMCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.classes.loaded + match_type: "" + new_name: JVMClassLoaded + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.threads.count + match_type: "" + new_name: JVMThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.nonheap.used + match_type: "" + new_name: JVMMemoryNonHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.pool.used_after_last_gc + match_type: "" + new_name: JVMMemoryUsedAfterLastGC + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: jvm.memory.heap.used + match_type: "" + new_name: JVMMemoryHeapUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Old\sGen$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryOldGenUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Survivor\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemorySurvivorSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: .*Eden\sSpace$ + include: jvm.memory.pool.used + match_type: regexp + new_name: JVMMemoryEdenSpaceUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.elapsed + match_type: "" + new_name: JVMGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: jvm.gc.collections.count + match_type: "" + new_name: JVMGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCOldGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.elapsed + match_type: strict + new_name: JVMGCYoungGenDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Old Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCOldGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + name: G1 Young Generation + include: jvm.gc.collections.count + match_type: strict + new_name: JVMGCYoungGenCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "0" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "1" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + count: "2" + include: ^process\.runtime\.(.*)\.gc_count$$ + match_type: regexp + new_name: PythonProcessGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.thread_count$$ + match_type: regexp + new_name: PythonProcessThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu_time$$ + match_type: regexp + new_name: PythonProcessCpuTime + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: ^process\.runtime\.(.*)\.cpu\.utilization$$ + match_type: regexp + new_name: PythonProcessCpuUtilization + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: vms + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessVMSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + type: rss + include: ^process\.runtime\.(.*)\.memory$$ + match_type: regexp + new_name: PythonProcessRSSMemoryUsed + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + resourcedetection: + aks: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + k8s.cluster.name: + enabled: false + azure: + resource_attributes: + azure.resourcegroup.name: + enabled: true + azure.vm.name: + enabled: true + azure.vm.scaleset.name: + enabled: true + azure.vm.size: + enabled: true + cloud.account.id: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + host.id: + enabled: true + host.name: + enabled: true + tags: [] + compression: "" + consul: + address: "" + datacenter: "" + namespace: "" + resource_attributes: + cloud.region: + enabled: true + host.id: + enabled: true + host.name: + enabled: true + token_file: "" + detectors: + - eks + - env + - ec2 + disable_keep_alives: false + docker: + resource_attributes: + host.name: + enabled: true + os.type: + enabled: true + ec2: + resource_attributes: + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + host.id: + enabled: true + host.image.id: + enabled: true + host.name: + enabled: true + host.type: + enabled: true + tags: + - ^kubernetes.io/cluster/.*$ + - ^aws:autoscaling:groupName + ecs: + resource_attributes: + aws.ecs.cluster.arn: + enabled: true + aws.ecs.launchtype: + enabled: true + aws.ecs.task.arn: + enabled: true + aws.ecs.task.family: + enabled: true + aws.ecs.task.id: + enabled: true + aws.ecs.task.revision: + enabled: true + aws.log.group.arns: + enabled: true + aws.log.group.names: + enabled: true + aws.log.stream.arns: + enabled: true + aws.log.stream.names: + enabled: true + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + eks: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + k8s.cluster.name: + enabled: false + elasticbeanstalk: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + deployment.environment: + enabled: true + service.instance.id: + enabled: true + service.version: + enabled: true + endpoint: "" + gcp: + resource_attributes: + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + faas.id: + enabled: true + faas.instance: + enabled: true + faas.name: + enabled: true + faas.version: + enabled: true + gcp.cloud_run.job.execution: + enabled: true + gcp.cloud_run.job.task_index: + enabled: true + gcp.gce.instance.hostname: + enabled: false + gcp.gce.instance.name: + enabled: false + host.id: + enabled: true + host.name: + enabled: true + host.type: + enabled: true + k8s.cluster.name: + enabled: true + heroku: + resource_attributes: + cloud.provider: + enabled: true + heroku.app.id: + enabled: true + heroku.dyno.id: + enabled: true + heroku.release.commit: + enabled: true + heroku.release.creation_timestamp: + enabled: true + service.instance.id: + enabled: true + service.name: + enabled: true + service.version: + enabled: true + http2_ping_timeout: 0s + http2_read_idle_timeout: 0s + idle_conn_timeout: 1m30s + k8snode: + auth_type: serviceAccount + context: "" + kube_config_path: "" + node_from_env_var: "" + resource_attributes: + k8s.node.name: + enabled: true + k8s.node.uid: + enabled: true + lambda: + resource_attributes: + aws.log.group.names: + enabled: true + aws.log.stream.names: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + faas.instance: + enabled: true + faas.max_memory: + enabled: true + faas.name: + enabled: true + faas.version: + enabled: true + max_idle_conns: 100 + openshift: + address: "" + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + k8s.cluster.name: + enabled: true + tls: + ca_file: "" + cert_file: "" + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" + token: "" + override: true + proxy_url: "" + read_buffer_size: 0 + system: + resource_attributes: + host.arch: + enabled: false + host.cpu.cache.l2.size: + enabled: false + host.cpu.family: + enabled: false + host.cpu.model.id: + enabled: false + host.cpu.model.name: + enabled: false + host.cpu.stepping: + enabled: false + host.cpu.vendor.id: + enabled: false + host.id: + enabled: false + host.ip: + enabled: false + host.mac: + enabled: false + host.name: + enabled: true + os.description: + enabled: false + os.type: + enabled: true + timeout: 2s + tls: + ca_file: "" + cert_file: "" + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" write_buffer_size: 0 - http: - endpoint: 0.0.0.0:4316 - include_metadata: false - logs_url_path: /v1/logs - max_request_body_size: 0 - metrics_url_path: /v1/metrics - traces_url_path: /v1/traces +receivers: + otlp/application_signals: + protocols: + grpc: + dialer: + timeout: 0s + endpoint: 0.0.0.0:4315 + include_metadata: false + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 + transport: tcp + write_buffer_size: 0 + http: + endpoint: 0.0.0.0:4316 + include_metadata: false + logs_url_path: /v1/logs + max_request_body_size: 0 + metrics_url_path: /v1/metrics + traces_url_path: /v1/traces service: - extensions: - - awsproxy/application_signals - - agenthealth/traces - - agenthealth/logs - - entitystore - pipelines: - metrics/application_signals: - exporters: - - awsemf/application_signals - processors: - - metricstransform/application_signals - - resourcedetection - - awsapplicationsignals - receivers: - - otlp/application_signals - traces/application_signals: - exporters: - - awsxray/application_signals - processors: - - resourcedetection - - awsapplicationsignals - receivers: - - otlp/application_signals - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: {} + extensions: + - awsproxy/application_signals + - agenthealth/traces + - agenthealth/statuscode + - agenthealth/logs + - entitystore + pipelines: + metrics/application_signals: + exporters: + - awsemf/application_signals + processors: + - metricstransform/application_signals + - resourcedetection + - awsapplicationsignals + receivers: + - otlp/application_signals + traces/application_signals: + exporters: + - awsxray/application_signals + processors: + - resourcedetection + - awsapplicationsignals + receivers: + - otlp/application_signals + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml index 618e81c072..250e5a6de3 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -148,9 +148,16 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: - mode: ec2 - region: us-east-1 + mode: ec2 + region: us-east-1 processors: batch/containerinsights: metadata_cardinality_limit: 1000 @@ -220,6 +227,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: logs/emf_logs: diff --git a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml index 9a349c682e..caa5cfc15b 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml @@ -17,6 +17,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-east-1 @@ -32,6 +39,7 @@ processors: - InstanceId - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_disk: @@ -45,6 +53,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: @@ -54,8 +63,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_mem - telegraf_disk + - telegraf_mem telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml index 31c7c5229b..8f5d51fc73 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml @@ -17,21 +17,29 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_win_perf_counters/1492679118: @@ -47,6 +55,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: diff --git a/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml b/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml index a1ecf22c1e..2d409b2753 100644 --- a/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml @@ -17,14 +17,21 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 processors: awsentity/service/telegraf: entity_type: Service + platform: ec2 scrape_datapoint_attribute: true - platform: ec2 receivers: telegraf_socket_listener: collection_interval: 1m0s @@ -33,6 +40,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/hostCustomMetrics: diff --git a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml index ab934cba89..cdc02e2d2f 100644 --- a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml @@ -28,14 +28,21 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 processors: awsentity/service/telegraf: entity_type: Service - scrape_datapoint_attribute: true platform: ec2 + scrape_datapoint_attribute: true ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName @@ -44,6 +51,7 @@ processors: - InstanceType - ImageId imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_socket_listener: @@ -57,6 +65,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/hostCustomMetrics: diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index ec2a2d8994..4ad0290915 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -83,6 +83,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -100,8 +107,8 @@ processors: platform: ec2 awsentity/service/telegraf: entity_type: Service - scrape_datapoint_attribute: true platform: ec2 + scrape_datapoint_attribute: true batch/emf_logs: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -126,10 +133,11 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s transform: error_mode: propagate @@ -138,11 +146,11 @@ processors: metric_statements: - context: metric statements: - - set(unit, "unit") where name == "disk_free" - - set(name, "DISK_FREE") where name == "disk_free" - - set(unit, "unit") where name == "cpu_usage_idle" - - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" - - set(unit, "unit") where name == "cpu_usage_nice" + - set(unit, "unit") where name == "disk_free" + - set(name, "DISK_FREE") where name == "disk_free" + - set(unit, "unit") where name == "cpu_usage_idle" + - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" + - set(unit, "unit") where name == "cpu_usage_nice" trace_statements: [] receivers: awsxray: @@ -256,6 +264,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - agenthealth/logs - agenthealth/traces - entitystore @@ -275,13 +284,13 @@ service: - ec2tagger - transform receivers: - - telegraf_procstat/1917393364 - - telegraf_cpu - - telegraf_mem - - telegraf_netstat - - telegraf_processes - telegraf_swap + - telegraf_netstat - telegraf_disk + - telegraf_mem + - telegraf_processes + - telegraf_procstat/1917393364 + - telegraf_cpu metrics/hostCustomMetrics: exporters: - awscloudwatch @@ -290,8 +299,8 @@ service: - ec2tagger - transform receivers: - - telegraf_socket_listener - telegraf_statsd + - telegraf_socket_listener metrics/hostDeltaMetrics: exporters: - awscloudwatch @@ -301,8 +310,8 @@ service: - ec2tagger - transform receivers: - - telegraf_diskio - telegraf_net + - telegraf_diskio traces/xray: exporters: - awsxray diff --git a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml index e54d859883..b9decbb138 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -81,6 +81,7 @@ extensions: mode: EC2 region_type: ACJ agenthealth/metrics: + is_status_code_enabled: true is_usage_data_enabled: true stats: operations: @@ -88,6 +89,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -102,11 +110,11 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 awsentity/service/telegraf: entity_type: Service - scrape_datapoint_attribute: true platform: ec2 + scrape_datapoint_attribute: true batch/emf_logs: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -138,10 +146,11 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s filter/jmx/0: error_mode: propagate @@ -189,11 +198,11 @@ processors: metric_statements: - context: metric statements: - - set(unit, "unit") where name == "cpu_usage_idle" - - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" - - set(unit, "unit") where name == "cpu_usage_nice" - - set(unit, "unit") where name == "disk_free" - - set(name, "DISK_FREE") where name == "disk_free" + - set(unit, "unit") where name == "cpu_usage_idle" + - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" + - set(unit, "unit") where name == "cpu_usage_nice" + - set(unit, "unit") where name == "disk_free" + - set(name, "DISK_FREE") where name == "disk_free" trace_statements: [] transform/jmx/0: error_mode: propagate @@ -202,9 +211,9 @@ processors: metric_statements: - context: metric statements: - - set(name, "kafka.fetch-rate") where name == "kafka.consumer.fetch-rate" - - set(unit, "unit") where name == "jvm.memory.heap.used" - - set(name, "JVM_MEM_HEAP_USED") where name == "jvm.memory.heap.used" + - set(unit, "unit") where name == "jvm.memory.heap.used" + - set(name, "JVM_MEM_HEAP_USED") where name == "jvm.memory.heap.used" + - set(name, "kafka.fetch-rate") where name == "kafka.consumer.fetch-rate" trace_statements: [] transform/jmx/1: error_mode: propagate @@ -213,7 +222,7 @@ processors: metric_statements: - context: metric statements: - - set(name, "TC_ERR") where name == "tomcat.errors" + - set(name, "TC_ERR") where name == "tomcat.errors" trace_statements: [] receivers: awsxray: @@ -362,6 +371,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - agenthealth/logs - agenthealth/traces - entitystore @@ -381,13 +391,13 @@ service: - ec2tagger - transform receivers: - - telegraf_mem - - telegraf_netstat - - telegraf_procstat/1917393364 - - telegraf_swap + - telegraf_processes - telegraf_cpu + - telegraf_swap + - telegraf_procstat/1917393364 - telegraf_disk - - telegraf_processes + - telegraf_netstat + - telegraf_mem metrics/hostCustomMetrics/cloudwatch: exporters: - awscloudwatch @@ -407,8 +417,8 @@ service: - ec2tagger - transform receivers: - - telegraf_diskio - telegraf_net + - telegraf_diskio metrics/jmx/cloudwatch/0: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/complete_windows_config.yaml b/translator/tocwconfig/sampleConfig/complete_windows_config.yaml index d41982d0cb..e7fa12f152 100644 --- a/translator/tocwconfig/sampleConfig/complete_windows_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_windows_config.yaml @@ -83,6 +83,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -97,11 +104,11 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 awsentity/service/telegraf: entity_type: Service - scrape_datapoint_attribute: true platform: ec2 + scrape_datapoint_attribute: true batch/emf_logs: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -120,6 +127,7 @@ processors: - InstanceId - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s transform: error_mode: propagate @@ -243,6 +251,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - agenthealth/logs - agenthealth/traces - entitystore diff --git a/translator/tocwconfig/sampleConfig/config_with_env.yaml b/translator/tocwconfig/sampleConfig/config_with_env.yaml index c776e99d76..40307cc324 100644 --- a/translator/tocwconfig/sampleConfig/config_with_env.yaml +++ b/translator/tocwconfig/sampleConfig/config_with_env.yaml @@ -39,6 +39,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: ${ENV_REGION} @@ -78,6 +85,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: logs/emf_logs: diff --git a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml index 28be63530c..77976a2761 100644 --- a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml +++ b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml @@ -182,9 +182,16 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: - mode: ec2 - region: us-west-2 + mode: ec2 + region: us-west-2 processors: batch/containerinsights: metadata_cardinality_limit: 1000 @@ -517,6 +524,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: metrics/containerinsights: diff --git a/translator/tocwconfig/sampleConfig/delta_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_config_linux.yaml index 6a27ffc90d..0abb2d4c66 100644 --- a/translator/tocwconfig/sampleConfig/delta_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_config_linux.yaml @@ -17,13 +17,20 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-east-1 processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict @@ -42,6 +49,7 @@ processors: - InstanceId - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s transform: error_mode: propagate @@ -50,12 +58,12 @@ processors: metric_statements: - context: metric statements: - - set(unit, "Count") where name == "diskio_iops_in_progress" - - set(name, "DRIVER_DISKIO_IOPS_IN_PROGRESS") where name == "diskio_iops_in_progress" - - set(unit, "Milliseconds") where name == "diskio_read_time" - - set(name, "DRIVER_DISKIO_READ_TIME") where name == "diskio_read_time" - - set(unit, "Milliseconds") where name == "diskio_write_time" - - set(name, "DRIVER_DISKIO_WRITE_TIME") where name == "diskio_write_time" + - set(unit, "Count") where name == "diskio_iops_in_progress" + - set(name, "DRIVER_DISKIO_IOPS_IN_PROGRESS") where name == "diskio_iops_in_progress" + - set(unit, "Milliseconds") where name == "diskio_read_time" + - set(name, "DRIVER_DISKIO_READ_TIME") where name == "diskio_read_time" + - set(unit, "Milliseconds") where name == "diskio_write_time" + - set(name, "DRIVER_DISKIO_WRITE_TIME") where name == "diskio_write_time" trace_statements: [] receivers: telegraf_diskio: @@ -65,6 +73,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/hostDeltaMetrics: diff --git a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml index f6601c168d..e9ed041ca5 100644 --- a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml @@ -17,13 +17,20 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-east-1 processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: "" @@ -39,6 +46,7 @@ processors: - InstanceType - ImageId imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_net: @@ -48,6 +56,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/hostDeltaMetrics: diff --git a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml index a458852b8e..65c7eff23e 100644 --- a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml +++ b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml @@ -22,21 +22,29 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s transform: error_mode: propagate @@ -45,9 +53,9 @@ processors: metric_statements: - context: metric statements: - - set(unit, "unit") where name == "cpu_usage_idle" - - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" - - set(unit, "unit") where name == "cpu_usage_nice" + - set(unit, "unit") where name == "cpu_usage_idle" + - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" + - set(unit, "unit") where name == "cpu_usage_nice" trace_statements: [] receivers: telegraf_cpu: @@ -65,6 +73,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: @@ -75,9 +84,9 @@ service: - ec2tagger - transform receivers: - - telegraf_nvidia_smi - telegraf_cpu - telegraf_disk + - telegraf_nvidia_smi telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml index f2e17099c6..5f7b8e85e4 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml @@ -398,6 +398,13 @@ extensions: usage_flags: mode: OP region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: OP + region_type: ACJ entitystore: mode: onPremise profile: default @@ -484,6 +491,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: logs/emf_logs: @@ -498,8 +506,8 @@ service: exporters: - awsemf/containerinsights processors: - - metricstransform/containerinsights - batch/containerinsights + - metricstransform/containerinsights receivers: - awscontainerinsightreceiver telemetry: diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml index 169eb97852..44fccdb2b6 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml @@ -146,9 +146,9 @@ exporters: - pod_container_status_waiting_reason_create_container_error - pod_container_status_waiting_reason_create_container_config_error - pod_container_status_terminated_reason_oom_killed - - pod_gpu_usage_total - pod_gpu_request - pod_gpu_limit + - pod_gpu_usage_total - pod_gpu_reserved_capacity - dimensions: - - ClusterName @@ -175,8 +175,8 @@ exporters: - node_status_condition_unknown - node_status_capacity_pods - node_status_allocatable_pods - - node_gpu_usage_total - node_gpu_limit + - node_gpu_usage_total - node_gpu_reserved_capacity - dimensions: - - ClusterName @@ -656,6 +656,13 @@ extensions: usage_flags: mode: OP region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: OP + region_type: ACJ entitystore: mode: onPremise profile: default @@ -685,9 +692,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: container_gpu_memory_used + new_name: container_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -698,7 +705,7 @@ processors: new_value: ContainerGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 1.048576e+06 + experimental_scale: 100 label: "" label_value: "" new_label: "" @@ -706,9 +713,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: pod_gpu_memory_used + new_name: pod_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -719,7 +726,7 @@ processors: new_value: PodGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 1.048576e+06 + experimental_scale: 100 label: "" label_value: "" new_label: "" @@ -727,9 +734,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: node_gpu_memory_used + new_name: node_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -740,7 +747,7 @@ processors: new_value: NodeGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 1.048576e+06 + experimental_scale: 100 label: "" label_value: "" new_label: "" @@ -748,9 +755,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_TOTAL + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: container_gpu_memory_total + new_name: container_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -769,9 +776,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_TOTAL + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: pod_gpu_memory_total + new_name: pod_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -790,9 +797,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_TOTAL + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: node_gpu_memory_total + new_name: node_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -811,9 +818,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: container_gpu_temperature + new_name: container_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -822,12 +829,19 @@ processors: label_value: "" new_label: Type new_value: ContainerGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: pod_gpu_temperature + new_name: pod_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -836,12 +850,19 @@ processors: label_value: "" new_label: Type new_value: PodGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: node_gpu_temperature + new_name: node_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -850,12 +871,19 @@ processors: label_value: "" new_label: Type new_value: NodeGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: container_gpu_power_draw + new_name: container_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -867,9 +895,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: pod_gpu_power_draw + new_name: pod_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -881,9 +909,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: node_gpu_power_draw + new_name: node_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -895,9 +923,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_UTIL + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: container_gpu_utilization + new_name: container_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -909,9 +937,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_UTIL + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: pod_gpu_utilization + new_name: pod_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -923,9 +951,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_UTIL + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: node_gpu_utilization + new_name: node_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -937,9 +965,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: container_gpu_memory_utilization + new_name: container_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -948,19 +976,12 @@ processors: label_value: "" new_label: Type new_value: ContainerGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 100 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: pod_gpu_memory_utilization + new_name: pod_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -969,19 +990,12 @@ processors: label_value: "" new_label: Type new_value: PodGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 100 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: node_gpu_memory_utilization + new_name: node_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -990,19 +1004,12 @@ processors: label_value: "" new_label: Type new_value: NodeGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 100 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: update aggregation_type: "" - include: neuron_hardware + include: execution_latency_seconds match_type: "" - new_name: neuron_hardware + new_name: neuron_execution_latency operations: [] submatch_case: "" - action: update @@ -1014,9 +1021,9 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuron_runtime_memory_used_bytes + include: execution_status_total match_type: "" - new_name: neurondevice_runtime_memory_used_bytes + new_name: neuron_execution_status operations: [] submatch_case: "" - action: update @@ -1028,73 +1035,73 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_code + include: neuroncore_memory_usage_model_shared_scratchpad match_type: "" - new_name: neuroncore_memory_usage_model_code + new_name: neuroncore_memory_usage_model_shared_scratchpad operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_shared_scratchpad + include: instance_info match_type: "" - new_name: neuroncore_memory_usage_model_shared_scratchpad + new_name: instance_info operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_tensors + include: neuron_hardware match_type: "" - new_name: neuroncore_memory_usage_tensors + new_name: neuron_hardware operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_status_total + include: hardware_ecc_events_total match_type: "" - new_name: neuron_execution_status + new_name: neurondevice_hw_ecc_events operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_runtime_memory + include: neuron_runtime_memory_used_bytes match_type: "" - new_name: neuroncore_memory_usage_runtime_memory + new_name: neurondevice_runtime_memory_used_bytes operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_utilization_ratio + include: neuroncore_memory_usage_model_code match_type: "" - new_name: neuroncore_utilization - operations: - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 100 - label: "" - label_value: "" - new_label: "" - new_value: "" + new_name: neuroncore_memory_usage_model_code + operations: [] submatch_case: "" - action: update aggregation_type: "" - include: instance_info + include: neuroncore_memory_usage_runtime_memory match_type: "" - new_name: instance_info + new_name: neuroncore_memory_usage_runtime_memory operations: [] submatch_case: "" - action: update aggregation_type: "" - include: hardware_ecc_events_total + include: neuroncore_memory_usage_tensors match_type: "" - new_name: neurondevice_hw_ecc_events + new_name: neuroncore_memory_usage_tensors operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_latency_seconds + include: neuroncore_utilization_ratio match_type: "" - new_name: neuron_execution_latency - operations: [] + new_name: neuroncore_utilization + operations: + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 100 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" receivers: awscontainerinsightreceiver: @@ -1156,6 +1163,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: logs/emf_logs: @@ -1170,9 +1178,9 @@ service: exporters: - awsemf/containerinsights processors: + - batch/containerinsights - metricstransform/containerinsights - gpuattributes/containerinsights - - batch/containerinsights receivers: - awscontainerinsightreceiver telemetry: diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml index 36d9202ca7..37b6232c3f 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml @@ -478,6 +478,13 @@ extensions: usage_flags: mode: OP region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: OP + region_type: ACJ entitystore: mode: onPremise profile: default @@ -573,6 +580,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: logs/emf_logs: diff --git a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml index d38f02f2cd..7605fd96e6 100644 --- a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml +++ b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml @@ -17,15 +17,23 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-east-1 processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_disk: @@ -39,6 +47,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: @@ -48,8 +57,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_disk - telegraf_mem + - telegraf_disk telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml index 373ba8e154..caa5cfc15b 100644 --- a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml +++ b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml @@ -17,6 +17,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-east-1 @@ -32,6 +39,7 @@ processors: - InstanceId - InstanceType imds_retries: 1 + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_disk: @@ -45,6 +53,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: diff --git a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml index 2bd2541d3e..73562f67a1 100644 --- a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml @@ -58,6 +58,7 @@ exporters: write_buffer_size: 524288 extensions: agenthealth/metrics: + is_status_code_enabled: true is_usage_data_enabled: true stats: operations: @@ -65,9 +66,16 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: - mode: ec2 - region: us-west-2 + mode: ec2 + region: us-west-2 sigv4auth: assume_role: sts_region: us-west-2 @@ -75,7 +83,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 batch/host/amp: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -165,6 +173,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - sigv4auth - entitystore pipelines: @@ -175,8 +184,8 @@ service: - transform - batch/host/amp receivers: - - telegraf_disk - telegraf_cpu + - telegraf_disk metrics/host/cloudwatch: exporters: - awscloudwatch @@ -184,8 +193,8 @@ service: - awsentity/resource - transform receivers: - - telegraf_disk - telegraf_cpu + - telegraf_disk metrics/jmx/amp: exporters: - prometheusremotewrite/amp diff --git a/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml b/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml index a4edf266d3..2d73ac7668 100644 --- a/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml @@ -55,6 +55,7 @@ exporters: write_buffer_size: 524288 extensions: agenthealth/metrics: + is_status_code_enabled: true is_usage_data_enabled: true stats: operations: @@ -62,13 +63,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + entitystore: + mode: ec2 + region: us-west-2 sigv4auth: assume_role: sts_region: us-west-2 region: us-west-2 - entitystore: - mode: ec2 - region: us-west-2 processors: batch/jmx/amp/0: metadata_cardinality_limit: 1000 diff --git a/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml b/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml index 68118d53b9..9ad8ccbacc 100644 --- a/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml +++ b/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml @@ -99,11 +99,11 @@ exporters: - pod_status_unknown - pod_status_succeeded - pod_memory_request - - pod_cpu_usage_total - - pod_memory_working_set - pod_memory_limit - pod_cpu_limit - pod_cpu_request + - pod_cpu_usage_total + - pod_memory_working_set - pod_container_status_running - pod_container_status_terminated - pod_container_status_waiting @@ -365,6 +365,13 @@ extensions: usage_flags: mode: OP region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: OP + region_type: ACJ entitystore: mode: onPremise profile: AmazonCloudWatchAgent @@ -420,14 +427,15 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: metrics/containerinsights: exporters: - awsemf/containerinsights processors: - - metricstransform/containerinsights - batch/containerinsights + - metricstransform/containerinsights receivers: - awscontainerinsightreceiver telemetry: diff --git a/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml index 7d2fa024b0..a34b9a9e58 100644 --- a/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml @@ -226,6 +226,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-east-1 @@ -307,6 +314,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: logs/emf_logs: diff --git a/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml b/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml index 3943981aa6..40a39cb624 100644 --- a/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml +++ b/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml @@ -97,6 +97,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ processors: batch/containerinsights: metadata_cardinality_limit: 1000 @@ -166,6 +173,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode pipelines: logs/emf_logs: exporters: diff --git a/translator/tocwconfig/sampleConfig/log_filter.yaml b/translator/tocwconfig/sampleConfig/log_filter.yaml index 0b694fca94..6ca631da29 100644 --- a/translator/tocwconfig/sampleConfig/log_filter.yaml +++ b/translator/tocwconfig/sampleConfig/log_filter.yaml @@ -1,36 +1,36 @@ exporters: - nop: {} + nop: {} extensions: - entitystore: - mode: "ec2" - region: us-east-1 + entitystore: + mode: ec2 + region: us-east-1 receivers: - nop: {} + nop: {} service: - extensions: - - entitystore - pipelines: - metrics/nop: - exporters: - - nop - processors: [] - receivers: - - nop - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } \ No newline at end of file + extensions: + - entitystore + pipelines: + metrics/nop: + exporters: + - nop + processors: [] + receivers: + - nop + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/log_only_config_windows.yaml b/translator/tocwconfig/sampleConfig/log_only_config_windows.yaml index a01b2785ed..391143c01f 100644 --- a/translator/tocwconfig/sampleConfig/log_only_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/log_only_config_windows.yaml @@ -1,36 +1,36 @@ exporters: - nop: {} + nop: {} extensions: - entitystore: - mode: "ec2" - region: us-west-2 + entitystore: + mode: ec2 + region: us-west-2 receivers: - nop: {} + nop: {} service: - extensions: - - entitystore - pipelines: - metrics/nop: - exporters: - - nop - processors: [] - receivers: - - nop - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - c:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } \ No newline at end of file + extensions: + - entitystore + pipelines: + metrics/nop: + exporters: + - nop + processors: [] + receivers: + - nop + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - c:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml index 28594ce0e7..06827e3d55 100644 --- a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml @@ -394,10 +394,16 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: - mode: ec2 - region: us-east-1 - + mode: ec2 + region: us-east-1 processors: batch/containerinsights: metadata_cardinality_limit: 1000 @@ -477,6 +483,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: logs/emf_logs: @@ -491,8 +498,8 @@ service: exporters: - awsemf/containerinsights processors: - - metricstransform/containerinsights - batch/containerinsights + - metricstransform/containerinsights receivers: - awscontainerinsightreceiver telemetry: diff --git a/translator/tocwconfig/sampleConfig/no_skip_log_timestamp.yaml b/translator/tocwconfig/sampleConfig/no_skip_log_timestamp.yaml index e3327e1d00..11a14c9ad5 100644 --- a/translator/tocwconfig/sampleConfig/no_skip_log_timestamp.yaml +++ b/translator/tocwconfig/sampleConfig/no_skip_log_timestamp.yaml @@ -1,36 +1,36 @@ exporters: - nop: {} + nop: {} extensions: - entitystore: - mode: "ec2" - region: us-west-2 + entitystore: + mode: ec2 + region: us-west-2 receivers: - nop: {} + nop: {} service: - extensions: - - entitystore - pipelines: - metrics/nop: - exporters: - - nop - processors: [] - receivers: - - nop - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } \ No newline at end of file + extensions: + - entitystore + pipelines: + metrics/nop: + exporters: + - nop + processors: [] + receivers: + - nop + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/no_skip_log_timestamp_windows.yaml b/translator/tocwconfig/sampleConfig/no_skip_log_timestamp_windows.yaml index a01b2785ed..391143c01f 100644 --- a/translator/tocwconfig/sampleConfig/no_skip_log_timestamp_windows.yaml +++ b/translator/tocwconfig/sampleConfig/no_skip_log_timestamp_windows.yaml @@ -1,36 +1,36 @@ exporters: - nop: {} + nop: {} extensions: - entitystore: - mode: "ec2" - region: us-west-2 + entitystore: + mode: ec2 + region: us-west-2 receivers: - nop: {} + nop: {} service: - extensions: - - entitystore - pipelines: - metrics/nop: - exporters: - - nop - processors: [] - receivers: - - nop - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - c:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } \ No newline at end of file + extensions: + - entitystore + pipelines: + metrics/nop: + exporters: + - nop + processors: [] + receivers: + - nop + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - c:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml b/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml index f6233cf355..f9649de2e4 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml @@ -1,126 +1,134 @@ exporters: - awsemf: - certificate_file_path: "" - detailed_metrics: false - dimension_rollup_option: NoDimensionRollup - disable_metric_extraction: false - eks_fargate_container_insights_enabled: false - endpoint: "" - enhanced_container_insights: false - imds_retries: 1 - local_mode: false - log_group_name: /aws/cwagent - log_retention: 0 - log_stream_name: "" - max_retries: 2 - middleware: agenthealth/logs - namespace: CWAgent - no_verify_ssl: false - num_workers: 8 - output_destination: cloudwatch - profile: "" - proxy_address: "" - region: us-west-2 - request_timeout_seconds: 30 - resource_arn: "" - resource_to_telemetry_conversion: - enabled: true - retain_initial_value_of_delta_metric: false - role_arn: "" - version: "0" + awsemf: + certificate_file_path: "" + detailed_metrics: false + dimension_rollup_option: NoDimensionRollup + disable_metric_extraction: false + eks_fargate_container_insights_enabled: false + endpoint: "" + enhanced_container_insights: false + imds_retries: 1 + local_mode: false + log_group_name: /aws/cwagent + log_retention: 0 + log_stream_name: "" + max_retries: 2 + middleware: agenthealth/logs + namespace: CWAgent + no_verify_ssl: false + num_workers: 8 + output_destination: cloudwatch + profile: "" + proxy_address: "" + region: us-west-2 + request_timeout_seconds: 30 + resource_arn: "" + resource_to_telemetry_conversion: + enabled: true + retain_initial_value_of_delta_metric: false + role_arn: "" + version: "0" extensions: - agenthealth/logs: - is_usage_data_enabled: true - stats: - operations: - - PutLogEvents - usage_flags: - mode: EC2 - region_type: ACJ - entitystore: - mode: ec2 - region: us-west-2 + agenthealth/logs: + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: EC2 + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ + entitystore: + mode: ec2 + region: us-west-2 processors: - batch/hostOtlpMetrics/cloudwatchlogs: - metadata_cardinality_limit: 1000 - send_batch_max_size: 0 - send_batch_size: 8192 - timeout: 30s - cumulativetodelta/hostOtlpMetrics/cloudwatchlogs: - exclude: - match_type: "" - include: - match_type: "" - initial_value: 2 - max_staleness: 0s + batch/hostOtlpMetrics/cloudwatchlogs: + metadata_cardinality_limit: 1000 + send_batch_max_size: 0 + send_batch_size: 8192 + timeout: 30s + cumulativetodelta/hostOtlpMetrics/cloudwatchlogs: + exclude: + match_type: "" + include: + match_type: "" + initial_value: 2 + max_staleness: 0s receivers: - otlp/metrics: - protocols: - grpc: - dialer: - timeout: 0s - endpoint: 0.0.0.0:1234 - include_metadata: false - max_concurrent_streams: 0 - max_recv_msg_size_mib: 0 - read_buffer_size: 524288 - transport: tcp - write_buffer_size: 0 - tls: - ca_file: "" - cert_file: /path/to/cert.pem - client_ca_file: "" - client_ca_file_reload: false - include_system_ca_certs_pool: false - key_file: /path/to/key.pem - max_version: "" - min_version: "" - reload_interval: 0s - http: - endpoint: 0.0.0.0:2345 - include_metadata: false - logs_url_path: /v1/logs - max_request_body_size: 0 - metrics_url_path: /v1/metrics - traces_url_path: /v1/traces - tls: - ca_file: "" - cert_file: /path/to/cert.pem - client_ca_file: "" - client_ca_file_reload: false - include_system_ca_certs_pool: false - key_file: /path/to/key.pem - max_version: "" - min_version: "" - reload_interval: 0s + otlp/metrics: + protocols: + grpc: + dialer: + timeout: 0s + endpoint: 0.0.0.0:1234 + include_metadata: false + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 + tls: + ca_file: "" + cert_file: /path/to/cert.pem + client_ca_file: "" + client_ca_file_reload: false + include_system_ca_certs_pool: false + key_file: /path/to/key.pem + max_version: "" + min_version: "" + reload_interval: 0s + transport: tcp + write_buffer_size: 0 + http: + endpoint: 0.0.0.0:2345 + include_metadata: false + logs_url_path: /v1/logs + max_request_body_size: 0 + metrics_url_path: /v1/metrics + tls: + ca_file: "" + cert_file: /path/to/cert.pem + client_ca_file: "" + client_ca_file_reload: false + include_system_ca_certs_pool: false + key_file: /path/to/key.pem + max_version: "" + min_version: "" + reload_interval: 0s + traces_url_path: /v1/traces service: - extensions: - - agenthealth/logs - - entitystore - pipelines: - metrics/hostOtlpMetrics/cloudwatchlogs: - exporters: - - awsemf - processors: - - batch/hostOtlpMetrics/cloudwatchlogs - - cumulativetodelta/hostOtlpMetrics/cloudwatchlogs - receivers: - - otlp/metrics - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } + extensions: + - agenthealth/logs + - agenthealth/statuscode + - entitystore + pipelines: + metrics/hostOtlpMetrics/cloudwatchlogs: + exporters: + - awsemf + processors: + - cumulativetodelta/hostOtlpMetrics/cloudwatchlogs + - batch/hostOtlpMetrics/cloudwatchlogs + receivers: + - otlp/metrics + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml index 8f47cce671..4f5db5136a 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml @@ -1,110 +1,119 @@ exporters: - awscloudwatch: - force_flush_interval: 1m0s - max_datums_per_call: 1000 - max_values_per_datum: 150 - middleware: agenthealth/metrics - namespace: CWAgent - region: us-west-2 - resource_to_telemetry_conversion: - enabled: true + awscloudwatch: + force_flush_interval: 1m0s + max_datums_per_call: 1000 + max_values_per_datum: 150 + middleware: agenthealth/metrics + namespace: CWAgent + region: us-west-2 + resource_to_telemetry_conversion: + enabled: true extensions: - agenthealth/metrics: - is_usage_data_enabled: true - stats: - operations: - - PutMetricData - usage_flags: - mode: EC2 - region_type: ACJ - entitystore: - mode: ec2 - region: us-west-2 + agenthealth/metrics: + is_usage_data_enabled: true + stats: + operations: + - PutMetricData + usage_flags: + mode: EC2 + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ + entitystore: + mode: ec2 + region: us-west-2 processors: - cumulativetodelta/hostOtlpMetrics: - exclude: - match_type: "" - include: - match_type: "" - initial_value: 2 - max_staleness: 0s - ec2tagger: - ec2_instance_tag_keys: - - AutoScalingGroupName - ec2_metadata_tags: - - ImageId - - InstanceId - - InstanceType - imds_retries: 1 - refresh_interval_seconds: 0s + cumulativetodelta/hostOtlpMetrics: + exclude: + match_type: "" + include: + match_type: "" + initial_value: 2 + max_staleness: 0s + ec2tagger: + ec2_instance_tag_keys: + - AutoScalingGroupName + ec2_metadata_tags: + - ImageId + - InstanceId + - InstanceType + imds_retries: 1 + middleware: agenthealth/statuscode + refresh_interval_seconds: 0s receivers: - otlp/metrics: - protocols: - grpc: - dialer: - timeout: 0s - endpoint: 0.0.0.0:1234 - include_metadata: false - max_concurrent_streams: 0 - max_recv_msg_size_mib: 0 - read_buffer_size: 524288 - transport: tcp - write_buffer_size: 0 - tls: - ca_file: "" - cert_file: /path/to/cert.pem - client_ca_file: "" - client_ca_file_reload: false - include_system_ca_certs_pool: false - key_file: /path/to/key.pem - max_version: "" - min_version: "" - reload_interval: 0s - http: - endpoint: 0.0.0.0:2345 - include_metadata: false - logs_url_path: /v1/logs - max_request_body_size: 0 - metrics_url_path: /v1/metrics - traces_url_path: /v1/traces - tls: - ca_file: "" - cert_file: /path/to/cert.pem - client_ca_file: "" - client_ca_file_reload: false - include_system_ca_certs_pool: false - key_file: /path/to/key.pem - max_version: "" - min_version: "" - reload_interval: 0s + otlp/metrics: + protocols: + grpc: + dialer: + timeout: 0s + endpoint: 0.0.0.0:1234 + include_metadata: false + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 + tls: + ca_file: "" + cert_file: /path/to/cert.pem + client_ca_file: "" + client_ca_file_reload: false + include_system_ca_certs_pool: false + key_file: /path/to/key.pem + max_version: "" + min_version: "" + reload_interval: 0s + transport: tcp + write_buffer_size: 0 + http: + endpoint: 0.0.0.0:2345 + include_metadata: false + logs_url_path: /v1/logs + max_request_body_size: 0 + metrics_url_path: /v1/metrics + tls: + ca_file: "" + cert_file: /path/to/cert.pem + client_ca_file: "" + client_ca_file_reload: false + include_system_ca_certs_pool: false + key_file: /path/to/key.pem + max_version: "" + min_version: "" + reload_interval: 0s + traces_url_path: /v1/traces service: - extensions: - - agenthealth/metrics - - entitystore - pipelines: - metrics/hostOtlpMetrics: - exporters: - - awscloudwatch - processors: - - cumulativetodelta/hostOtlpMetrics - - ec2tagger - receivers: - - otlp/metrics - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } + extensions: + - agenthealth/metrics + - agenthealth/statuscode + - entitystore + pipelines: + metrics/hostOtlpMetrics: + exporters: + - awscloudwatch + processors: + - cumulativetodelta/hostOtlpMetrics + - ec2tagger + receivers: + - otlp/metrics + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml b/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml index cfce7bfa44..4df9b2e012 100644 --- a/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml +++ b/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml @@ -1,61 +1,69 @@ exporters: - awscloudwatch: - force_flush_interval: 1m0s - max_datums_per_call: 1000 - max_values_per_datum: 150 - middleware: agenthealth/metrics - namespace: CWAgent - profile: AmazonCloudWatchAgent - region: us-west-2 - resource_to_telemetry_conversion: - enabled: true - shared_credential_file: fake-path + awscloudwatch: + force_flush_interval: 1m0s + max_datums_per_call: 1000 + max_values_per_datum: 150 + middleware: agenthealth/metrics + namespace: CWAgent + profile: AmazonCloudWatchAgent + region: us-west-2 + resource_to_telemetry_conversion: + enabled: true + shared_credential_file: fake-path extensions: - agenthealth/metrics: - is_usage_data_enabled: true - stats: - operations: - - PutMetricData - usage_flags: - mode: OP - region_type: ACJ - entitystore: - mode: onPremise - profile: AmazonCloudWatchAgent - region: us-west-2 - shared_credential_file: fake-path + agenthealth/metrics: + is_usage_data_enabled: true + stats: + operations: + - PutMetricData + usage_flags: + mode: OP + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: OP + region_type: ACJ + entitystore: + mode: onPremise + profile: AmazonCloudWatchAgent + region: us-west-2 + shared_credential_file: fake-path receivers: - telegraf_procstat/793254176: - alias_name: amazon-cloudwatch-agent - collection_interval: 1m0s - initial_delay: 1s - timeout: 0s + telegraf_procstat/793254176: + alias_name: amazon-cloudwatch-agent + collection_interval: 1m0s + initial_delay: 1s + timeout: 0s service: - extensions: - - agenthealth/metrics - - entitystore - pipelines: - metrics/host: - exporters: - - awscloudwatch - processors: [] - receivers: - - telegraf_procstat/793254176 - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: {} + extensions: + - agenthealth/metrics + - agenthealth/statuscode + - entitystore + pipelines: + metrics/host: + exporters: + - awscloudwatch + processors: [] + receivers: + - telegraf_procstat/793254176 + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/prometheus_combined_config_linux.yaml b/translator/tocwconfig/sampleConfig/prometheus_combined_config_linux.yaml index d76d284a56..56d9630267 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_combined_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/prometheus_combined_config_linux.yaml @@ -122,13 +122,20 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ + entitystore: + mode: ec2 + region: us-west-2 sigv4auth: assume_role: sts_region: us-west-2 region: us-west-2 - entitystore: - mode: ec2 - region: us-west-2 processors: batch/prometheus/amp: metadata_cardinality_limit: 1000 @@ -156,7 +163,7 @@ receivers: enable_http2: true file_sd_configs: - files: - - {ecsSdFileName} + - {ecsSdFileName} refresh_interval: 5m follow_redirects: true honor_timestamps: true @@ -182,6 +189,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - sigv4auth - entitystore pipelines: diff --git a/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml b/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml index 3c8253f190..2a6bd82212 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml @@ -77,6 +77,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-east-1 @@ -94,6 +101,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: metrics/prometheus/cloudwatchlogs: diff --git a/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml b/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml index 3757e69799..45211718b3 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml @@ -59,6 +59,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-east-1 @@ -76,6 +83,7 @@ receivers: service: extensions: - agenthealth/logs + - agenthealth/statuscode - entitystore pipelines: metrics/prometheus/cloudwatchlogs: diff --git a/translator/tocwconfig/sampleConfig/prometheus_otel_config_linux.yaml b/translator/tocwconfig/sampleConfig/prometheus_otel_config_linux.yaml index 901a74315c..4707009580 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_otel_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/prometheus_otel_config_linux.yaml @@ -45,13 +45,13 @@ exporters: server_name_override: "" write_buffer_size: 524288 extensions: + entitystore: + mode: ec2 + region: us-west-2 sigv4auth: assume_role: sts_region: us-west-2 region: us-west-2 - entitystore: - mode: ec2 - region: us-west-2 processors: batch/prometheus/amp: metadata_cardinality_limit: 1000 @@ -74,7 +74,7 @@ receivers: enable_http2: true file_sd_configs: - files: - - {ecsSdFileName} + - {ecsSdFileName} refresh_interval: 5m follow_redirects: true honor_timestamps: true diff --git a/translator/tocwconfig/sampleConfig/skip_log_timestamp.yaml b/translator/tocwconfig/sampleConfig/skip_log_timestamp.yaml index df1b94808d..e417a5320a 100644 --- a/translator/tocwconfig/sampleConfig/skip_log_timestamp.yaml +++ b/translator/tocwconfig/sampleConfig/skip_log_timestamp.yaml @@ -1,36 +1,36 @@ exporters: - nop: {} + nop: {} extensions: - entitystore: - mode: "ec2" - region: us-west-2 + entitystore: + mode: ec2 + region: us-west-2 receivers: - nop: {} + nop: {} service: - extensions: - - entitystore - pipelines: - metrics/nop: - exporters: - - nop - processors: [] - receivers: - - nop - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/tmp/a.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } \ No newline at end of file + extensions: + - entitystore + pipelines: + metrics/nop: + exporters: + - nop + processors: [] + receivers: + - nop + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/tmp/a.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/skip_log_timestamp_default.yaml b/translator/tocwconfig/sampleConfig/skip_log_timestamp_default.yaml index e3327e1d00..11a14c9ad5 100644 --- a/translator/tocwconfig/sampleConfig/skip_log_timestamp_default.yaml +++ b/translator/tocwconfig/sampleConfig/skip_log_timestamp_default.yaml @@ -1,36 +1,36 @@ exporters: - nop: {} + nop: {} extensions: - entitystore: - mode: "ec2" - region: us-west-2 + entitystore: + mode: ec2 + region: us-west-2 receivers: - nop: {} + nop: {} service: - extensions: - - entitystore - pipelines: - metrics/nop: - exporters: - - nop - processors: [] - receivers: - - nop - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } \ No newline at end of file + extensions: + - entitystore + pipelines: + metrics/nop: + exporters: + - nop + processors: [] + receivers: + - nop + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/skip_log_timestamp_default_windows.yaml b/translator/tocwconfig/sampleConfig/skip_log_timestamp_default_windows.yaml index a01b2785ed..391143c01f 100644 --- a/translator/tocwconfig/sampleConfig/skip_log_timestamp_default_windows.yaml +++ b/translator/tocwconfig/sampleConfig/skip_log_timestamp_default_windows.yaml @@ -1,36 +1,36 @@ exporters: - nop: {} + nop: {} extensions: - entitystore: - mode: "ec2" - region: us-west-2 + entitystore: + mode: ec2 + region: us-west-2 receivers: - nop: {} + nop: {} service: - extensions: - - entitystore - pipelines: - metrics/nop: - exporters: - - nop - processors: [] - receivers: - - nop - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - c:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } \ No newline at end of file + extensions: + - entitystore + pipelines: + metrics/nop: + exporters: + - nop + processors: [] + receivers: + - nop + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - c:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/skip_log_timestamp_windows.yaml b/translator/tocwconfig/sampleConfig/skip_log_timestamp_windows.yaml index e3dd15b6ba..d29a89a498 100644 --- a/translator/tocwconfig/sampleConfig/skip_log_timestamp_windows.yaml +++ b/translator/tocwconfig/sampleConfig/skip_log_timestamp_windows.yaml @@ -1,36 +1,36 @@ exporters: - nop: {} + nop: {} extensions: - entitystore: - mode: "ec2" - region: us-west-2 + entitystore: + mode: ec2 + region: us-west-2 receivers: - nop: {} + nop: {} service: - extensions: - - entitystore - pipelines: - metrics/nop: - exporters: - - nop - processors: [] - receivers: - - nop - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - output_paths: - - c:\tmp\am.log - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: { } \ No newline at end of file + extensions: + - entitystore + pipelines: + metrics/nop: + exporters: + - nop + processors: [] + receivers: + - nop + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + output_paths: + - c:\tmp\am.log + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml index 99724c7d28..0298016500 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml @@ -17,13 +17,20 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict @@ -41,6 +48,7 @@ processors: - ImageId - InstanceId - InstanceType + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_cpu: @@ -66,6 +74,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: @@ -75,10 +84,10 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_swap - telegraf_cpu - telegraf_disk - telegraf_mem - - telegraf_swap metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml b/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml index 13bac887c2..145b8b9fa5 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml @@ -19,6 +19,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 profile: AmazonCloudWatchAgent @@ -46,6 +53,7 @@ processors: - InstanceId - InstanceType imds_retries: 2 + middleware: agenthealth/statuscode profile: AmazonCloudWatchAgent refresh_interval_seconds: 0s shared_credential_file: fake-path @@ -73,6 +81,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: diff --git a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml index 8df619d970..0148dbbc95 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml @@ -17,6 +17,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 @@ -31,6 +38,7 @@ processors: - ImageId - InstanceId - InstanceType + middleware: agenthealth/statuscode refresh_interval_seconds: 0s receivers: telegraf_win_perf_counters/1492679118: @@ -61,6 +69,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: diff --git a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml index 2914d1bb74..abe8393a44 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml @@ -19,6 +19,13 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 profile: AmazonCloudWatchAgent @@ -32,10 +39,11 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 2 + middleware: agenthealth/statuscode profile: AmazonCloudWatchAgent refresh_interval_seconds: 0s shared_credential_file: fake-path @@ -68,6 +76,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/host: @@ -77,11 +86,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_win_perf_counters/3762679655 - telegraf_win_perf_counters/4283769065 - telegraf_win_perf_counters/1492679118 - telegraf_win_perf_counters/3610923661 - telegraf_win_perf_counters/3446270237 + - telegraf_win_perf_counters/3762679655 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml b/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml index 0034301d02..0457d568e3 100644 --- a/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml @@ -17,14 +17,21 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 processors: awsentity/service/telegraf: entity_type: Service - scrape_datapoint_attribute: true platform: ec2 + scrape_datapoint_attribute: true receivers: telegraf_statsd: collection_interval: 10s @@ -33,6 +40,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/hostCustomMetrics: diff --git a/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml b/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml index 6aeeae4dd6..1183351c3a 100644 --- a/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml @@ -17,14 +17,21 @@ extensions: usage_flags: mode: EC2 region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ entitystore: mode: ec2 region: us-west-2 processors: awsentity/service/telegraf: entity_type: Service + platform: ec2 scrape_datapoint_attribute: true - platform: ec2 receivers: telegraf_statsd: collection_interval: 10s @@ -33,6 +40,7 @@ receivers: service: extensions: - agenthealth/metrics + - agenthealth/statuscode - entitystore pipelines: metrics/hostCustomMetrics: diff --git a/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml b/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml index 0e0e2da5a1..f4efbd3b82 100644 --- a/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml @@ -1,50 +1,58 @@ exporters: - awscloudwatch: - force_flush_interval: 1m0s - max_datums_per_call: 1000 - max_values_per_datum: 150 - middleware: agenthealth/metrics - namespace: CWAgent - region: us-west-2 - resource_to_telemetry_conversion: - enabled: true + awscloudwatch: + force_flush_interval: 1m0s + max_datums_per_call: 1000 + max_values_per_datum: 150 + middleware: agenthealth/metrics + namespace: CWAgent + region: us-west-2 + resource_to_telemetry_conversion: + enabled: true extensions: - agenthealth/metrics: - is_usage_data_enabled: true - stats: - operations: - - PutMetricData - usage_flags: - mode: EC2 - region_type: ACJ + agenthealth/metrics: + is_usage_data_enabled: true + stats: + operations: + - PutMetricData + usage_flags: + mode: EC2 + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ receivers: - telegraf_statsd: - collection_interval: 10s - initial_delay: 1s - timeout: 0s + telegraf_statsd: + collection_interval: 10s + initial_delay: 1s + timeout: 0s service: - extensions: - - agenthealth/metrics - pipelines: - metrics/hostCustomMetrics: - exporters: - - awscloudwatch - processors: [] - receivers: - - telegraf_statsd - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: {} + extensions: + - agenthealth/metrics + - agenthealth/statuscode + pipelines: + metrics/hostCustomMetrics: + exporters: + - awscloudwatch + processors: [] + receivers: + - telegraf_statsd + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml b/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml index 2ed69a21d4..d8dc31630e 100644 --- a/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml @@ -1,61 +1,69 @@ exporters: - awscloudwatch: - force_flush_interval: 1m0s - max_datums_per_call: 1000 - max_values_per_datum: 150 - middleware: agenthealth/metrics - namespace: CWAgent - region: us-west-2 - resource_to_telemetry_conversion: - enabled: true + awscloudwatch: + force_flush_interval: 1m0s + max_datums_per_call: 1000 + max_values_per_datum: 150 + middleware: agenthealth/metrics + namespace: CWAgent + region: us-west-2 + resource_to_telemetry_conversion: + enabled: true extensions: - agenthealth/metrics: - is_usage_data_enabled: true - stats: - operations: - - PutMetricData - usage_flags: - mode: EKS - region_type: ACJ - entitystore: - mode: ec2 - region: us-west-2 - kubernetes_mode: EKS - server: - listen_addr: :4311 - tls_ca_path: "/etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt" - tls_cert_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.crt" - tls_key_path: "/etc/amazon-cloudwatch-observability-agent-server-cert/server.key" + agenthealth/metrics: + is_usage_data_enabled: true + stats: + operations: + - PutMetricData + usage_flags: + mode: EKS + region_type: ACJ + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EKS + region_type: ACJ + entitystore: + kubernetes_mode: EKS + mode: ec2 + region: us-west-2 + server: + listen_addr: :4311 + tls_ca_path: /etc/amazon-cloudwatch-observability-agent-client-cert/tls-ca.crt + tls_cert_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.crt + tls_key_path: /etc/amazon-cloudwatch-observability-agent-server-cert/server.key receivers: - telegraf_statsd: - collection_interval: 10s - initial_delay: 1s - timeout: 0s + telegraf_statsd: + collection_interval: 10s + initial_delay: 1s + timeout: 0s service: - extensions: - - agenthealth/metrics - - entitystore - - server - pipelines: - metrics/hostCustomMetrics: - exporters: - - awscloudwatch - processors: [] - receivers: - - telegraf_statsd - telemetry: - logs: - development: false - disable_caller: false - disable_stacktrace: false - encoding: console - level: info - sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s - metrics: - address: "" - level: None - traces: {} + extensions: + - agenthealth/metrics + - agenthealth/statuscode + - entitystore + - server + pipelines: + metrics/hostCustomMetrics: + exporters: + - awscloudwatch + processors: [] + receivers: + - telegraf_statsd + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + level: info + sampling: + enabled: true + initial: 2 + thereafter: 500 + tick: 10s + metrics: + address: "" + level: None + traces: {} diff --git a/translator/tocwconfig/sampleConfig/trace_config_linux.yaml b/translator/tocwconfig/sampleConfig/trace_config_linux.yaml index 11aceb51c8..b90c7dbdda 100644 --- a/translator/tocwconfig/sampleConfig/trace_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/trace_config_linux.yaml @@ -22,6 +22,13 @@ exporters: include_metadata: true transit_spans_in_otlp_format: true extensions: + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -84,6 +91,7 @@ receivers: service: extensions: - agenthealth/traces + - agenthealth/statuscode - entitystore pipelines: traces/xray: diff --git a/translator/tocwconfig/sampleConfig/trace_config_windows.yaml b/translator/tocwconfig/sampleConfig/trace_config_windows.yaml index 4ab7efc002..b3cac668b7 100644 --- a/translator/tocwconfig/sampleConfig/trace_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/trace_config_windows.yaml @@ -22,6 +22,13 @@ exporters: include_metadata: true transit_spans_in_otlp_format: true extensions: + agenthealth/statuscode: + is_status_code_enabled: true + is_usage_data_enabled: true + stats: + usage_flags: + mode: EC2 + region_type: ACJ agenthealth/traces: is_usage_data_enabled: true stats: @@ -84,6 +91,7 @@ receivers: service: extensions: - agenthealth/traces + - agenthealth/statuscode - entitystore pipelines: traces/xray: diff --git a/translator/tocwconfig/sampleConfig/windows_eventlog_only_config.yaml b/translator/tocwconfig/sampleConfig/windows_eventlog_only_config.yaml index 78c680ddcf..391143c01f 100644 --- a/translator/tocwconfig/sampleConfig/windows_eventlog_only_config.yaml +++ b/translator/tocwconfig/sampleConfig/windows_eventlog_only_config.yaml @@ -2,13 +2,13 @@ exporters: nop: {} extensions: entitystore: - mode: "ec2" - region: us-west-2 + mode: ec2 + region: us-west-2 receivers: nop: {} service: extensions: - - entitystore + - entitystore pipelines: metrics/nop: exporters: @@ -24,13 +24,13 @@ service: encoding: console level: info output_paths: - - c:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log + - c:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log sampling: - enabled: true - initial: 2 - thereafter: 500 - tick: 10s + enabled: true + initial: 2 + thereafter: 500 + tick: 10s metrics: address: "" level: None - traces: { } \ No newline at end of file + traces: {} diff --git a/translator/tocwconfig/tocwconfig_test.go b/translator/tocwconfig/tocwconfig_test.go index 16b5d52928..7d3b509d17 100644 --- a/translator/tocwconfig/tocwconfig_test.go +++ b/translator/tocwconfig/tocwconfig_test.go @@ -405,6 +405,7 @@ func TestPrometheusConfigwithTargetAllocator(t *testing.T) { checkTranslation(t, "prometheus_config_windows", "windows", nil, "", tokenReplacements) } + func TestOtelPrometheusConfig(t *testing.T) { resetContext(t) context.CurrentContext().SetRunInContainer(true) diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 5e1d4c0b9b..506f3d2e9e 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -25,9 +25,10 @@ const ( ) var ( - MetricsID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeMetrics.String()) - LogsID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeLogs.String()) - TracesID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeTraces.String()) + MetricsID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeMetrics.String()) + LogsID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeLogs.String()) + TracesID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeTraces.String()) + StatusCodeID = component.NewIDWithName(agenthealth.TypeStr, "statuscode") ) type translator struct { diff --git a/translator/translate/otel/pipeline/applicationsignals/translator.go b/translator/translate/otel/pipeline/applicationsignals/translator.go index 239823937c..2f8afbd37c 100644 --- a/translator/translate/otel/pipeline/applicationsignals/translator.go +++ b/translator/translate/otel/pipeline/applicationsignals/translator.go @@ -75,9 +75,12 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators translators.Exporters.Set(awsxray.NewTranslatorWithName(common.AppSignals)) translators.Extensions.Set(awsproxy.NewTranslatorWithName(common.AppSignals)) translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeTraces, []string{agenthealth.OperationPutTraceSegments})) + translators.Extensions.Set(agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true)) + } else { translators.Exporters.Set(awsemf.NewTranslatorWithName(common.AppSignals)) translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents})) + translators.Extensions.Set(agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true)) } return translators, nil } diff --git a/translator/translate/otel/pipeline/applicationsignals/translator_test.go b/translator/translate/otel/pipeline/applicationsignals/translator_test.go index a28c93b19e..ae749c20c5 100644 --- a/translator/translate/otel/pipeline/applicationsignals/translator_test.go +++ b/translator/translate/otel/pipeline/applicationsignals/translator_test.go @@ -51,7 +51,7 @@ func TestTranslatorTraces(t *testing.T) { receivers: []string{"otlp/application_signals"}, processors: []string{"resourcedetection", "awsapplicationsignals"}, exporters: []string{"awsxray/application_signals"}, - extensions: []string{"awsproxy/application_signals", "agenthealth/traces"}, + extensions: []string{"awsproxy/application_signals", "agenthealth/traces", "agenthealth/statuscode"}, }, detector: eksdetector.TestEKSDetector, isEKSCache: eksdetector.TestIsEKSCacheEKS, @@ -68,7 +68,7 @@ func TestTranslatorTraces(t *testing.T) { receivers: []string{"otlp/application_signals"}, processors: []string{"resourcedetection", "awsapplicationsignals"}, exporters: []string{"awsxray/application_signals"}, - extensions: []string{"awsproxy/application_signals", "agenthealth/traces"}, + extensions: []string{"awsproxy/application_signals", "agenthealth/traces", "agenthealth/statuscode"}, }, detector: eksdetector.TestK8sDetector, isEKSCache: eksdetector.TestIsEKSCacheK8s, @@ -128,7 +128,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) { receivers: []string{"otlp/application_signals"}, processors: []string{"metricstransform/application_signals", "resourcedetection", "awsapplicationsignals", "awsentity/service/application_signals"}, exporters: []string{"awsemf/application_signals"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, detector: eksdetector.TestEKSDetector, isEKSCache: eksdetector.TestIsEKSCacheEKS, @@ -149,7 +149,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) { receivers: []string{"otlp/application_signals"}, processors: []string{"metricstransform/application_signals", "resourcedetection", "awsapplicationsignals", "awsentity/service/application_signals"}, exporters: []string{"debug/application_signals", "awsemf/application_signals"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, detector: eksdetector.TestEKSDetector, isEKSCache: eksdetector.TestIsEKSCacheEKS, @@ -167,7 +167,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) { receivers: []string{"otlp/application_signals"}, processors: []string{"metricstransform/application_signals", "resourcedetection", "awsapplicationsignals", "awsentity/service/application_signals"}, exporters: []string{"awsemf/application_signals"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, detector: eksdetector.TestK8sDetector, isEKSCache: eksdetector.TestIsEKSCacheK8s, @@ -227,7 +227,7 @@ func TestTranslatorMetricsForEC2(t *testing.T) { receivers: []string{"otlp/application_signals"}, processors: []string{"metricstransform/application_signals", "resourcedetection", "awsapplicationsignals"}, exporters: []string{"awsemf/application_signals"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, detector: eksdetector.TestEKSDetector, isEKSCache: eksdetector.TestIsEKSCacheEKS, @@ -247,7 +247,7 @@ func TestTranslatorMetricsForEC2(t *testing.T) { receivers: []string{"otlp/application_signals"}, processors: []string{"metricstransform/application_signals", "resourcedetection", "awsapplicationsignals"}, exporters: []string{"debug/application_signals", "awsemf/application_signals"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, detector: eksdetector.TestEKSDetector, isEKSCache: eksdetector.TestIsEKSCacheEKS, diff --git a/translator/translate/otel/pipeline/containerinsights/translator.go b/translator/translate/otel/pipeline/containerinsights/translator.go index a69ad9a645..52a0907f41 100644 --- a/translator/translate/otel/pipeline/containerinsights/translator.go +++ b/translator/translate/otel/pipeline/containerinsights/translator.go @@ -61,7 +61,10 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators // create exporter map with default emf exporter based on pipeline name exporters := common.NewTranslatorMap(awsemf.NewTranslatorWithName(t.pipelineName)) // create extensions map based on pipeline name - extensions := common.NewTranslatorMap(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents})) + extensions := common.NewTranslatorMap(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents}), + agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true), + ) + // create variable for receivers, use switch block below to assign var receivers common.TranslatorMap[component.Config] diff --git a/translator/translate/otel/pipeline/containerinsights/translator_test.go b/translator/translate/otel/pipeline/containerinsights/translator_test.go index 3fe281a167..6eca5a51c7 100644 --- a/translator/translate/otel/pipeline/containerinsights/translator_test.go +++ b/translator/translate/otel/pipeline/containerinsights/translator_test.go @@ -48,7 +48,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"awscontainerinsightreceiver"}, processors: []string{"batch/containerinsights"}, exporters: []string{"awsemf/containerinsights"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, "WithKubernetesKey": { @@ -64,7 +64,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"awscontainerinsightreceiver"}, processors: []string{"batch/containerinsights"}, exporters: []string{"awsemf/containerinsights"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, } @@ -120,7 +120,7 @@ func TestKueueTranslator(t *testing.T) { "kueueattributes/kueueContainerInsights", }, exporters: []string{"awsemf/kueueContainerInsights"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, } diff --git a/translator/translate/otel/pipeline/containerinsightsjmx/translator.go b/translator/translate/otel/pipeline/containerinsightsjmx/translator.go index e34e30c92e..6c4bda310c 100644 --- a/translator/translate/otel/pipeline/containerinsightsjmx/translator.go +++ b/translator/translate/otel/pipeline/containerinsightsjmx/translator.go @@ -70,6 +70,7 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators ), Extensions: common.NewTranslatorMap( agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents}), + agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true), ), } diff --git a/translator/translate/otel/pipeline/containerinsightsjmx/translator_test.go b/translator/translate/otel/pipeline/containerinsightsjmx/translator_test.go index 72ad074f49..81621cc5df 100644 --- a/translator/translate/otel/pipeline/containerinsightsjmx/translator_test.go +++ b/translator/translate/otel/pipeline/containerinsightsjmx/translator_test.go @@ -52,7 +52,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"otlp/jmx"}, processors: []string{"filter/containerinsightsjmx", "resource/containerinsightsjmx", "transform/containerinsightsjmx", "metricstransform/containerinsightsjmx", "cumulativetodelta/containerinsightsjmx"}, exporters: []string{"awsemf/containerinsightsjmx"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, } diff --git a/translator/translate/otel/pipeline/emf_logs/translator.go b/translator/translate/otel/pipeline/emf_logs/translator.go index bc25ad6eec..c155b8176c 100644 --- a/translator/translate/otel/pipeline/emf_logs/translator.go +++ b/translator/translate/otel/pipeline/emf_logs/translator.go @@ -50,7 +50,9 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators Receivers: common.NewTranslatorMap[component.Config](), Processors: common.NewTranslatorMap(batchprocessor.NewTranslatorWithNameAndSection(common.PipelineNameEmfLogs, common.LogsKey)), // EMF logs sit under metrics_collected in "logs" Exporters: common.NewTranslatorMap(awscloudwatchlogs.NewTranslatorWithName(common.PipelineNameEmfLogs)), - Extensions: common.NewTranslatorMap(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents})), + Extensions: common.NewTranslatorMap(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents}), + agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true), + ), } if serviceAddress, ok := common.GetString(conf, serviceAddressEMFKey); ok { if strings.Contains(serviceAddress, common.Udp) { diff --git a/translator/translate/otel/pipeline/emf_logs/translator_test.go b/translator/translate/otel/pipeline/emf_logs/translator_test.go index f3efe38b8b..2354ca057e 100644 --- a/translator/translate/otel/pipeline/emf_logs/translator_test.go +++ b/translator/translate/otel/pipeline/emf_logs/translator_test.go @@ -48,7 +48,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"tcplog/emf_logs", "udplog/emf_logs"}, processors: []string{"batch/emf_logs"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, "WithStructuredLogKey": { @@ -64,7 +64,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"tcplog/emf_logs", "udplog/emf_logs"}, processors: []string{"batch/emf_logs"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, "WithUdpServiceAddress": { @@ -82,7 +82,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"udplog/emf_logs"}, processors: []string{"batch/emf_logs"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, "WithTcpServiceAddress": { @@ -100,7 +100,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"tcplog/emf_logs"}, processors: []string{"batch/emf_logs"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, } diff --git a/translator/translate/otel/pipeline/host/translator.go b/translator/translate/otel/pipeline/host/translator.go index 641ed43e93..0422b4165c 100644 --- a/translator/translate/otel/pipeline/host/translator.go +++ b/translator/translate/otel/pipeline/host/translator.go @@ -104,6 +104,7 @@ func (t translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators, case common.DefaultDestination, common.CloudWatchKey: translators.Exporters.Set(awscloudwatch.NewTranslator()) translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeMetrics, []string{agenthealth.OperationPutMetricData})) + translators.Extensions.Set(agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true)) case common.AMPKey: if conf.IsSet(common.MetricsAggregationDimensionsKey) { translators.Processors.Set(rollupprocessor.NewTranslator()) @@ -115,6 +116,7 @@ func (t translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators, translators.Processors.Set(batchprocessor.NewTranslatorWithNameAndSection(t.name, common.LogsKey)) translators.Exporters.Set(awsemf.NewTranslator()) translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents})) + translators.Extensions.Set(agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true)) default: return nil, fmt.Errorf("pipeline (%s) does not support destination (%s) in configuration", t.name, t.Destination()) } diff --git a/translator/translate/otel/pipeline/host/translator_test.go b/translator/translate/otel/pipeline/host/translator_test.go index 85f7f762c2..2fbd2c60be 100644 --- a/translator/translate/otel/pipeline/host/translator_test.go +++ b/translator/translate/otel/pipeline/host/translator_test.go @@ -59,7 +59,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"nop", "other"}, processors: []string{"awsentity/resource"}, exporters: []string{"awscloudwatch"}, - extensions: []string{"agenthealth/metrics"}, + extensions: []string{"agenthealth/metrics", "agenthealth/statuscode"}, }, }, "WithDeltaMetrics": { @@ -77,7 +77,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"nop", "other"}, processors: []string{"awsentity/resource", "cumulativetodelta/hostDeltaMetrics"}, exporters: []string{"awscloudwatch"}, - extensions: []string{"agenthealth/metrics"}, + extensions: []string{"agenthealth/metrics", "agenthealth/statuscode"}, }, }, "WithMetricsKeyStatsD": { @@ -95,7 +95,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"nop", "other"}, processors: []string{"awsentity/service/telegraf"}, exporters: []string{"awscloudwatch"}, - extensions: []string{"agenthealth/metrics"}, + extensions: []string{"agenthealth/metrics", "agenthealth/statuscode"}, }, }, "WithMetricsKeyStatsDContainer": { @@ -114,7 +114,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"nop", "other"}, processors: []string{}, exporters: []string{"awscloudwatch"}, - extensions: []string{"agenthealth/metrics"}, + extensions: []string{"agenthealth/metrics", "agenthealth/statuscode"}, }, }, "WithMetricDecoration": { @@ -139,7 +139,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"nop", "other"}, processors: []string{"awsentity/resource", "transform"}, exporters: []string{"awscloudwatch"}, - extensions: []string{"agenthealth/metrics"}, + extensions: []string{"agenthealth/metrics", "agenthealth/statuscode"}, }, }, "WithoutMetricDecoration": { @@ -161,7 +161,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"nop", "other"}, processors: []string{"awsentity/resource"}, exporters: []string{"awscloudwatch"}, - extensions: []string{"agenthealth/metrics"}, + extensions: []string{"agenthealth/metrics", "agenthealth/statuscode"}, }, }, "WithAppendDimensions": { @@ -177,7 +177,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"nop", "other"}, processors: []string{"awsentity/resource", "ec2tagger"}, exporters: []string{"awscloudwatch"}, - extensions: []string{"agenthealth/metrics"}, + extensions: []string{"agenthealth/metrics", "agenthealth/statuscode"}, }, }, "WithPRWExporter/Aggregation": { diff --git a/translator/translate/otel/pipeline/jmx/translator.go b/translator/translate/otel/pipeline/jmx/translator.go index 1a9f608b35..5de029e533 100644 --- a/translator/translate/otel/pipeline/jmx/translator.go +++ b/translator/translate/otel/pipeline/jmx/translator.go @@ -113,7 +113,7 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators case common.DefaultDestination, common.CloudWatchKey: translators.Processors.Set(cumulativetodeltaprocessor.NewTranslator(common.WithName(common.PipelineNameJmx), cumulativetodeltaprocessor.WithConfigKeys(common.JmxConfigKey))) translators.Exporters.Set(awscloudwatch.NewTranslator()) - translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeMetrics, []string{agenthealth.OperationPutMetricData})) + translators.Extensions.Set(agenthealth.NewTranslatorWithStatusCode(component.DataTypeMetrics, []string{agenthealth.OperationPutMetricData}, true)) case common.AMPKey: translators.Processors.Set(batchprocessor.NewTranslatorWithNameAndSection(t.name, common.MetricsKey)) if conf.IsSet(common.MetricsAggregationDimensionsKey) { diff --git a/translator/translate/otel/pipeline/prometheus/translator.go b/translator/translate/otel/pipeline/prometheus/translator.go index 47f34c5d62..a83f777faa 100644 --- a/translator/translate/otel/pipeline/prometheus/translator.go +++ b/translator/translate/otel/pipeline/prometheus/translator.go @@ -70,8 +70,9 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators Processors: common.NewTranslatorMap( batchprocessor.NewTranslatorWithNameAndSection(t.name, common.LogsKey), // prometheus sits under metrics_collected in "logs" ), - Exporters: common.NewTranslatorMap(awsemf.NewTranslatorWithName(common.PipelineNamePrometheus)), - Extensions: common.NewTranslatorMap(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents})), + Exporters: common.NewTranslatorMap(awsemf.NewTranslatorWithName(common.PipelineNamePrometheus)), + Extensions: common.NewTranslatorMap(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents}), + agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true)), }, nil case common.AMPKey: if !conf.IsSet(MetricsKey) { diff --git a/translator/translate/otel/pipeline/prometheus/translator_test.go b/translator/translate/otel/pipeline/prometheus/translator_test.go index bad9e1bd42..2b04cb4467 100644 --- a/translator/translate/otel/pipeline/prometheus/translator_test.go +++ b/translator/translate/otel/pipeline/prometheus/translator_test.go @@ -84,7 +84,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"telegraf_prometheus"}, processors: []string{"batch/prometheus/cloudwatchlogs"}, exporters: []string{"awsemf/prometheus"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, "WithValidAMP": { @@ -125,7 +125,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"telegraf_prometheus"}, processors: []string{"batch/prometheus/cloudwatchlogs"}, exporters: []string{"awsemf/prometheus"}, - extensions: []string{"agenthealth/logs"}, + extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, }, } diff --git a/translator/translate/otel/pipeline/xray/translator.go b/translator/translate/otel/pipeline/xray/translator.go index b2866e0a90..1da9220e51 100644 --- a/translator/translate/otel/pipeline/xray/translator.go +++ b/translator/translate/otel/pipeline/xray/translator.go @@ -48,7 +48,8 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators Receivers: common.NewTranslatorMap[component.Config](), Processors: common.NewTranslatorMap(processor.NewDefaultTranslatorWithName(pipelineName, batchprocessor.NewFactory())), Exporters: common.NewTranslatorMap(awsxrayexporter.NewTranslator()), - Extensions: common.NewTranslatorMap(agenthealth.NewTranslator(component.DataTypeTraces, []string{agenthealth.OperationPutTraceSegments})), + Extensions: common.NewTranslatorMap(agenthealth.NewTranslator(component.DataTypeTraces, []string{agenthealth.OperationPutTraceSegments}), + agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true)), } if conf.IsSet(xrayKey) { translators.Receivers.Set(awsxrayreceiver.NewTranslator()) diff --git a/translator/translate/otel/pipeline/xray/translator_test.go b/translator/translate/otel/pipeline/xray/translator_test.go index 888c7c1775..75a3e62825 100644 --- a/translator/translate/otel/pipeline/xray/translator_test.go +++ b/translator/translate/otel/pipeline/xray/translator_test.go @@ -46,7 +46,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"awsxray"}, processors: []string{"batch/xray"}, exporters: []string{"awsxray"}, - extensions: []string{"agenthealth/traces"}, + extensions: []string{"agenthealth/traces", "agenthealth/statuscode"}, }, }, "WithOtlpKey": { @@ -61,7 +61,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"otlp/traces"}, processors: []string{"batch/xray"}, exporters: []string{"awsxray"}, - extensions: []string{"agenthealth/traces"}, + extensions: []string{"agenthealth/traces", "agenthealth/statuscode"}, }, }, "WithXrayAndOtlpKey": { @@ -77,7 +77,7 @@ func TestTranslator(t *testing.T) { receivers: []string{"awsxray", "otlp/traces"}, processors: []string{"batch/xray"}, exporters: []string{"awsxray"}, - extensions: []string{"agenthealth/traces"}, + extensions: []string{"agenthealth/traces", "agenthealth/statuscode"}, }, }, } diff --git a/translator/translate/otel/processor/ec2taggerprocessor/translator.go b/translator/translate/otel/processor/ec2taggerprocessor/translator.go index 4f8fa3a72f..2add6ecf55 100644 --- a/translator/translate/otel/processor/ec2taggerprocessor/translator.go +++ b/translator/translate/otel/processor/ec2taggerprocessor/translator.go @@ -14,6 +14,7 @@ import ( "github.com/aws/amazon-cloudwatch-agent/plugins/processors/ec2tagger" "github.com/aws/amazon-cloudwatch-agent/translator/translate/agent" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common" + "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" ) var Ec2taggerKey = common.ConfigKey(common.MetricsKey, common.AppendDimensionsKey) @@ -63,6 +64,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg.DiskDeviceTagKey = "device" } + cfg.MiddlewareID = &agenthealth.StatusCodeID cfg.RefreshIntervalSeconds = time.Duration(0) cfg.IMDSRetries = retryer.GetDefaultRetryNumber() diff --git a/translator/translate/otel/processor/resourcedetection/translator.go b/translator/translate/otel/processor/resourcedetection/translator.go index 454e59ed79..5113d8de24 100644 --- a/translator/translate/otel/processor/resourcedetection/translator.go +++ b/translator/translate/otel/processor/resourcedetection/translator.go @@ -63,7 +63,10 @@ func (t *translator) ID() component.ID { func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg := t.factory.CreateDefaultConfig().(*resourcedetectionprocessor.Config) - + // > [!WARNING] + // > Only uncomment the following line when this PR is merged: https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/265 + // > cfg.MiddlewareID = &agenthealth.StatusCodeID + // > This will be added when contrib changes are made. mode := context.CurrentContext().KubernetesMode() if mode == "" { mode = context.CurrentContext().Mode() @@ -80,4 +83,8 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { default: return common.GetYamlFileToYamlConfig(cfg, appSignalsDefaultResourceDetectionConfig) } + // > [!WARNING] + // > Only uncomment the following line when this PR is merged: https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/265 + // > cfg.MiddlewareID = &agenthealth.StatusCodeID + // > This will be added when contrib changes are made. } diff --git a/translator/translate/otel/receiver/awscontainerinsight/translator.go b/translator/translate/otel/receiver/awscontainerinsight/translator.go index 193fdbe87b..88f50d249f 100644 --- a/translator/translate/otel/receiver/awscontainerinsight/translator.go +++ b/translator/translate/otel/receiver/awscontainerinsight/translator.go @@ -120,6 +120,11 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg.RunOnSystemd = !context.CurrentContext().RunInContainer() } + // > [!WARNING] + // > Only uncomment the following line when this PR is merged: https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/265 + // > cfg.MiddlewareID = &agenthealth.StatusCodeID + // > This will be added when contrib changes are made. + cfg.PrefFullPodName = cfg.PrefFullPodName || common.GetOrDefaultBool(conf, common.ConfigKey(common.LogsKey, common.MetricsCollectedKey, common.KubernetesKey, common.PreferFullPodName), false) cfg.EnableAcceleratedComputeMetrics = cfg.EnableAcceleratedComputeMetrics || AcceleratedComputeMetricsEnabled(conf) From 9bbb6245dd9412ed8fe281682eaf07502f8b6bc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:51:09 -0500 Subject: [PATCH 05/14] Bump golang.org/x/crypto from 0.25.0 to 0.31.0 (#1469) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 19b600ae60..7cad6d193e 100644 --- a/go.mod +++ b/go.mod @@ -196,9 +196,9 @@ require ( go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 golang.org/x/net v0.27.0 - golang.org/x/sync v0.7.0 - golang.org/x/sys v0.22.0 - golang.org/x/text v0.16.0 + golang.org/x/sync v0.10.0 + golang.org/x/sys v0.28.0 + golang.org/x/text v0.21.0 gopkg.in/fsnotify.v1 v1.4.7 gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 @@ -507,10 +507,10 @@ require ( go.opentelemetry.io/otel/trace v1.27.0 // indirect go.opentelemetry.io/proto/otlp v1.2.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.25.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/term v0.22.0 // indirect + golang.org/x/term v0.27.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gonum.org/v1/gonum v0.15.0 // indirect diff --git a/go.sum b/go.sum index bc424f0b60..a048d204f0 100644 --- a/go.sum +++ b/go.sum @@ -1724,8 +1724,8 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58 golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1842,8 +1842,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1928,8 +1928,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1939,8 +1939,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1956,8 +1956,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 3f7840657b8218df36c300c259ee28089314f67f Mon Sep 17 00:00:00 2001 From: Parampreet Singh <50599809+Paramadon@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:13:25 +0100 Subject: [PATCH 06/14] Upgrade otel compenents to v0.0.0-20240528184218-531527333157 (#1473) --- Makefile | 6 +- go.mod | 52 ++--- go.sum | 100 ++++----- .../sampleConfig/advanced_config_darwin.yaml | 4 +- .../sampleConfig/advanced_config_linux.yaml | 2 +- .../sampleConfig/advanced_config_windows.yaml | 2 +- .../appsignals_and_ecs_config.yaml | 1 + .../appsignals_and_eks_config.yaml | 2 + .../appsignals_and_k8s_config.yaml | 2 + .../appsignals_fallback_and_eks_config.yaml | 2 + .../appsignals_over_fallback_config.yaml | 2 + .../sampleConfig/base_appsignals_config.yaml | 1 + .../base_appsignals_fallback_config.yaml | 1 + .../base_container_insights_config.yaml | 1 + .../sampleConfig/basic_config_linux.yaml | 2 +- .../sampleConfig/basic_config_windows.yaml | 2 +- .../sampleConfig/compass_linux_config.yaml | 2 +- .../sampleConfig/complete_darwin_config.yaml | 16 +- .../sampleConfig/complete_linux_config.yaml | 14 +- .../sampleConfig/container_insights_jmx.yaml | 1 + .../sampleConfig/delta_net_config_linux.yaml | 2 +- .../emf_and_kubernetes_config.yaml | 1 + .../emf_and_kubernetes_with_gpu_config.yaml | 207 +++++++++--------- .../emf_and_kubernetes_with_kueue_config.yaml | 1 + .../sampleConfig/invalid_input_linux.yaml | 4 +- .../sampleConfig/jmx_config_linux.yaml | 6 +- .../kubernetes_on_prem_config.yaml | 1 + .../kueue_container_insights_config.yaml | 1 + .../sampleConfig/log_ecs_metric_only.yaml | 1 + .../logs_and_kubernetes_config.yaml | 1 + .../sampleConfig/standard_config_linux.yaml | 2 +- .../sampleConfig/standard_config_windows.yaml | 2 +- ...ard_config_windows_with_common_config.yaml | 4 +- translator/tocwconfig/tocwconfig_test.go | 93 ++++---- .../processor/resourcedetection/translator.go | 11 +- .../resourcedetection/translator_test.go | 2 + .../awscontainerinsight/translator.go | 8 +- 37 files changed, 288 insertions(+), 274 deletions(-) diff --git a/Makefile b/Makefile index da9c8294a0..03e22d2f20 100644 --- a/Makefile +++ b/Makefile @@ -25,9 +25,9 @@ WIN_BUILD = GOOS=windows GOARCH=amd64 go build -trimpath -buildmode=${CWAGENT_BU DARWIN_BUILD_AMD64 = CGO_ENABLED=1 GO111MODULE=on GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="${LDFLAGS}" -o $(BUILD_SPACE)/bin/darwin_amd64 DARWIN_BUILD_ARM64 = CGO_ENABLED=1 GO111MODULE=on GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="${LDFLAGS}" -o $(BUILD_SPACE)/bin/darwin_arm64 -IMAGE_REGISTRY = 730335384949.dkr.ecr.us-west-2.amazonaws.com -IMAGE_REPO = cwagent -IMAGE_TAG = latest +IMAGE_REGISTRY = amazon +IMAGE_REPO = cloudwatch-agent +IMAGE_TAG = $(VERSION) IMAGE = $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(IMAGE_TAG) DOCKER_BUILD_FROM_SOURCE = docker build -t $(IMAGE) -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/source/Dockerfile DOCKER_WINDOWS_BUILD_FROM_SOURCE = docker build -t $(IMAGE) -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/source/Dockerfile.Windows diff --git a/go.mod b/go.mod index 7cad6d193e..d91df3986f 100644 --- a/go.mod +++ b/go.mod @@ -7,41 +7,43 @@ replace github.com/influxdata/telegraf => github.com/aws/telegraf v0.10.2-0.2024 // Replace with https://github.com/amazon-contributing/opentelemetry-collector-contrib, there are no requirements for all receivers/processors/exporters // to be all replaced since there are some changes that will always be from upstream replace ( - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsemfexporter v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.0.0-20241206205307-66e9942f29e0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsemfexporter v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter => github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.0.0-20241216205413-8e059f1441db ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy => github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsproxy v0.0.0-20241206205307-66e9942f29e0 +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy => github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsproxy v0.0.0-20241216205413-8e059f1441db replace ( - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/awsutil v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/containerinsight v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/cwlogs v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/k8s => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/k8s v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/proxy v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/k8sconfig v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/kubelet v0.0.0-20241206205307-66e9942f29e0 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/awsutil v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/containerinsight v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/cwlogs v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/k8s => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/k8s v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/proxy v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/k8sconfig v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/kubelet v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders => github.com/amazon-contributing/opentelemetry-collector-contrib/internal/metadataproviders v0.0.0-20241216205413-8e059f1441db + ) replace ( // For clear resource attributes after copy functionality https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/148 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/stanza v0.0.0-20241206205307-66e9942f29e0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/stanza v0.0.0-20241216205413-8e059f1441db // Replace with contrib to revert upstream change https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/20519 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/translator/prometheus v0.0.0-20241206205307-66e9942f29e0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus => github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/translator/prometheus v0.0.0-20241216205413-8e059f1441db ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor => github.com/amazon-contributing/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.0.0-20241206205307-66e9942f29e0 +replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor => github.com/amazon-contributing/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.0.0-20241216205413-8e059f1441db replace ( - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jmxreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/jmxreceiver v0.0.0-20241206205307-66e9942f29e0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.0.0-20241206205307-66e9942f29e0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jmxreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/jmxreceiver v0.0.0-20241216205413-8e059f1441db + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver => github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.0.0-20241216205413-8e059f1441db ) // Temporary fix, pending PR https://github.com/shirou/gopsutil/pull/957 @@ -92,7 +94,7 @@ replace github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.48.6 require ( github.com/BurntSushi/toml v1.3.2 github.com/Jeffail/gabs v1.4.0 - github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20241206205307-66e9942f29e0 + github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20241216205413-8e059f1441db github.com/aws/aws-sdk-go v1.53.11 github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.30.2 github.com/bigkevmcd/go-configparser v0.0.0-20200217161103-d137835d2579 @@ -144,7 +146,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.103.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.103.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.103.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20241206205307-66e9942f29e0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20241216205413-8e059f1441db github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsecscontainermetricsreceiver v0.103.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.103.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.103.0 @@ -232,7 +234,7 @@ require ( github.com/alecthomas/participle v0.4.1 // indirect github.com/alecthomas/participle/v2 v2.1.1 // indirect github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect - github.com/amazon-contributing/opentelemetry-collector-contrib/override/aws v0.0.0-20241206205307-66e9942f29e0 // indirect + github.com/amazon-contributing/opentelemetry-collector-contrib/override/aws v0.0.0-20241216205413-8e059f1441db // indirect github.com/antchfx/jsonquery v1.1.5 // indirect github.com/antchfx/xmlquery v1.3.9 // indirect github.com/antchfx/xpath v1.2.0 // indirect diff --git a/go.sum b/go.sum index a048d204f0..15601b6998 100644 --- a/go.sum +++ b/go.sum @@ -180,54 +180,56 @@ github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 h1:ez/4by2iGztzR4 github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1483 h1:J8HaD+Zpfi1gcel3HCKpoHHEsrcuRrZlSnx7R9SCf5I= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1483/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= -github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.0.0-20241206205307-66e9942f29e0 h1:GgevwfZ41Fm8fGY941X3Vhwzj6AnOcyPjKfupOM/o6I= -github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.0.0-20241206205307-66e9942f29e0/go.mod h1:f9JwM/LQdKH8ZbYoH9TO35rmjM6WoTNlhWtYJ3YZucc= -github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsemfexporter v0.0.0-20241206205307-66e9942f29e0 h1:9F7kOfAKeYFIiiiX8ojNvJYLtv0sJhSacgjJ+pghFVA= -github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsemfexporter v0.0.0-20241206205307-66e9942f29e0/go.mod h1:LPWBVdTSNbZkk80v6aCUthS59cnR4VauVRdAIE3ifaY= -github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.0.0-20241206205307-66e9942f29e0 h1:i7NvWVLTk3CYyc9PoM4gCf4rVEbtjVV+kkRRE4hXq7c= -github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.0.0-20241206205307-66e9942f29e0/go.mod h1:GNeNylfr5KMt55XowzSdgbP7z8CkIAfIHtWSd+xxtws= -github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20241206205307-66e9942f29e0 h1:/60aJEsBjrvauK2A4uUfZxIo05Dqo+BqlhO/WbIHMoE= -github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20241206205307-66e9942f29e0/go.mod h1:/RaNSxxO06niapGT00snMdgFfjjjW/kV3TZGX8kHuwM= -github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsproxy v0.0.0-20241206205307-66e9942f29e0 h1:UqVLY8i2UVctbr1YkId5ovbfE6uXSgXrBCQNZ9uvO0I= -github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsproxy v0.0.0-20241206205307-66e9942f29e0/go.mod h1:hRZt1DsvoLDIYBwjFvjwg/9IkaBXeCPG0QI57wbj98Q= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/awsutil v0.0.0-20241206205307-66e9942f29e0 h1:A7oYZ8dU4oL/Su/YTUZXh9+CR9pxZ1YkexByDm1f51g= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/awsutil v0.0.0-20241206205307-66e9942f29e0/go.mod h1:YL1Y62PxJ7dem1ZBUqCfvbnePaGr5p7DTSyOXSCi6O4= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/containerinsight v0.0.0-20241206205307-66e9942f29e0 h1:TivXmQKWMWMLM3eTCugdlkmlIDK6B/YT1IqnEFpNLKo= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/containerinsight v0.0.0-20241206205307-66e9942f29e0/go.mod h1:LT+qAyMutoADv2qezO+vkm/BkxR88qEfXdF2d13mV+E= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/cwlogs v0.0.0-20241206205307-66e9942f29e0 h1:W0VF6In6tZX2lhFuSi1/obfrABmMf9AfW48C8NVOBCM= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/cwlogs v0.0.0-20241206205307-66e9942f29e0/go.mod h1:SkscNdWANcuDJ7PkjS5wurSTAuY69nqP0I+cEVY9Ryw= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/k8s v0.0.0-20241206205307-66e9942f29e0 h1:dGaKfBf8rQ38sPZ1GVdkwZAGcf3jLoNxqpLPACZ7FYA= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/k8s v0.0.0-20241206205307-66e9942f29e0/go.mod h1:/TOECDME2jYRPY21CrpTX2eMADJdkmBFBXc1lV/nRZA= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/proxy v0.0.0-20241206205307-66e9942f29e0 h1:BISMlS+cB5bustBU+OmIej5jzLUPWP9tE+OxAH2jxb4= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/proxy v0.0.0-20241206205307-66e9942f29e0/go.mod h1:J08A2gx8VFQfuoBiEfZ6uHIkMtVLd0OuRe5pP88b3I0= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-20241206205307-66e9942f29e0 h1:O6uXxhlv21vBepDu1SKDmwDeVD0+XQwxaSVjaY/0g1Q= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-20241206205307-66e9942f29e0/go.mod h1:+w647+1nLYvZWdk24gZWvdl/kFowbe2iDyISXLDYdmQ= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-20241206205307-66e9942f29e0 h1:WzxoCCMExJIZScglR8NFMiUa70ZlYpKhexdCbTZIfXA= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-20241206205307-66e9942f29e0/go.mod h1:Ai4BsM7C05bEQYO2O272S1LmsyIhO5r0iLmXF5NN5so= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/k8sconfig v0.0.0-20241206205307-66e9942f29e0 h1:KECRUpyad535mqD6j5y+AY2rp5qPOhau0EsGHbBCf54= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/k8sconfig v0.0.0-20241206205307-66e9942f29e0/go.mod h1:VS66oUydCMwiWl1BFmLs7iNy4lGsfVYsriXr/d1fpAk= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/kubelet v0.0.0-20241206205307-66e9942f29e0 h1:EO1aIMxxB3/74rkrQL6Jkg+VwVZdcCF3U+aCJTm+N60= -github.com/amazon-contributing/opentelemetry-collector-contrib/internal/kubelet v0.0.0-20241206205307-66e9942f29e0/go.mod h1:4qvmHiXPOkOXJdpmmxMqprb2BXxOGPgOG45BwLdipUM= -github.com/amazon-contributing/opentelemetry-collector-contrib/override/aws v0.0.0-20241206205307-66e9942f29e0 h1:WMsFbb3M5xwS9ZAkF3O70DkWa/DCoren7Ib+RCDpF8w= -github.com/amazon-contributing/opentelemetry-collector-contrib/override/aws v0.0.0-20241206205307-66e9942f29e0/go.mod h1:t/hYoRTnlPuRjh8y0BwVGgNvNIXpU2QJME5YVppUUHQ= -github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.0.0-20241206205307-66e9942f29e0 h1:zv+JZpDFVgMHCFIOvjMvHRLMPUQXlN/rYNEuGGMmbmQ= -github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.0.0-20241206205307-66e9942f29e0/go.mod h1:Rr5b3hr6Jy9w/zTjsOl3vcyDDusc90P+iGdOd0UCYOo= -github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/stanza v0.0.0-20241206205307-66e9942f29e0 h1:ZZrn0V1pp5kdKHewBgblKxhEfcD4gz6pviu8qX5GbXs= -github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/stanza v0.0.0-20241206205307-66e9942f29e0/go.mod h1:2NSghK+mafMGxM8c4Gff8qcprdMD3YQebZtD9UAdB3E= -github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/translator/prometheus v0.0.0-20241206205307-66e9942f29e0 h1:VJNqzoEwsRx3ZTcQMNv+Yiwa/wo7qcRSVDCJU/bedsw= -github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/translator/prometheus v0.0.0-20241206205307-66e9942f29e0/go.mod h1:21nuEQl7YYeLkVrGGvxPXkljqjR40teBCG5trGZ5LxM= -github.com/amazon-contributing/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.0.0-20241206205307-66e9942f29e0 h1:t7vnpLQ3CFntUBL1e4CDIY3gu+OkcwDd/yqwwO88ZdU= -github.com/amazon-contributing/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.0.0-20241206205307-66e9942f29e0/go.mod h1:uzpU7Y6+oL6RdOv8IWi6fjT8LNV6FYX6CN6NATLJOiQ= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.0.0-20241206205307-66e9942f29e0 h1:1DyJ6QJ/dPlMI5fSqJK4Zp0ameSdEpR7dqtKQtHw3bQ= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.0.0-20241206205307-66e9942f29e0/go.mod h1:eafplURJOusRrEwH+/hjaiURS+OiKLEgaA4DGhp/rhk= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20241206205307-66e9942f29e0 h1:IIIp7tjS49qYS8JoZaB/GnVFPE/CK/riTVgwyViE6fI= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20241206205307-66e9942f29e0/go.mod h1:QWPqmqbzXUZtrh4I0uCJXzDnvUMdxDd9UGjdZLGxf68= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.0.0-20241206205307-66e9942f29e0 h1:JlwqDIMZy3PHbb281sQhTXDhreSLIheOWO1FvBSxuhk= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.0.0-20241206205307-66e9942f29e0/go.mod h1:igQaQJt7eA/y3dZ2VLXVql+6k/ZXBgrAa2y9FrMMIKQ= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/jmxreceiver v0.0.0-20241206205307-66e9942f29e0 h1:iGIXsNKYVSm8eBdsUb31IPKSclLWPR28HyMmnB7o4BY= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/jmxreceiver v0.0.0-20241206205307-66e9942f29e0/go.mod h1:hRUrYatVP/GFNxHn2yW1gJcnPyGtdlTXyebpzzzjZeU= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.0.0-20241206205307-66e9942f29e0 h1:6vB4V36cZB6XAcx6napCBIjptTERfMR9rsPOA99WrZo= -github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.0.0-20241206205307-66e9942f29e0/go.mod h1:/R2tBPLPR8dLZA0BQI2ZA7IB/zU7Q+Ghp+ujiPacVkA= +github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.0.0-20241216205413-8e059f1441db h1:M3mCeHB5pVhpGdFkx9qJlBtUURxkg6fEQUNNJdYLk3I= +github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.0.0-20241216205413-8e059f1441db/go.mod h1:f9JwM/LQdKH8ZbYoH9TO35rmjM6WoTNlhWtYJ3YZucc= +github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsemfexporter v0.0.0-20241216205413-8e059f1441db h1:N0An6pXgyPzUIwzqyiO2u6U2SwedbIR25ntcf4KoU3g= +github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsemfexporter v0.0.0-20241216205413-8e059f1441db/go.mod h1:LPWBVdTSNbZkk80v6aCUthS59cnR4VauVRdAIE3ifaY= +github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.0.0-20241216205413-8e059f1441db h1:L+xPXimFZAtTgougLt59HvivqCyBgh066rv/XbenHUM= +github.com/amazon-contributing/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.0.0-20241216205413-8e059f1441db/go.mod h1:GNeNylfr5KMt55XowzSdgbP7z8CkIAfIHtWSd+xxtws= +github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20241216205413-8e059f1441db h1:rdQRfKoW60Aomz9Tc8fF0Ld5x/Q96vNz8idPQF/qG9Q= +github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware v0.0.0-20241216205413-8e059f1441db/go.mod h1:/RaNSxxO06niapGT00snMdgFfjjjW/kV3TZGX8kHuwM= +github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsproxy v0.0.0-20241216205413-8e059f1441db h1:hz8QaW7a5RhFo5/9XRACEcEtEp/D6xElN9jW092NU3o= +github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsproxy v0.0.0-20241216205413-8e059f1441db/go.mod h1:hRZt1DsvoLDIYBwjFvjwg/9IkaBXeCPG0QI57wbj98Q= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/awsutil v0.0.0-20241216205413-8e059f1441db h1:q+FeNooNk9UHEkwGqQB++KanhE0Plu9yDYtNxSN4i7w= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/awsutil v0.0.0-20241216205413-8e059f1441db/go.mod h1:YL1Y62PxJ7dem1ZBUqCfvbnePaGr5p7DTSyOXSCi6O4= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/containerinsight v0.0.0-20241216205413-8e059f1441db h1:xnj2m4/8b/B84g6AkH5fxhuVvuyeCun7OohdcFd396U= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/containerinsight v0.0.0-20241216205413-8e059f1441db/go.mod h1:LT+qAyMutoADv2qezO+vkm/BkxR88qEfXdF2d13mV+E= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/cwlogs v0.0.0-20241216205413-8e059f1441db h1:zlFQw3BjI/5iYOmfvec3tzD9uO7k5IcYSAYvJpD8iuU= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/cwlogs v0.0.0-20241216205413-8e059f1441db/go.mod h1:SkscNdWANcuDJ7PkjS5wurSTAuY69nqP0I+cEVY9Ryw= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/k8s v0.0.0-20241216205413-8e059f1441db h1:hKeTI5bm2QKvFrsZDI4MNmj5Q86rGdxlucKwTF+2MzY= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/k8s v0.0.0-20241216205413-8e059f1441db/go.mod h1:/TOECDME2jYRPY21CrpTX2eMADJdkmBFBXc1lV/nRZA= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/proxy v0.0.0-20241216205413-8e059f1441db h1:TTp+wkHzVY6SHL6Cj4O7XnAxLL7iYf7rZ2pDx6ILQgk= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/proxy v0.0.0-20241216205413-8e059f1441db/go.mod h1:J08A2gx8VFQfuoBiEfZ6uHIkMtVLd0OuRe5pP88b3I0= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-20241216205413-8e059f1441db h1:zeZ/RfbeKYNUzglQs3JcXOkeHMndO8mCUfoNddTJnW0= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-20241216205413-8e059f1441db/go.mod h1:+w647+1nLYvZWdk24gZWvdl/kFowbe2iDyISXLDYdmQ= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-20241216205413-8e059f1441db h1:y7Fd6vE3G6bxB/S6a1yli54aA2hLNk7SxzjJ6X3H9iU= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-20241216205413-8e059f1441db/go.mod h1:Ai4BsM7C05bEQYO2O272S1LmsyIhO5r0iLmXF5NN5so= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/k8sconfig v0.0.0-20241216205413-8e059f1441db h1:GFcv7W5ZCkQ7JZd2rqGXmu8IQJNQux1L0e+NWETnk3c= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/k8sconfig v0.0.0-20241216205413-8e059f1441db/go.mod h1:VS66oUydCMwiWl1BFmLs7iNy4lGsfVYsriXr/d1fpAk= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/kubelet v0.0.0-20241216205413-8e059f1441db h1:USnGN4kAHNum+M14jp7HOGe8IZIw+LrA668XyiL3UPk= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/kubelet v0.0.0-20241216205413-8e059f1441db/go.mod h1:4qvmHiXPOkOXJdpmmxMqprb2BXxOGPgOG45BwLdipUM= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/metadataproviders v0.0.0-20241216205413-8e059f1441db h1:mYtRMWfhv2wGWFhA/3vsX1DwUKgrLSC21a/NZR69fTQ= +github.com/amazon-contributing/opentelemetry-collector-contrib/internal/metadataproviders v0.0.0-20241216205413-8e059f1441db/go.mod h1:l/vd01pHoBByPjOL0xXK7Qg3+qIpPb0RGcpORNciJJM= +github.com/amazon-contributing/opentelemetry-collector-contrib/override/aws v0.0.0-20241216205413-8e059f1441db h1:Lqq98S/zDfQ+y0OJu9EIwdmgFf5gCJ1chDZJWqpydVs= +github.com/amazon-contributing/opentelemetry-collector-contrib/override/aws v0.0.0-20241216205413-8e059f1441db/go.mod h1:t/hYoRTnlPuRjh8y0BwVGgNvNIXpU2QJME5YVppUUHQ= +github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.0.0-20241216205413-8e059f1441db h1:cHgCAM78RpGlltSVJ905LD/JZqYfEpc4Gb6xZvPh50U= +github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.0.0-20241216205413-8e059f1441db/go.mod h1:Rr5b3hr6Jy9w/zTjsOl3vcyDDusc90P+iGdOd0UCYOo= +github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/stanza v0.0.0-20241216205413-8e059f1441db h1:eSQHA4NrEITpzRdsu5vDJO2Cuuu8Dn8dr0augxc+Oyk= +github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/stanza v0.0.0-20241216205413-8e059f1441db/go.mod h1:2NSghK+mafMGxM8c4Gff8qcprdMD3YQebZtD9UAdB3E= +github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/translator/prometheus v0.0.0-20241216205413-8e059f1441db h1:X6bJy+ZTMbyFx5+JlJ4OkIBhjN7byZ1FLz2BbxBVOGc= +github.com/amazon-contributing/opentelemetry-collector-contrib/pkg/translator/prometheus v0.0.0-20241216205413-8e059f1441db/go.mod h1:21nuEQl7YYeLkVrGGvxPXkljqjR40teBCG5trGZ5LxM= +github.com/amazon-contributing/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.0.0-20241216205413-8e059f1441db h1:hLUqHFJ1WXLugc2UaX921NREVt5Z97LtKhsCvbIp5M4= +github.com/amazon-contributing/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.0.0-20241216205413-8e059f1441db/go.mod h1:mwpBj24vuuuvs11sJpGWtWLtd9Ou7RizcuXc+Uofhi8= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.0.0-20241216205413-8e059f1441db h1:kfh9b7QjmRIkT6ytj/GcpQXn+zQtIaxMtfzfyTiChr8= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.0.0-20241216205413-8e059f1441db/go.mod h1:dnULh8T9lt2RWMwLd3DdTPiTwniRrHlOQLcdVDn9/aQ= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20241216205413-8e059f1441db h1:MLRpuOmiOtN/vzFQCSaO+HrcZPOi4GW2wZvRQonJsLo= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awscontainerinsightskueuereceiver v0.0.0-20241216205413-8e059f1441db/go.mod h1:QWPqmqbzXUZtrh4I0uCJXzDnvUMdxDd9UGjdZLGxf68= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.0.0-20241216205413-8e059f1441db h1:QMTBAyheWMMOEDzLd9srk9relhYBnGhr3gQCHX+g/AA= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.0.0-20241216205413-8e059f1441db/go.mod h1:igQaQJt7eA/y3dZ2VLXVql+6k/ZXBgrAa2y9FrMMIKQ= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/jmxreceiver v0.0.0-20241216205413-8e059f1441db h1:v5kOaxE58eP9KZTl3YhbcHjkdDFRf3Sqjxl0HAT0HxE= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/jmxreceiver v0.0.0-20241216205413-8e059f1441db/go.mod h1:hRUrYatVP/GFNxHn2yW1gJcnPyGtdlTXyebpzzzjZeU= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.0.0-20241216205413-8e059f1441db h1:LCYWqC+KCiq3gCRDGK0NAaQEoGWawghXcT6dkQLOYKs= +github.com/amazon-contributing/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.0.0-20241216205413-8e059f1441db/go.mod h1:/R2tBPLPR8dLZA0BQI2ZA7IB/zU7Q+Ghp+ujiPacVkA= github.com/amir/raidman v0.0.0-20170415203553-1ccc43bfb9c9 h1:FXrPTd8Rdlc94dKccl7KPmdmIbVh/OjelJ8/vgMRzcQ= github.com/amir/raidman v0.0.0-20170415203553-1ccc43bfb9c9/go.mod h1:eliMa/PW+RDr2QLWRmLH1R1ZA4RInpmvOzDDXtaIZkc= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= @@ -1189,8 +1191,6 @@ github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.10 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.103.0/go.mod h1:hCzgpzXbUUDUlETMDKYOpPaOhPjR9T6M3W3nAW5cGX4= github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.103.0 h1:gksMpwy9oZN14E4kRBfLtVkE8YJn++7woM1b3hQboJg= github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.103.0/go.mod h1:OLpJzn4LgzICAnyu+7mJ33rM2WOgPWpjXvZ6YKrJ6yM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.103.0 h1:Q5b1ZIjQf5EGKAQSJa6XfHWt/TDaNs+qldqdpYK+ovo= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.103.0/go.mod h1:VDyjNiPEI3G3IJ7CwxU6zCTErB7KovQh6l51eePAPWc= github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.103.0 h1:5PHQ2a5VsqXDZBmso84fLDzT66GV0mqDT5JCB07W8Ws= github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.103.0/go.mod h1:oU1oils/dQVq3E3h7e3afFEXfCSmwniEK/NlEByaJWY= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.103.0 h1:JjHxUTE7cbrqddMLueLhVcWbxxr9INLf5sIsRBcuPUE= diff --git a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml index 6c425849d1..2edfbbded1 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml @@ -45,9 +45,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 middleware: agenthealth/statuscode refresh_interval_seconds: 0s @@ -89,11 +89,11 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_netstat - telegraf_swap - telegraf_cpu - telegraf_disk - telegraf_mem - - telegraf_netstat metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml index 5dddb3f844..ee0877d782 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml @@ -97,13 +97,13 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_ethtool - telegraf_nvidia_smi - telegraf_cpu - telegraf_disk - telegraf_mem - telegraf_netstat - telegraf_swap - - telegraf_ethtool metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml index bd3e45ed9e..7e88397a2d 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml @@ -35,9 +35,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 middleware: agenthealth/statuscode refresh_interval_seconds: 0s diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml index 269ffe1816..8ecedac6e1 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml @@ -999,6 +999,7 @@ processors: faas.version: enabled: true max_idle_conns: 100 + middleware: agenthealth/statuscode openshift: address: "" resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml index 3ad6ee7be8..e8ce5d1bc7 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml @@ -1128,6 +1128,7 @@ processors: faas.version: enabled: true max_idle_conns: 100 + middleware: agenthealth/statuscode openshift: address: "" resource_attributes: @@ -1215,6 +1216,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: false diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index a9a5879fc2..bdca9dc8c9 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml @@ -1129,6 +1129,7 @@ processors: faas.version: enabled: true max_idle_conns: 100 + middleware: agenthealth/statuscode openshift: address: "" resource_attributes: @@ -1216,6 +1217,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: false diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index 3ad6ee7be8..e8ce5d1bc7 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -1128,6 +1128,7 @@ processors: faas.version: enabled: true max_idle_conns: 100 + middleware: agenthealth/statuscode openshift: address: "" resource_attributes: @@ -1215,6 +1216,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: false diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index 3ad6ee7be8..e8ce5d1bc7 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -1128,6 +1128,7 @@ processors: faas.version: enabled: true max_idle_conns: 100 + middleware: agenthealth/statuscode openshift: address: "" resource_attributes: @@ -1215,6 +1216,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: false diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 2f8b79e011..a9e969978a 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -1009,6 +1009,7 @@ processors: faas.version: enabled: true max_idle_conns: 100 + middleware: agenthealth/statuscode openshift: address: "" resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index 0820331549..a1e35f125c 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -1005,6 +1005,7 @@ processors: faas.version: enabled: true max_idle_conns: 100 + middleware: agenthealth/statuscode openshift: address: "" resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml index 250e5a6de3..4df5992b20 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -189,6 +189,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: true diff --git a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml index caa5cfc15b..a2cc400a66 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml @@ -63,8 +63,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_disk - telegraf_mem + - telegraf_disk telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml index 8f5d51fc73..9583912100 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml @@ -35,9 +35,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 middleware: agenthealth/statuscode refresh_interval_seconds: 0s diff --git a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml index cdc02e2d2f..09c4ff3916 100644 --- a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml @@ -47,9 +47,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 middleware: agenthealth/statuscode refresh_interval_seconds: 0s diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index 4ad0290915..cb9b62b5d7 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -133,9 +133,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - ImageId - InstanceId - InstanceType + - ImageId imds_retries: 1 middleware: agenthealth/statuscode refresh_interval_seconds: 0s @@ -146,11 +146,11 @@ processors: metric_statements: - context: metric statements: - - set(unit, "unit") where name == "disk_free" - - set(name, "DISK_FREE") where name == "disk_free" - set(unit, "unit") where name == "cpu_usage_idle" - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" - set(unit, "unit") where name == "cpu_usage_nice" + - set(unit, "unit") where name == "disk_free" + - set(name, "DISK_FREE") where name == "disk_free" trace_statements: [] receivers: awsxray: @@ -284,13 +284,13 @@ service: - ec2tagger - transform receivers: - - telegraf_swap - - telegraf_netstat - telegraf_disk + - telegraf_swap - telegraf_mem + - telegraf_cpu - telegraf_processes + - telegraf_netstat - telegraf_procstat/1917393364 - - telegraf_cpu metrics/hostCustomMetrics: exporters: - awscloudwatch @@ -299,8 +299,8 @@ service: - ec2tagger - transform receivers: - - telegraf_statsd - telegraf_socket_listener + - telegraf_statsd metrics/hostDeltaMetrics: exporters: - awscloudwatch @@ -310,8 +310,8 @@ service: - ec2tagger - transform receivers: - - telegraf_net - telegraf_diskio + - telegraf_net traces/xray: exporters: - awsxray diff --git a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml index b9decbb138..6105f937bc 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -198,11 +198,11 @@ processors: metric_statements: - context: metric statements: + - set(unit, "unit") where name == "disk_free" + - set(name, "DISK_FREE") where name == "disk_free" - set(unit, "unit") where name == "cpu_usage_idle" - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" - set(unit, "unit") where name == "cpu_usage_nice" - - set(unit, "unit") where name == "disk_free" - - set(name, "DISK_FREE") where name == "disk_free" trace_statements: [] transform/jmx/0: error_mode: propagate @@ -391,13 +391,13 @@ service: - ec2tagger - transform receivers: - - telegraf_processes - - telegraf_cpu - telegraf_swap - - telegraf_procstat/1917393364 - - telegraf_disk + - telegraf_cpu - telegraf_netstat + - telegraf_procstat/1917393364 - telegraf_mem + - telegraf_disk + - telegraf_processes metrics/hostCustomMetrics/cloudwatch: exporters: - awscloudwatch @@ -406,8 +406,8 @@ service: - ec2tagger - transform receivers: - - telegraf_socket_listener - telegraf_statsd + - telegraf_socket_listener metrics/hostDeltaMetrics/cloudwatch: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml index 77976a2761..0fa09f48e6 100644 --- a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml +++ b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml @@ -503,6 +503,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: false diff --git a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml index e9ed041ca5..57d9a066e2 100644 --- a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml @@ -42,9 +42,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 middleware: agenthealth/statuscode refresh_interval_seconds: 0s diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml index 5f7b8e85e4..8a0d8fc3e2 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml @@ -451,6 +451,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: true max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: true diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml index 44fccdb2b6..d70f0580c3 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml @@ -692,9 +692,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: container_gpu_memory_utilization + new_name: container_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -703,19 +703,12 @@ processors: label_value: "" new_label: Type new_value: ContainerGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 100 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: pod_gpu_memory_utilization + new_name: pod_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -724,19 +717,12 @@ processors: label_value: "" new_label: Type new_value: PodGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 100 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: node_gpu_memory_utilization + new_name: node_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -745,19 +731,12 @@ processors: label_value: "" new_label: Type new_value: NodeGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 100 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: container_gpu_memory_used + new_name: container_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -766,19 +745,12 @@ processors: label_value: "" new_label: Type new_value: ContainerGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 1.048576e+06 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: pod_gpu_memory_used + new_name: pod_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -787,19 +759,12 @@ processors: label_value: "" new_label: Type new_value: PodGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 1.048576e+06 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: node_gpu_memory_used + new_name: node_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -808,19 +773,12 @@ processors: label_value: "" new_label: Type new_value: NodeGPU - - action: experimental_scale_value - aggregation_type: "" - experimental_scale: 1.048576e+06 - label: "" - label_value: "" - new_label: "" - new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_TOTAL + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: container_gpu_memory_total + new_name: container_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -831,7 +789,7 @@ processors: new_value: ContainerGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 1.048576e+06 + experimental_scale: 100 label: "" label_value: "" new_label: "" @@ -839,9 +797,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_TOTAL + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: pod_gpu_memory_total + new_name: pod_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -852,7 +810,7 @@ processors: new_value: PodGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 1.048576e+06 + experimental_scale: 100 label: "" label_value: "" new_label: "" @@ -860,9 +818,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_TOTAL + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: node_gpu_memory_total + new_name: node_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -873,7 +831,7 @@ processors: new_value: NodeGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 1.048576e+06 + experimental_scale: 100 label: "" label_value: "" new_label: "" @@ -881,9 +839,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: container_gpu_temperature + new_name: container_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -892,12 +850,19 @@ processors: label_value: "" new_label: Type new_value: ContainerGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: pod_gpu_temperature + new_name: pod_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -906,12 +871,19 @@ processors: label_value: "" new_label: Type new_value: PodGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: node_gpu_temperature + new_name: node_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -920,12 +892,19 @@ processors: label_value: "" new_label: Type new_value: NodeGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: container_gpu_power_draw + new_name: container_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -934,12 +913,19 @@ processors: label_value: "" new_label: Type new_value: ContainerGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: pod_gpu_power_draw + new_name: pod_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -948,12 +934,19 @@ processors: label_value: "" new_label: Type new_value: PodGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: node_gpu_power_draw + new_name: node_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -962,12 +955,19 @@ processors: label_value: "" new_label: Type new_value: NodeGPU + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 1.048576e+06 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_UTIL + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: container_gpu_utilization + new_name: container_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -979,9 +979,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_UTIL + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: pod_gpu_utilization + new_name: pod_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -993,9 +993,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_UTIL + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: node_gpu_utilization + new_name: node_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -1005,13 +1005,6 @@ processors: new_label: Type new_value: NodeGPU submatch_case: "" - - action: update - aggregation_type: "" - include: execution_latency_seconds - match_type: "" - new_name: neuron_execution_latency - operations: [] - submatch_case: "" - action: update aggregation_type: "" include: execution_errors_total @@ -1021,23 +1014,16 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: execution_status_total - match_type: "" - new_name: neuron_execution_status - operations: [] - submatch_case: "" - - action: update - aggregation_type: "" - include: neuroncore_memory_usage_constants + include: neuroncore_memory_usage_model_code match_type: "" - new_name: neuroncore_memory_usage_constants + new_name: neuroncore_memory_usage_model_code operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_shared_scratchpad + include: neuroncore_memory_usage_runtime_memory match_type: "" - new_name: neuroncore_memory_usage_model_shared_scratchpad + new_name: neuroncore_memory_usage_runtime_memory operations: [] submatch_case: "" - action: update @@ -1061,6 +1047,13 @@ processors: new_name: neurondevice_hw_ecc_events operations: [] submatch_case: "" + - action: update + aggregation_type: "" + include: execution_status_total + match_type: "" + new_name: neuron_execution_status + operations: [] + submatch_case: "" - action: update aggregation_type: "" include: neuron_runtime_memory_used_bytes @@ -1070,16 +1063,16 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_code + include: neuroncore_memory_usage_constants match_type: "" - new_name: neuroncore_memory_usage_model_code + new_name: neuroncore_memory_usage_constants operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_runtime_memory + include: neuroncore_memory_usage_model_shared_scratchpad match_type: "" - new_name: neuroncore_memory_usage_runtime_memory + new_name: neuroncore_memory_usage_model_shared_scratchpad operations: [] submatch_case: "" - action: update @@ -1103,6 +1096,13 @@ processors: new_label: "" new_value: "" submatch_case: "" + - action: update + aggregation_type: "" + include: execution_latency_seconds + match_type: "" + new_name: neuron_execution_latency + operations: [] + submatch_case: "" receivers: awscontainerinsightreceiver: accelerated_compute_metrics: true @@ -1123,6 +1123,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: true max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: true diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml index 37b6232c3f..f59e0a6639 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml @@ -537,6 +537,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: true max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: true diff --git a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml index caa5cfc15b..ce52f0e9e5 100644 --- a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml +++ b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml @@ -35,9 +35,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 middleware: agenthealth/statuscode refresh_interval_seconds: 0s @@ -63,8 +63,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_disk - telegraf_mem + - telegraf_disk telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml index 73562f67a1..9198fadc61 100644 --- a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml @@ -136,11 +136,11 @@ processors: metric_statements: - context: metric statements: - - set(unit, "unit") where name == "disk_free" - - set(name, "DISK_FREE") where name == "disk_free" - set(unit, "unit") where name == "cpu_usage_idle" - set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle" - set(unit, "unit") where name == "cpu_usage_nice" + - set(unit, "unit") where name == "disk_free" + - set(name, "DISK_FREE") where name == "disk_free" trace_statements: [] transform/jmx: error_mode: propagate @@ -149,9 +149,9 @@ processors: metric_statements: - context: metric statements: + - set(name, "kafka.fetch-rate") where name == "kafka.consumer.fetch-rate" - set(unit, "unit") where name == "jvm.memory.heap.used" - set(name, "JVM_MEM_HEAP_USED") where name == "jvm.memory.heap.used" - - set(name, "kafka.fetch-rate") where name == "kafka.consumer.fetch-rate" trace_statements: [] receivers: jmx: diff --git a/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml b/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml index 9ad8ccbacc..d8d8dbb5c2 100644 --- a/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml +++ b/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml @@ -413,6 +413,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: true max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: true diff --git a/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml index a34b9a9e58..afc2bc77ed 100644 --- a/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml @@ -273,6 +273,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: true diff --git a/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml b/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml index 40a39cb624..1b0e0ee4c3 100644 --- a/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml +++ b/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml @@ -135,6 +135,7 @@ receivers: leader_lock_using_config_map_only: false local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: false diff --git a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml index 06827e3d55..46216e4031 100644 --- a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml @@ -445,6 +445,7 @@ receivers: leader_lock_using_config_map_only: true local_mode: false max_retries: 0 + middleware: agenthealth/statuscode no_verify_ssl: false num_workers: 0 prefer_full_pod_name: true diff --git a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml index 0298016500..b8c154d320 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml @@ -84,10 +84,10 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_mem - telegraf_swap - telegraf_cpu - telegraf_disk - - telegraf_mem metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml index 0148dbbc95..51e36adb81 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml @@ -79,11 +79,11 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_win_perf_counters/3762679655 - telegraf_win_perf_counters/4283769065 - telegraf_win_perf_counters/1492679118 - telegraf_win_perf_counters/3610923661 - telegraf_win_perf_counters/3446270237 - - telegraf_win_perf_counters/3762679655 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml index abe8393a44..7278578d40 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml @@ -39,9 +39,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 2 middleware: agenthealth/statuscode profile: AmazonCloudWatchAgent @@ -86,11 +86,11 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_win_perf_counters/3762679655 - telegraf_win_perf_counters/4283769065 - telegraf_win_perf_counters/1492679118 - telegraf_win_perf_counters/3610923661 - telegraf_win_perf_counters/3446270237 - - telegraf_win_perf_counters/3762679655 telemetry: logs: development: false diff --git a/translator/tocwconfig/tocwconfig_test.go b/translator/tocwconfig/tocwconfig_test.go index 7d3b509d17..7191631db6 100644 --- a/translator/tocwconfig/tocwconfig_test.go +++ b/translator/tocwconfig/tocwconfig_test.go @@ -27,7 +27,6 @@ import ( "github.com/aws/amazon-cloudwatch-agent/cfg/commonconfig" "github.com/aws/amazon-cloudwatch-agent/cfg/envconfig" "github.com/aws/amazon-cloudwatch-agent/internal/retryer" - "github.com/aws/amazon-cloudwatch-agent/tool/testutil" "github.com/aws/amazon-cloudwatch-agent/translator" "github.com/aws/amazon-cloudwatch-agent/translator/cmdutil" "github.com/aws/amazon-cloudwatch-agent/translator/config" @@ -406,52 +405,52 @@ func TestPrometheusConfigwithTargetAllocator(t *testing.T) { } -func TestOtelPrometheusConfig(t *testing.T) { - resetContext(t) - context.CurrentContext().SetRunInContainer(true) - context.CurrentContext().SetMode(config.ModeEC2) - testutil.SetPrometheusRemoteWriteTestingEnv(t) - t.Setenv(config.HOST_NAME, "host_name_from_env") - temp := t.TempDir() - prometheusConfigFileName := filepath.Join(temp, "prometheus.yaml") - ecsSdFileName := filepath.Join(temp, "ecs_sd_results.yaml") - expectedEnvVars := map[string]string{} - tokenReplacements := map[string]string{ - prometheusFileNameToken: strings.ReplaceAll(prometheusConfigFileName, "\\", "\\\\"), - ecsSdFileNameToken: strings.ReplaceAll(ecsSdFileName, "\\", "\\\\"), - } - // Load prometheus config and replace ecs sd results file name token with temp file name - testPrometheusConfig := strings.ReplaceAll(prometheusConfig, "{"+ecsSdFileNameToken+"}", ecsSdFileName) - // Write the modified prometheus config to temp prometheus config file - err := os.WriteFile(prometheusConfigFileName, []byte(testPrometheusConfig), os.ModePerm) - require.NoError(t, err) - // In the following checks, we first load the json and replace tokens with the temp files - // Additionally, before comparing with actual, we again replace tokens with temp files in the expected toml & yaml - checkTranslation(t, "prometheus_otel_config_linux", "linux", expectedEnvVars, "", tokenReplacements) -} - -func TestCombinedPrometheusConfig(t *testing.T) { - resetContext(t) - context.CurrentContext().SetMode(config.ModeEC2) - testutil.SetPrometheusRemoteWriteTestingEnv(t) - t.Setenv(config.HOST_NAME, "host_name_from_env") - temp := t.TempDir() - prometheusConfigFileName := filepath.Join(temp, "prometheus.yaml") - ecsSdFileName := filepath.Join(temp, "ecs_sd_results.yaml") - expectedEnvVars := map[string]string{} - tokenReplacements := map[string]string{ - prometheusFileNameToken: strings.ReplaceAll(prometheusConfigFileName, "\\", "\\\\"), - ecsSdFileNameToken: strings.ReplaceAll(ecsSdFileName, "\\", "\\\\"), - } - // Load prometheus config and replace ecs sd results file name token with temp file name - testPrometheusConfig := strings.ReplaceAll(prometheusConfig, "{"+ecsSdFileNameToken+"}", ecsSdFileName) - // Write the modified prometheus config to temp prometheus config file - err := os.WriteFile(prometheusConfigFileName, []byte(testPrometheusConfig), os.ModePerm) - require.NoError(t, err) - // In the following checks, we first load the json and replace tokens with the temp files - // Additionally, before comparing with actual, we again replace tokens with temp files in the expected toml & yaml - checkTranslation(t, "prometheus_combined_config_linux", "linux", expectedEnvVars, "", tokenReplacements) -} +//func TestOtelPrometheusConfig(t *testing.T) { +// resetContext(t) +// context.CurrentContext().SetRunInContainer(true) +// context.CurrentContext().SetMode(config.ModeEC2) +// testutil.SetPrometheusRemoteWriteTestingEnv(t) +// t.Setenv(config.HOST_NAME, "host_name_from_env") +// temp := t.TempDir() +// prometheusConfigFileName := filepath.Join(temp, "prometheus.yaml") +// ecsSdFileName := filepath.Join(temp, "ecs_sd_results.yaml") +// expectedEnvVars := map[string]string{} +// tokenReplacements := map[string]string{ +// prometheusFileNameToken: strings.ReplaceAll(prometheusConfigFileName, "\\", "\\\\"), +// ecsSdFileNameToken: strings.ReplaceAll(ecsSdFileName, "\\", "\\\\"), +// } +// // Load prometheus config and replace ecs sd results file name token with temp file name +// testPrometheusConfig := strings.ReplaceAll(prometheusConfig, "{"+ecsSdFileNameToken+"}", ecsSdFileName) +// // Write the modified prometheus config to temp prometheus config file +// err := os.WriteFile(prometheusConfigFileName, []byte(testPrometheusConfig), os.ModePerm) +// require.NoError(t, err) +// // In the following checks, we first load the json and replace tokens with the temp files +// // Additionally, before comparing with actual, we again replace tokens with temp files in the expected toml & yaml +// checkTranslation(t, "prometheus_otel_config_linux", "linux", expectedEnvVars, "", tokenReplacements) +//} +// +//func TestCombinedPrometheusConfig(t *testing.T) { +// resetContext(t) +// context.CurrentContext().SetMode(config.ModeEC2) +// testutil.SetPrometheusRemoteWriteTestingEnv(t) +// t.Setenv(config.HOST_NAME, "host_name_from_env") +// temp := t.TempDir() +// prometheusConfigFileName := filepath.Join(temp, "prometheus.yaml") +// ecsSdFileName := filepath.Join(temp, "ecs_sd_results.yaml") +// expectedEnvVars := map[string]string{} +// tokenReplacements := map[string]string{ +// prometheusFileNameToken: strings.ReplaceAll(prometheusConfigFileName, "\\", "\\\\"), +// ecsSdFileNameToken: strings.ReplaceAll(ecsSdFileName, "\\", "\\\\"), +// } +// // Load prometheus config and replace ecs sd results file name token with temp file name +// testPrometheusConfig := strings.ReplaceAll(prometheusConfig, "{"+ecsSdFileNameToken+"}", ecsSdFileName) +// // Write the modified prometheus config to temp prometheus config file +// err := os.WriteFile(prometheusConfigFileName, []byte(testPrometheusConfig), os.ModePerm) +// require.NoError(t, err) +// // In the following checks, we first load the json and replace tokens with the temp files +// // Additionally, before comparing with actual, we again replace tokens with temp files in the expected toml & yaml +// checkTranslation(t, "prometheus_combined_config_linux", "linux", expectedEnvVars, "", tokenReplacements) +//} func TestBasicConfig(t *testing.T) { testCases := map[string]testCase{ diff --git a/translator/translate/otel/processor/resourcedetection/translator.go b/translator/translate/otel/processor/resourcedetection/translator.go index 5113d8de24..76b146fd77 100644 --- a/translator/translate/otel/processor/resourcedetection/translator.go +++ b/translator/translate/otel/processor/resourcedetection/translator.go @@ -14,6 +14,7 @@ import ( "github.com/aws/amazon-cloudwatch-agent/translator/config" "github.com/aws/amazon-cloudwatch-agent/translator/context" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common" + "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" "github.com/aws/amazon-cloudwatch-agent/translator/util/ecsutil" ) @@ -63,10 +64,7 @@ func (t *translator) ID() component.ID { func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg := t.factory.CreateDefaultConfig().(*resourcedetectionprocessor.Config) - // > [!WARNING] - // > Only uncomment the following line when this PR is merged: https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/265 - // > cfg.MiddlewareID = &agenthealth.StatusCodeID - // > This will be added when contrib changes are made. + cfg.MiddlewareID = &agenthealth.StatusCodeID mode := context.CurrentContext().KubernetesMode() if mode == "" { mode = context.CurrentContext().Mode() @@ -83,8 +81,5 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { default: return common.GetYamlFileToYamlConfig(cfg, appSignalsDefaultResourceDetectionConfig) } - // > [!WARNING] - // > Only uncomment the following line when this PR is merged: https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/265 - // > cfg.MiddlewareID = &agenthealth.StatusCodeID - // > This will be added when contrib changes are made. + } diff --git a/translator/translate/otel/processor/resourcedetection/translator_test.go b/translator/translate/otel/processor/resourcedetection/translator_test.go index 6de59538b0..0133c6a483 100644 --- a/translator/translate/otel/processor/resourcedetection/translator_test.go +++ b/translator/translate/otel/processor/resourcedetection/translator_test.go @@ -134,6 +134,8 @@ func TestTranslate(t *testing.T) { if err == nil { require.NotNil(t, got) gotCfg, ok := got.(*resourcedetectionprocessor.Config) + assert.NotNil(t, gotCfg.MiddlewareID) + gotCfg.MiddlewareID = nil require.True(t, ok) wantCfg := factory.CreateDefaultConfig() require.NoError(t, testCase.want.Unmarshal(&wantCfg)) diff --git a/translator/translate/otel/receiver/awscontainerinsight/translator.go b/translator/translate/otel/receiver/awscontainerinsight/translator.go index 88f50d249f..4769aa6aa5 100644 --- a/translator/translate/otel/receiver/awscontainerinsight/translator.go +++ b/translator/translate/otel/receiver/awscontainerinsight/translator.go @@ -22,6 +22,7 @@ import ( globallogs "github.com/aws/amazon-cloudwatch-agent/translator/translate/logs" "github.com/aws/amazon-cloudwatch-agent/translator/translate/logs/util" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common" + "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" logsutil "github.com/aws/amazon-cloudwatch-agent/translator/translate/util" ) @@ -119,12 +120,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { t.setHostIP(conf, cfg) cfg.RunOnSystemd = !context.CurrentContext().RunInContainer() } - - // > [!WARNING] - // > Only uncomment the following line when this PR is merged: https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/265 - // > cfg.MiddlewareID = &agenthealth.StatusCodeID - // > This will be added when contrib changes are made. - + cfg.MiddlewareID = &agenthealth.StatusCodeID cfg.PrefFullPodName = cfg.PrefFullPodName || common.GetOrDefaultBool(conf, common.ConfigKey(common.LogsKey, common.MetricsCollectedKey, common.KubernetesKey, common.PreferFullPodName), false) cfg.EnableAcceleratedComputeMetrics = cfg.EnableAcceleratedComputeMetrics || AcceleratedComputeMetricsEnabled(conf) From 43d475d73656230eecafab991dc16a05d0736de8 Mon Sep 17 00:00:00 2001 From: POOJA REDDY NATHALA Date: Thu, 19 Dec 2024 22:48:37 +0530 Subject: [PATCH 07/14] Retrieve instance tags at the same time to reduce number of entities in Explore related experience (#1474) --- extension/entitystore/ec2Info.go | 50 +------- extension/entitystore/ec2Info_test.go | 112 ------------------ extension/entitystore/extension.go | 12 +- extension/entitystore/extension_test.go | 47 +++++--- extension/entitystore/serviceprovider.go | 33 +++++- extension/entitystore/serviceprovider_test.go | 51 +++++++- plugins/processors/awsentity/processor.go | 15 ++- .../processors/awsentity/processor_test.go | 58 ++++++--- 8 files changed, 171 insertions(+), 207 deletions(-) diff --git a/extension/entitystore/ec2Info.go b/extension/entitystore/ec2Info.go index e646fca78c..23d13eb0b1 100644 --- a/extension/entitystore/ec2Info.go +++ b/extension/entitystore/ec2Info.go @@ -6,15 +6,12 @@ package entitystore import ( "context" "errors" - "strings" "sync" "time" "go.uber.org/zap" "github.com/aws/amazon-cloudwatch-agent/internal/ec2metadataprovider" - "github.com/aws/amazon-cloudwatch-agent/plugins/processors/ec2tagger" - "github.com/aws/amazon-cloudwatch-agent/translator/config" ) const ( @@ -28,13 +25,11 @@ const ( ) type EC2Info struct { - InstanceID string - AccountID string - AutoScalingGroup string + InstanceID string + AccountID string // region is used while making call to describeTags Ec2 API for AutoScalingGroup - Region string - kubernetesMode string + Region string metadataProvider ec2metadataprovider.MetadataProvider logger *zap.Logger @@ -50,12 +45,6 @@ func (ei *EC2Info) initEc2Info() { if err := ei.setInstanceIDAccountID(); err != nil { return } - // Instance metadata tags is not usable for EKS nodes - // https://github.com/kubernetes/cloud-provider-aws/issues/762 - if ei.kubernetesMode != config.ModeEKS { - limitedRetryer := NewRetryer(true, true, defaultJitterMin, defaultJitterMax, ec2tagger.BackoffSleepArray, maxRetry, ei.done, ei.logger) - limitedRetryer.refreshLoop(ei.retrieveAsgName) - } ei.logger.Debug("Finished initializing EC2Info") } @@ -71,12 +60,6 @@ func (ei *EC2Info) GetAccountID() string { return ei.AccountID } -func (ei *EC2Info) GetAutoScalingGroup() string { - ei.mutex.RLock() - defer ei.mutex.RUnlock() - return ei.AutoScalingGroup -} - func (ei *EC2Info) setInstanceIDAccountID() error { for { metadataDoc, err := ei.metadataProvider.Get(context.Background()) @@ -104,34 +87,9 @@ func (ei *EC2Info) setInstanceIDAccountID() error { } } -func (ei *EC2Info) retrieveAsgName() error { - tags, err := ei.metadataProvider.InstanceTags(context.Background()) - if err != nil { - ei.logger.Debug("Failed to get AutoScalingGroup from instance tags. This is likely because instance tag is not enabled for IMDS but will not affect agent functionality.") - return err - } else if strings.Contains(tags, ec2tagger.Ec2InstanceTagKeyASG) { - asg, err := ei.metadataProvider.InstanceTagValue(context.Background(), ec2tagger.Ec2InstanceTagKeyASG) - if err != nil { - ei.logger.Error("Failed to get AutoScalingGroup through metadata provider", zap.Error(err)) - return err - } else { - ei.logger.Debug("AutoScalingGroup retrieved through IMDS") - ei.mutex.Lock() - ei.AutoScalingGroup = asg - if asgLength := len(ei.AutoScalingGroup); asgLength > autoScalingGroupSizeMax { - ei.logger.Warn("AutoScalingGroup length exceeds characters limit and will be ignored", zap.Int("length", asgLength), zap.Int("character limit", autoScalingGroupSizeMax)) - ei.AutoScalingGroup = "" - } - ei.mutex.Unlock() - } - } - return nil -} - -func newEC2Info(metadataProvider ec2metadataprovider.MetadataProvider, kubernetesMode string, done chan struct{}, region string, logger *zap.Logger) *EC2Info { +func newEC2Info(metadataProvider ec2metadataprovider.MetadataProvider, done chan struct{}, region string, logger *zap.Logger) *EC2Info { return &EC2Info{ metadataProvider: metadataProvider, - kubernetesMode: kubernetesMode, done: done, Region: region, logger: logger, diff --git a/extension/entitystore/ec2Info_test.go b/extension/entitystore/ec2Info_test.go index 9cc4efd896..816e56a40d 100644 --- a/extension/entitystore/ec2Info_test.go +++ b/extension/entitystore/ec2Info_test.go @@ -6,7 +6,6 @@ package entitystore import ( "bytes" "log" - "strings" "testing" "time" @@ -15,7 +14,6 @@ import ( "go.uber.org/zap" "github.com/aws/amazon-cloudwatch-agent/internal/ec2metadataprovider" - "github.com/aws/amazon-cloudwatch-agent/translator/config" ) var mockedInstanceIdentityDoc = &ec2metadata.EC2InstanceIdentityDocument{ @@ -87,83 +85,6 @@ func TestSetInstanceIDAccountID(t *testing.T) { } } -func TestRetrieveASGName(t *testing.T) { - type args struct { - metadataProvider ec2metadataprovider.MetadataProvider - } - tests := []struct { - name string - args args - wantErr bool - want EC2Info - }{ - { - name: "happy path", - args: args{ - metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"aws:autoscaling:groupName": tagVal3}}, - }, - wantErr: false, - want: EC2Info{ - AutoScalingGroup: tagVal3, - }, - }, - { - name: "happy path with multiple tags", - args: args{ - metadataProvider: &mockMetadataProvider{ - InstanceIdentityDocument: mockedInstanceIdentityDoc, - Tags: map[string]string{ - "aws:autoscaling:groupName": tagVal3, - "env": "test-env", - "name": "test-name", - }}, - }, - - wantErr: false, - want: EC2Info{ - AutoScalingGroup: tagVal3, - }, - }, - { - name: "AutoScalingGroup too large", - args: args{ - metadataProvider: &mockMetadataProvider{ - InstanceIdentityDocument: mockedInstanceIdentityDoc, - Tags: map[string]string{ - "aws:autoscaling:groupName": strings.Repeat("a", 256), - "env": "test-env", - "name": "test-name", - }}, - }, - - wantErr: false, - want: EC2Info{ - AutoScalingGroup: "", - }, - }, - { - name: "Success IMDS tags call but no ASG", - args: args{ - metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"name": tagVal3}}, - }, - wantErr: false, - want: EC2Info{ - AutoScalingGroup: "", - }, - }, - } - for _, tt := range tests { - logger, _ := zap.NewDevelopment() - t.Run(tt.name, func(t *testing.T) { - ei := &EC2Info{metadataProvider: tt.args.metadataProvider, logger: logger} - if err := ei.retrieveAsgName(); (err != nil) != tt.wantErr { - t.Errorf("retrieveAsgName() error = %v, wantErr %v", err, tt.wantErr) - } - assert.Equal(t, tt.want.AutoScalingGroup, ei.GetAutoScalingGroup()) - }) - } -} - func TestLogMessageDoesNotIncludeResourceInfo(t *testing.T) { type args struct { metadataProvider ec2metadataprovider.MetadataProvider @@ -202,7 +123,6 @@ func TestLogMessageDoesNotIncludeResourceInfo(t *testing.T) { logOutput := buf.String() log.Println(logOutput) assert.NotContains(t, logOutput, ei.GetInstanceID()) - assert.NotContains(t, logOutput, ei.GetAutoScalingGroup()) }) } } @@ -237,35 +157,3 @@ func TestNotInitIfMetadataProviderIsEmpty(t *testing.T) { }) } } - -func TestNoASGRetrievalInKubernetesMode(t *testing.T) { - type args struct { - metadataProvider ec2metadataprovider.MetadataProvider - kubernetesMode string - } - tests := []struct { - name string - args args - wantErr bool - want string - }{ - { - name: "EKSNoASGFromEC2Info", - args: args{ - metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"aws:autoscaling:groupName": tagVal3}}, - kubernetesMode: config.ModeEKS, - }, - wantErr: false, - want: "", - }, - } - for _, tt := range tests { - logger, _ := zap.NewDevelopment() - t.Run(tt.name, func(t *testing.T) { - ei := &EC2Info{metadataProvider: tt.args.metadataProvider, kubernetesMode: tt.args.kubernetesMode, logger: logger} - go ei.initEc2Info() - time.Sleep(3 * time.Second) - assert.Equal(t, tt.want, ei.GetAutoScalingGroup()) - }) - } -} diff --git a/extension/entitystore/extension.go b/extension/entitystore/extension.go index a486134507..7f5c71389f 100644 --- a/extension/entitystore/extension.go +++ b/extension/entitystore/extension.go @@ -43,6 +43,7 @@ type serviceProviderInterface interface { addEntryForLogGroup(LogGroupName, ServiceAttribute) logFileServiceAttribute(LogFileGlob, LogGroupName) ServiceAttribute getServiceNameAndSource() (string, string) + getAutoScalingGroup() string } type EntityStore struct { @@ -94,7 +95,7 @@ func (e *EntityStore) Start(ctx context.Context, host component.Host) error { e.serviceprovider = newServiceProvider(e.mode, e.config.Region, &e.ec2Info, e.metadataprovider, getEC2Provider, ec2CredentialConfig, e.done, e.logger) switch e.mode { case config.ModeEC2: - e.ec2Info = *newEC2Info(e.metadataprovider, e.kubernetesMode, e.done, e.config.Region, e.logger) + e.ec2Info = *newEC2Info(e.metadataprovider, e.done, e.config.Region, e.logger) go e.ec2Info.initEc2Info() // Instance metadata tags is not usable for EKS nodes // https://github.com/kubernetes/cloud-provider-aws/issues/762 @@ -177,6 +178,13 @@ func (e *EntityStore) GetServiceMetricAttributesMap() map[string]*string { return e.createAttributeMap() } +func (e *EntityStore) GetAutoScalingGroup() string { + if e.serviceprovider == nil { + return "" + } + return e.serviceprovider.getAutoScalingGroup() +} + // AddServiceAttrEntryForLogFile adds an entry to the entity store for the provided file glob -> (serviceName, environmentName) key-value pair func (e *EntityStore) AddServiceAttrEntryForLogFile(fileGlob LogFileGlob, serviceName string, environmentName string) { if e.serviceprovider != nil { @@ -225,7 +233,7 @@ func (e *EntityStore) createAttributeMap() map[string]*string { if e.mode == config.ModeEC2 { addNonEmptyToMap(attributeMap, InstanceIDKey, e.ec2Info.GetInstanceID()) - addNonEmptyToMap(attributeMap, ASGKey, e.ec2Info.GetAutoScalingGroup()) + addNonEmptyToMap(attributeMap, ASGKey, e.GetAutoScalingGroup()) } switch e.mode { case config.ModeEC2: diff --git a/extension/entitystore/extension_test.go b/extension/entitystore/extension_test.go index 02cdff56d3..f1571e2c8d 100644 --- a/extension/entitystore/extension_test.go +++ b/extension/entitystore/extension_test.go @@ -63,6 +63,11 @@ func (s *mockServiceProvider) getServiceNameAndSource() (string, string) { return "test-service-name", "UserConfiguration" } +func (s *mockServiceProvider) getAutoScalingGroup() string { + args := s.Called() + return args.Get(0).(string) +} + type mockMetadataProvider struct { InstanceIdentityDocument *ec2metadata.EC2InstanceIdentityDocument Tags map[string]string @@ -135,12 +140,10 @@ func TestEntityStore_EC2Info(t *testing.T) { { name: "happypath", ec2InfoInput: EC2Info{ - InstanceID: "i-1234567890", - AutoScalingGroup: "test-asg", + InstanceID: "i-1234567890", }, want: EC2Info{ - InstanceID: "i-1234567890", - AutoScalingGroup: "test-asg", + InstanceID: "i-1234567890", }, }, } @@ -200,8 +203,9 @@ func TestEntityStore_KubernetesMode(t *testing.T) { func TestEntityStore_createAttributeMaps(t *testing.T) { type fields struct { - ec2Info EC2Info - mode string + ec2Info EC2Info + mode string + emptyASG bool } tests := []struct { name string @@ -212,13 +216,12 @@ func TestEntityStore_createAttributeMaps(t *testing.T) { name: "HappyPath", fields: fields{ ec2Info: EC2Info{ - InstanceID: "i-123456789", - AutoScalingGroup: "test-asg", + InstanceID: "i-123456789", }, mode: config.ModeEC2, }, want: map[string]*string{ - ASGKey: aws.String("test-asg"), + ASGKey: aws.String("ASG-1"), InstanceIDKey: aws.String("i-123456789"), PlatformType: aws.String(EC2PlatForm), }, @@ -229,7 +232,8 @@ func TestEntityStore_createAttributeMaps(t *testing.T) { ec2Info: EC2Info{ InstanceID: "i-123456789", }, - mode: config.ModeEC2, + mode: config.ModeEC2, + emptyASG: true, }, want: map[string]*string{ InstanceIDKey: aws.String("i-123456789"), @@ -239,7 +243,8 @@ func TestEntityStore_createAttributeMaps(t *testing.T) { { name: "HappyPath_InstanceIdAndAsgMissing", fields: fields{ - mode: config.ModeEC2, + mode: config.ModeEC2, + emptyASG: true, }, want: map[string]*string{ PlatformType: aws.String(EC2PlatForm), @@ -249,8 +254,7 @@ func TestEntityStore_createAttributeMaps(t *testing.T) { name: "NonEC2", fields: fields{ ec2Info: EC2Info{ - InstanceID: "i-123456789", - AutoScalingGroup: "test-asg", + InstanceID: "i-123456789", }, mode: config.ModeOnPrem, }, @@ -263,6 +267,13 @@ func TestEntityStore_createAttributeMaps(t *testing.T) { ec2Info: tt.fields.ec2Info, mode: tt.fields.mode, } + sp := new(mockServiceProvider) + if tt.fields.emptyASG { + sp.On("getAutoScalingGroup").Return("") + } else { + sp.On("getAutoScalingGroup").Return("ASG-1") + } + e.serviceprovider = sp assert.Equalf(t, dereferenceMap(tt.want), dereferenceMap(e.createAttributeMap()), "createAttributeMap()") }) } @@ -320,6 +331,7 @@ func TestEntityStore_createLogFileRID(t *testing.T) { } sp := new(mockServiceProvider) sp.On("logFileServiceAttribute", glob, group).Return(serviceAttr) + sp.On("getAutoScalingGroup").Return("ASG-1") e := EntityStore{ mode: config.ModeEC2, ec2Info: EC2Info{InstanceID: instanceId, AccountID: accountId}, @@ -337,9 +349,10 @@ func TestEntityStore_createLogFileRID(t *testing.T) { entityattributes.AwsAccountId: aws.String(accountId), }, Attributes: map[string]*string{ - InstanceIDKey: aws.String(instanceId), - ServiceNameSourceKey: aws.String(ServiceNameSourceUserConfiguration), - PlatformType: aws.String(EC2PlatForm), + InstanceIDKey: aws.String(instanceId), + ServiceNameSourceKey: aws.String(ServiceNameSourceUserConfiguration), + PlatformType: aws.String(EC2PlatForm), + entityattributes.AutoscalingGroup: aws.String("ASG-1"), }, } assert.Equal(t, dereferenceMap(expectedEntity.KeyAttributes), dereferenceMap(entity.KeyAttributes)) @@ -619,7 +632,7 @@ func TestEntityStore_LogMessageDoesNotIncludeResourceInfo(t *testing.T) { logOutput := buf.String() log.Println(logOutput) assertIfNonEmpty(t, logOutput, es.ec2Info.GetInstanceID()) - assertIfNonEmpty(t, logOutput, es.ec2Info.GetAutoScalingGroup()) + assertIfNonEmpty(t, logOutput, es.GetAutoScalingGroup()) assertIfNonEmpty(t, logOutput, es.ec2Info.GetAccountID()) assert.True(t, es.ready.Load(), "EntityStore should be ready") }) diff --git a/extension/entitystore/serviceprovider.go b/extension/entitystore/serviceprovider.go index 9f36dd9005..d644f7b6cd 100644 --- a/extension/entitystore/serviceprovider.go +++ b/extension/entitystore/serviceprovider.go @@ -59,6 +59,7 @@ type serviceprovider struct { metadataProvider ec2metadataprovider.MetadataProvider iamRole string imdsServiceName string + autoScalingGroup string region string done chan struct{} logger *zap.Logger @@ -79,9 +80,9 @@ func (s *serviceprovider) startServiceProvider() { return } unlimitedRetryer := NewRetryer(false, true, defaultJitterMin, defaultJitterMax, ec2tagger.BackoffSleepArray, infRetry, s.done, s.logger) - limitedRetryer := NewRetryer(false, true, describeTagsJitterMin, describeTagsJitterMax, ec2tagger.ThrottleBackOffArray, maxRetry, s.done, s.logger) + unlimitedRetryerUntilSuccess := NewRetryer(true, true, describeTagsJitterMin, describeTagsJitterMax, ec2tagger.BackoffSleepArray, infRetry, s.done, s.logger) go unlimitedRetryer.refreshLoop(s.scrapeIAMRole) - go limitedRetryer.refreshLoop(s.scrapeImdsServiceName) + go unlimitedRetryerUntilSuccess.refreshLoop(s.scrapeImdsServiceNameAndASG) } func (s *serviceprovider) GetIAMRole() string { @@ -96,6 +97,12 @@ func (s *serviceprovider) GetIMDSServiceName() string { return s.imdsServiceName } +func (s *serviceprovider) getAutoScalingGroup() string { + s.mutex.RLock() + defer s.mutex.RUnlock() + return s.autoScalingGroup +} + // addEntryForLogFile adds an association between a log file glob and a service attribute, as configured in the // CloudWatch Agent config. func (s *serviceprovider) addEntryForLogFile(logFileGlob LogFileGlob, serviceAttr ServiceAttribute) { @@ -206,12 +213,12 @@ func (s *serviceprovider) serviceAttributeFromIamRole() ServiceAttribute { } func (s *serviceprovider) serviceAttributeFromAsg() ServiceAttribute { - if s.ec2Info == nil || s.ec2Info.GetAutoScalingGroup() == "" { + if s.getAutoScalingGroup() == "" { return ServiceAttribute{} } return ServiceAttribute{ - Environment: "ec2:" + s.ec2Info.GetAutoScalingGroup(), + Environment: "ec2:" + s.getAutoScalingGroup(), } } @@ -237,7 +244,7 @@ func (s *serviceprovider) scrapeIAMRole() error { s.mutex.Unlock() return nil } -func (s *serviceprovider) scrapeImdsServiceName() error { +func (s *serviceprovider) scrapeImdsServiceNameAndASG() error { tags, err := s.metadataProvider.InstanceTags(context.Background()) if err != nil { s.logger.Debug("Failed to get service name from instance tags. This is likely because instance tag is not enabled for IMDS but will not affect agent functionality.") @@ -257,9 +264,25 @@ func (s *serviceprovider) scrapeImdsServiceName() error { break } } + if strings.Contains(tags, ec2tagger.Ec2InstanceTagKeyASG) { + asg, err := s.metadataProvider.InstanceTagValue(context.Background(), ec2tagger.Ec2InstanceTagKeyASG) + if err == nil { + s.logger.Debug("AutoScalingGroup retrieved through IMDS") + s.mutex.Lock() + s.autoScalingGroup = asg + if asgLength := len(s.autoScalingGroup); asgLength > autoScalingGroupSizeMax { + s.logger.Warn("AutoScalingGroup length exceeds characters limit and will be ignored", zap.Int("length", asgLength), zap.Int("character limit", autoScalingGroupSizeMax)) + s.autoScalingGroup = "" + } + s.mutex.Unlock() + } + } if s.GetIMDSServiceName() == "" { s.logger.Debug("Service name not found through IMDS") } + if s.getAutoScalingGroup() == "" { + s.logger.Debug("AutoScalingGroup name not found through IMDS") + } return nil } diff --git a/extension/entitystore/serviceprovider_test.go b/extension/entitystore/serviceprovider_test.go index c049c03305..486a73689a 100644 --- a/extension/entitystore/serviceprovider_test.go +++ b/extension/entitystore/serviceprovider_test.go @@ -4,6 +4,7 @@ package entitystore import ( + "strings" "testing" "time" @@ -202,10 +203,10 @@ func Test_serviceprovider_serviceAttributeFromAsg(t *testing.T) { s := &serviceprovider{} assert.Equal(t, ServiceAttribute{}, s.serviceAttributeFromAsg()) - s = &serviceprovider{ec2Info: &EC2Info{}} + s = &serviceprovider{autoScalingGroup: ""} assert.Equal(t, ServiceAttribute{}, s.serviceAttributeFromAsg()) - s = &serviceprovider{ec2Info: &EC2Info{AutoScalingGroup: "test-asg"}} + s = &serviceprovider{autoScalingGroup: "test-asg"} assert.Equal(t, ServiceAttribute{Environment: "ec2:test-asg"}, s.serviceAttributeFromAsg()) } @@ -230,7 +231,7 @@ func Test_serviceprovider_logFileServiceAttribute(t *testing.T) { assert.Equal(t, ServiceAttribute{ServiceName: ServiceNameUnknown, ServiceNameSource: ServiceNameSourceUnknown, Environment: "ec2:default"}, s.logFileServiceAttribute("glob", "group")) - s.ec2Info = &EC2Info{AutoScalingGroup: "test-asg"} + s.autoScalingGroup = "test-asg" assert.Equal(t, ServiceAttribute{ServiceName: ServiceNameUnknown, ServiceNameSource: ServiceNameSourceUnknown, Environment: "ec2:test-asg"}, s.logFileServiceAttribute("glob", "group")) s.iamRole = "test-role" @@ -292,12 +293,13 @@ func Test_serviceprovider_getIAMRole(t *testing.T) { } } -func Test_serviceprovider_getImdsServiceName(t *testing.T) { +func Test_serviceprovider_scrapeAndgetImdsServiceNameAndASG(t *testing.T) { tests := []struct { name string metadataProvider ec2metadataprovider.MetadataProvider wantTagServiceName string + wantASGName string }{ { name: "HappyPath_ServiceExists", @@ -329,6 +331,44 @@ func Test_serviceprovider_getImdsServiceName(t *testing.T) { metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"service": "test-service", "application": "test-application", "app": "test-app"}}, wantTagServiceName: "test-service", }, + { + name: "happy path with Only ASG tag", + metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"aws:autoscaling:groupName": tagVal3}}, + wantASGName: tagVal3, + }, + { + name: "happy path with multiple tags", + metadataProvider: &mockMetadataProvider{ + InstanceIdentityDocument: mockedInstanceIdentityDoc, + Tags: map[string]string{ + "aws:autoscaling:groupName": tagVal3, + "env": "test-env", + "name": "test-name", + }}, + wantASGName: tagVal3, + }, + { + name: "AutoScalingGroup too large", + metadataProvider: &mockMetadataProvider{ + InstanceIdentityDocument: mockedInstanceIdentityDoc, + Tags: map[string]string{ + "aws:autoscaling:groupName": strings.Repeat("a", 256), + "env": "test-env", + "name": "test-name", + }}, + wantASGName: "", + }, + { + name: "Success IMDS tags call with no ASG", + metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"name": tagVal3}}, + wantASGName: "", + }, + { + name: "Success IMDS tags call with both Service and ASG", + metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"aws:autoscaling:groupName": tagVal3, "service": "test-service", "application": "test-application", "app": "test-app"}}, + wantTagServiceName: "test-service", + wantASGName: tagVal3, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -336,8 +376,9 @@ func Test_serviceprovider_getImdsServiceName(t *testing.T) { logger: zap.NewExample(), metadataProvider: tt.metadataProvider, } - s.scrapeImdsServiceName() + s.scrapeImdsServiceNameAndASG() assert.Equal(t, tt.wantTagServiceName, s.GetIMDSServiceName()) + assert.Equal(t, tt.wantASGName, s.getAutoScalingGroup()) }) } } diff --git a/plugins/processors/awsentity/processor.go b/plugins/processors/awsentity/processor.go index 7492050cf7..bd1a63b079 100644 --- a/plugins/processors/awsentity/processor.go +++ b/plugins/processors/awsentity/processor.go @@ -76,6 +76,15 @@ var getEC2InfoFromEntityStore = func() entitystore.EC2Info { return es.EC2Info() } +var getAutoScalingGroupFromEntityStore = func() string { + // Get the following metric attributes from the EntityStore: EC2.AutoScalingGroup + es := entitystore.GetEntityStore() + if es == nil { + return "" + } + return es.GetAutoScalingGroup() +} + var getServiceNameSource = func() (string, string) { es := entitystore.GetEntityStore() if es == nil { @@ -220,8 +229,8 @@ func (p *awsEntityProcessor) processMetrics(_ context.Context, md pmetric.Metric ec2Info = getEC2InfoFromEntityStore() if entityEnvironmentName == EMPTY { - if ec2Info.GetAutoScalingGroup() != EMPTY { - entityEnvironmentName = entityattributes.DeploymentEnvironmentFallbackPrefix + ec2Info.GetAutoScalingGroup() + if getAutoScalingGroupFromEntityStore() != EMPTY { + entityEnvironmentName = entityattributes.DeploymentEnvironmentFallbackPrefix + getAutoScalingGroupFromEntityStore() } else { entityEnvironmentName = entityattributes.DeploymentEnvironmentDefault } @@ -234,7 +243,7 @@ func (p *awsEntityProcessor) processMetrics(_ context.Context, md pmetric.Metric ec2Attributes := EC2ServiceAttributes{ InstanceId: ec2Info.GetInstanceID(), - AutoScalingGroup: ec2Info.GetAutoScalingGroup(), + AutoScalingGroup: getAutoScalingGroupFromEntityStore(), ServiceNameSource: entityServiceNameSource, } if err := validate.Struct(ec2Attributes); err == nil { diff --git a/plugins/processors/awsentity/processor_test.go b/plugins/processors/awsentity/processor_test.go index f865bf4fec..f9051975bd 100644 --- a/plugins/processors/awsentity/processor_test.go +++ b/plugins/processors/awsentity/processor_test.go @@ -60,16 +60,21 @@ func newMockGetServiceNameAndSource(service, source string) func() (string, stri } } -func newMockGetEC2InfoFromEntityStore(instance, accountId, asg string) func() entitystore.EC2Info { +func newMockGetEC2InfoFromEntityStore(instance, accountID string) func() entitystore.EC2Info { return func() entitystore.EC2Info { return entitystore.EC2Info{ - InstanceID: instance, - AccountID: accountId, - AutoScalingGroup: asg, + InstanceID: instance, + AccountID: accountID, } } } +func newMockGetAutoScalingGroupFromEntityStore(asg string) func() string { + return func() string { + return asg + } +} + // This helper function creates a test logger // so that it can send the log messages into a // temporary buffer for pattern matching @@ -276,6 +281,7 @@ func TestProcessMetricsResourceAttributeScraping(t *testing.T) { metrics pmetric.Metrics mockServiceNameSource func() (string, string) mockGetEC2InfoFromEntityStore func() entitystore.EC2Info + mockGetAutoScalingGroup func() string want map[string]any }{ { @@ -290,7 +296,8 @@ func TestProcessMetricsResourceAttributeScraping(t *testing.T) { platform: config.ModeEC2, metrics: generateMetrics(attributeServiceName, "test-service"), mockServiceNameSource: newMockGetServiceNameAndSource("test-service-name", "Instrumentation"), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", ""), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore(""), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "test-service", @@ -307,7 +314,8 @@ func TestProcessMetricsResourceAttributeScraping(t *testing.T) { platform: config.ModeEC2, metrics: generateMetrics(attributeDeploymentEnvironment, "test-environment"), mockServiceNameSource: newMockGetServiceNameAndSource("unknown_service", "Unknown"), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", ""), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore(""), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "unknown_service", @@ -325,7 +333,8 @@ func TestProcessMetricsResourceAttributeScraping(t *testing.T) { platform: config.ModeEC2, metrics: generateMetrics(attributeServiceName, "test-service", attributeDeploymentEnvironment, "test-environment"), mockServiceNameSource: newMockGetServiceNameAndSource("test-service-name", "Instrumentation"), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", "test-auto-scaling"), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore("test-auto-scaling"), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "test-service", @@ -364,7 +373,8 @@ func TestProcessMetricsResourceAttributeScraping(t *testing.T) { platform: config.ModeEC2, metrics: generateMetrics(), mockServiceNameSource: newMockGetServiceNameAndSource("unknown_service", "Unknown"), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", "test-asg"), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore("test-asg"), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "unknown_service", @@ -381,7 +391,8 @@ func TestProcessMetricsResourceAttributeScraping(t *testing.T) { platform: config.ModeEC2, metrics: generateMetrics(), mockServiceNameSource: newMockGetServiceNameAndSource("unknown_service", "Unknown"), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", ""), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore(""), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "unknown_service", @@ -404,6 +415,9 @@ func TestProcessMetricsResourceAttributeScraping(t *testing.T) { if tt.mockGetEC2InfoFromEntityStore != nil { getEC2InfoFromEntityStore = tt.mockGetEC2InfoFromEntityStore } + if tt.mockGetAutoScalingGroup != nil { + getAutoScalingGroupFromEntityStore = tt.mockGetAutoScalingGroup + } p := newAwsEntityProcessor(&Config{EntityType: attributeService, ClusterName: tt.clusterName}, logger) p.config.Platform = tt.platform p.config.KubernetesMode = tt.kubernetesMode @@ -457,7 +471,7 @@ func TestProcessMetricsResourceEntityProcessing(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - getEC2InfoFromEntityStore = newMockGetEC2InfoFromEntityStore(tt.instance, tt.accountId, tt.asg) + getEC2InfoFromEntityStore = newMockGetEC2InfoFromEntityStore(tt.instance, tt.accountId) p := newAwsEntityProcessor(&Config{EntityType: entityattributes.Resource}, logger) p.config.Platform = config.ModeEC2 _, err := p.processMetrics(ctx, tt.metrics) @@ -524,7 +538,7 @@ func TestAWSEntityProcessorNoSensitiveInfoInLogs(t *testing.T) { resetGetEC2InfoFromEntityStore := getEC2InfoFromEntityStore asgName := "test-asg" - getEC2InfoFromEntityStore = newMockGetEC2InfoFromEntityStore("i-1234567890abcdef0", "123456789012", asgName) + getEC2InfoFromEntityStore = newMockGetEC2InfoFromEntityStore("i-1234567890abcdef0", "123456789012") defer func() { getEC2InfoFromEntityStore = resetGetEC2InfoFromEntityStore }() md := generateTestMetrics() @@ -600,6 +614,7 @@ func TestProcessMetricsDatapointAttributeScraping(t *testing.T) { metrics pmetric.Metrics mockServiceNameAndSource func() (string, string) mockGetEC2InfoFromEntityStore func() entitystore.EC2Info + mockGetAutoScalingGroup func() string want map[string]any wantDatapointAttributes map[string]any }{ @@ -611,7 +626,8 @@ func TestProcessMetricsDatapointAttributeScraping(t *testing.T) { { name: "DatapointAttributeServiceNameOnly", metrics: generateDatapointMetrics(attributeServiceName, "test-service"), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", "auto-scaling"), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore("auto-scaling"), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "test-service", @@ -627,7 +643,8 @@ func TestProcessMetricsDatapointAttributeScraping(t *testing.T) { name: "DatapointAttributeEnvironmentOnly", metrics: generateDatapointMetrics(attributeDeploymentEnvironment, "test-environment"), mockServiceNameAndSource: newMockGetServiceNameAndSource("test-service-name", "ClientIamRole"), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", ""), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore(""), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "test-service-name", @@ -641,7 +658,8 @@ func TestProcessMetricsDatapointAttributeScraping(t *testing.T) { { name: "DatapointAttributeServiceNameAndEnvironment", metrics: generateDatapointMetrics(attributeServiceName, "test-service", attributeDeploymentEnvironment, "test-environment"), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", ""), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore(""), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "test-service", @@ -656,7 +674,8 @@ func TestProcessMetricsDatapointAttributeScraping(t *testing.T) { name: "DatapointAttributeServiceAndEnvironmentNameUserConfiguration", checkDatapointAttributeRemoval: true, metrics: generateDatapointMetrics(attributeServiceName, "test-service", attributeDeploymentEnvironment, "test-environment", entityattributes.AttributeServiceNameSource, entityattributes.AttributeServiceNameSourceUserConfig, entityattributes.AttributeDeploymentEnvironmentSource, entityattributes.AttributeServiceNameSourceUserConfig), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", ""), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore(""), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "test-service", @@ -672,7 +691,8 @@ func TestProcessMetricsDatapointAttributeScraping(t *testing.T) { name: "DatapointAttributeServiceNameUserConfigurationAndUserEnvironment", checkDatapointAttributeRemoval: true, metrics: generateDatapointMetrics(attributeServiceName, "test-service", attributeDeploymentEnvironment, "test-environment", entityattributes.AttributeServiceNameSource, entityattributes.AttributeServiceNameSourceUserConfig), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", ""), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore(""), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "test-service", @@ -690,7 +710,8 @@ func TestProcessMetricsDatapointAttributeScraping(t *testing.T) { name: "DatapointAttributeEnvironmentNameUserConfigurationAndUserServiceName", checkDatapointAttributeRemoval: true, metrics: generateDatapointMetrics(attributeServiceName, "test-service", attributeDeploymentEnvironment, "test-environment", entityattributes.AttributeDeploymentEnvironmentSource, entityattributes.AttributeServiceNameSourceUserConfig), - mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012", ""), + mockGetEC2InfoFromEntityStore: newMockGetEC2InfoFromEntityStore("i-123456789", "0123456789012"), + mockGetAutoScalingGroup: newMockGetAutoScalingGroupFromEntityStore(""), want: map[string]any{ entityattributes.AttributeEntityType: "Service", entityattributes.AttributeEntityServiceName: "test-service", @@ -716,6 +737,9 @@ func TestProcessMetricsDatapointAttributeScraping(t *testing.T) { if tt.mockGetEC2InfoFromEntityStore != nil { getEC2InfoFromEntityStore = tt.mockGetEC2InfoFromEntityStore } + if tt.mockGetAutoScalingGroup != nil { + getAutoScalingGroupFromEntityStore = tt.mockGetAutoScalingGroup + } p := newAwsEntityProcessor(&Config{ScrapeDatapointAttribute: true, EntityType: attributeService}, logger) p.config.Platform = config.ModeEC2 _, err := p.processMetrics(ctx, tt.metrics) From 03cbd6b0b46837a8025807bbff2254c4a0e1e3c0 Mon Sep 17 00:00:00 2001 From: Chad Patel Date: Mon, 23 Dec 2024 09:58:22 -0600 Subject: [PATCH 08/14] Case insensitive service provider (#1478) --- extension/entitystore/extension_test.go | 11 +++--- extension/entitystore/serviceprovider.go | 35 ++++++++++++------- extension/entitystore/serviceprovider_test.go | 32 +++++++++++++++++ .../ec2metadataprovider.go | 11 ++++-- .../processors/ec2tagger/ec2tagger_test.go | 4 +-- 5 files changed, 69 insertions(+), 24 deletions(-) diff --git a/extension/entitystore/extension_test.go b/extension/entitystore/extension_test.go index f1571e2c8d..982be1ee47 100644 --- a/extension/entitystore/extension_test.go +++ b/extension/entitystore/extension_test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/mock" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "golang.org/x/exp/maps" "github.com/aws/amazon-cloudwatch-agent/internal/ec2metadataprovider" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsentity/entityattributes" @@ -108,15 +109,11 @@ func (m *mockMetadataProvider) InstanceID(ctx context.Context) (string, error) { return "MockInstanceID", nil } -func (m *mockMetadataProvider) InstanceTags(ctx context.Context) (string, error) { +func (m *mockMetadataProvider) InstanceTags(_ context.Context) ([]string, error) { if m.InstanceTagError { - return "", errors.New("an error occurred for instance tag retrieval") + return nil, errors.New("an error occurred for instance tag retrieval") } - var tagsString string - for key, val := range m.Tags { - tagsString += key + "=" + val + "," - } - return tagsString, nil + return maps.Keys(m.Tags), nil } func (m *mockMetadataProvider) ClientIAMRole(ctx context.Context) (string, error) { diff --git a/extension/entitystore/serviceprovider.go b/extension/entitystore/serviceprovider.go index d644f7b6cd..b43fceeea5 100644 --- a/extension/entitystore/serviceprovider.go +++ b/extension/entitystore/serviceprovider.go @@ -40,8 +40,8 @@ const ( ) var ( - //priorityMap is ranking in how we prioritize which IMDS tag determines the service name - priorityMap = []string{SERVICE, APPLICATION, APP} + //serviceProviderPriorities is ranking in how we prioritize which IMDS tag determines the service name + serviceProviderPriorities = []string{SERVICE, APPLICATION, APP} ) type ServiceAttribute struct { @@ -245,26 +245,28 @@ func (s *serviceprovider) scrapeIAMRole() error { return nil } func (s *serviceprovider) scrapeImdsServiceNameAndASG() error { - tags, err := s.metadataProvider.InstanceTags(context.Background()) + tagKeys, err := s.metadataProvider.InstanceTags(context.Background()) if err != nil { s.logger.Debug("Failed to get service name from instance tags. This is likely because instance tag is not enabled for IMDS but will not affect agent functionality.") return err } - // This will check whether the tags contains SERVICE, APPLICATION, APP, in that order. - for _, value := range priorityMap { - if strings.Contains(tags, value) { - serviceName, err := s.metadataProvider.InstanceTagValue(context.Background(), value) + + // This will check whether the tags contains SERVICE, APPLICATION, APP, in that order (case insensitive) + lowerTagKeys := toLowerKeyMap(tagKeys) + for _, potentialServiceProviderKey := range serviceProviderPriorities { + if originalCaseKey, exists := lowerTagKeys[potentialServiceProviderKey]; exists { + serviceName, err := s.metadataProvider.InstanceTagValue(context.Background(), originalCaseKey) if err != nil { continue - } else { - s.mutex.Lock() - s.imdsServiceName = serviceName - s.mutex.Unlock() } + s.mutex.Lock() + s.imdsServiceName = serviceName + s.mutex.Unlock() break } } - if strings.Contains(tags, ec2tagger.Ec2InstanceTagKeyASG) { + // case sensitive + if originalCaseKey := lowerTagKeys[strings.ToLower(ec2tagger.Ec2InstanceTagKeyASG)]; originalCaseKey == ec2tagger.Ec2InstanceTagKeyASG { asg, err := s.metadataProvider.InstanceTagValue(context.Background(), ec2tagger.Ec2InstanceTagKeyASG) if err == nil { s.logger.Debug("AutoScalingGroup retrieved through IMDS") @@ -277,6 +279,7 @@ func (s *serviceprovider) scrapeImdsServiceNameAndASG() error { s.mutex.Unlock() } } + if s.GetIMDSServiceName() == "" { s.logger.Debug("Service name not found through IMDS") } @@ -286,6 +289,14 @@ func (s *serviceprovider) scrapeImdsServiceNameAndASG() error { return nil } +func toLowerKeyMap(values []string) map[string]string { + set := make(map[string]string, len(values)) + for _, v := range values { + set[strings.ToLower(v)] = v + } + return set +} + func newServiceProvider(mode string, region string, ec2Info *EC2Info, metadataProvider ec2metadataprovider.MetadataProvider, providerType ec2ProviderType, ec2Credential *configaws.CredentialConfig, done chan struct{}, logger *zap.Logger) serviceProviderInterface { return &serviceprovider{ mode: mode, diff --git a/extension/entitystore/serviceprovider_test.go b/extension/entitystore/serviceprovider_test.go index 486a73689a..e2c5bcad08 100644 --- a/extension/entitystore/serviceprovider_test.go +++ b/extension/entitystore/serviceprovider_test.go @@ -306,6 +306,16 @@ func Test_serviceprovider_scrapeAndgetImdsServiceNameAndASG(t *testing.T) { metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"service": "test-service"}}, wantTagServiceName: "test-service", }, + { + name: "HappyPath_ServiceExistsCaseInsensitive", + metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"ServicE": "test-service"}}, + wantTagServiceName: "test-service", + }, + { + name: "ServiceExistsRequiresExactMatch", + metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"sservicee": "test-service"}}, + wantTagServiceName: "", + }, { name: "HappyPath_ApplicationExists", metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"application": "test-application"}}, @@ -358,6 +368,28 @@ func Test_serviceprovider_scrapeAndgetImdsServiceNameAndASG(t *testing.T) { }}, wantASGName: "", }, + { + name: "AutoScalingGroup case sensitive", + metadataProvider: &mockMetadataProvider{ + InstanceIdentityDocument: mockedInstanceIdentityDoc, + Tags: map[string]string{ + "aws:autoscaling:groupname": tagVal3, + "env": "test-env", + "name": "test-name", + }}, + wantASGName: "", + }, + { + name: "AutoScalingGroup exact match", + metadataProvider: &mockMetadataProvider{ + InstanceIdentityDocument: mockedInstanceIdentityDoc, + Tags: map[string]string{ + "aws:autoscaling:groupnamee": tagVal3, + "env": "test-env", + "name": "test-name", + }}, + wantASGName: "", + }, { name: "Success IMDS tags call with no ASG", metadataProvider: &mockMetadataProvider{InstanceIdentityDocument: mockedInstanceIdentityDoc, Tags: map[string]string{"name": tagVal3}}, diff --git a/internal/ec2metadataprovider/ec2metadataprovider.go b/internal/ec2metadataprovider/ec2metadataprovider.go index 23ece5ad46..5134c1ce5a 100644 --- a/internal/ec2metadataprovider/ec2metadataprovider.go +++ b/internal/ec2metadataprovider/ec2metadataprovider.go @@ -6,6 +6,7 @@ package ec2metadataprovider import ( "context" "log" + "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" @@ -20,7 +21,7 @@ type MetadataProvider interface { Get(ctx context.Context) (ec2metadata.EC2InstanceIdentityDocument, error) Hostname(ctx context.Context) (string, error) InstanceID(ctx context.Context) (string, error) - InstanceTags(ctx context.Context) (string, error) + InstanceTags(ctx context.Context) ([]string, error) ClientIAMRole(ctx context.Context) (string, error) InstanceTagValue(ctx context.Context, tagKey string) (string, error) } @@ -67,10 +68,14 @@ func (c *metadataClient) ClientIAMRole(ctx context.Context) (string, error) { }) } -func (c *metadataClient) InstanceTags(ctx context.Context) (string, error) { - return withMetadataFallbackRetry(ctx, c, func(metadataClient *ec2metadata.EC2Metadata) (string, error) { +func (c *metadataClient) InstanceTags(ctx context.Context) ([]string, error) { + tags, err := withMetadataFallbackRetry(ctx, c, func(metadataClient *ec2metadata.EC2Metadata) (string, error) { return metadataClient.GetMetadataWithContext(ctx, "tags/instance") }) + if err != nil { + return nil, err + } + return strings.Fields(tags), nil } func (c *metadataClient) InstanceTagValue(ctx context.Context, tagKey string) (string, error) { diff --git a/plugins/processors/ec2tagger/ec2tagger_test.go b/plugins/processors/ec2tagger/ec2tagger_test.go index f550a75ebc..93642e3c6e 100644 --- a/plugins/processors/ec2tagger/ec2tagger_test.go +++ b/plugins/processors/ec2tagger/ec2tagger_test.go @@ -144,8 +144,8 @@ func (m *mockMetadataProvider) InstanceID(ctx context.Context) (string, error) { return "MockInstanceID", nil } -func (m *mockMetadataProvider) InstanceTags(ctx context.Context) (string, error) { - return "MockInstanceTag", nil +func (m *mockMetadataProvider) InstanceTags(_ context.Context) ([]string, error) { + return []string{"MockInstanceTag"}, nil } func (m *mockMetadataProvider) InstanceTagValue(ctx context.Context, tagKey string) (string, error) { From ef15aa4922a86cec0d3f182aa800b079d890a95d Mon Sep 17 00:00:00 2001 From: Musa Date: Mon, 30 Dec 2024 12:42:41 -0500 Subject: [PATCH 09/14] Implement JMX E2E Tests in Testing Workflow (#1463) --- .github/workflows/e2e-test.yml | 72 ++++++++++++++++++++++++++++-- .github/workflows/eks-e2e-test.yml | 1 + tool/clean/clean_eks/clean_eks.go | 1 + 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 2ae0342a81..27dd6f887e 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -128,7 +128,7 @@ jobs: name: 'GenerateTestMatrix' runs-on: ubuntu-latest outputs: - eks_e2e_matrix: ${{ steps.set-matrix.outputs.eks_e2e_matrix }} + eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }} steps: - uses: actions/checkout@v3 with: @@ -144,8 +144,74 @@ jobs: id: set-matrix run: | go run generator/test_case_generator.go -e2e - echo "::set-output name=eks_e2e_matrix::$(echo $(cat generator/resources/eks_e2e_complete_test_matrix.json))" + echo "::set-output name=eks_e2e_jmx_matrix::$(echo $(cat generator/resources/eks_e2e_jmx_complete_test_matrix.json))" - name: Echo test plan matrix run: | - echo "eks_e2e_matrix: ${{ steps.set-matrix.outputs.eks_e2e_matrix }}" \ No newline at end of file + echo "eks_e2e_jmx_matrix: ${{ steps.set-matrix.outputs.eks_e2e_jmx_matrix }}" + + EKSE2EJVMTomcatTest: + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] + name: 'EKSE2EJVMTomcatTest' + uses: ./.github/workflows/eks-e2e-test.yml + with: + terraform_dir: terraform/eks/e2e + job_id: eks-e2e-jvm-tomcat-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region }} + helm_charts_branch: ${{ inputs.helm-charts-branch }} + terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + agent_config: resources/cwagent_configs/jvm_tomcat.json + sample_app: resources/sample_apps/tomcat.yaml + secrets: inherit + + EKSE2EKafkaTest: + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] + name: 'EKSE2EKafkaTest' + uses: ./.github/workflows/eks-e2e-test.yml + with: + terraform_dir: terraform/eks/e2e + job_id: eks-e2e-kafka-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region }} + helm_charts_branch: ${{ inputs.helm-charts-branch }} + terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + agent_config: resources/cwagent_configs/kafka.json + sample_app: resources/sample_apps/kafka.yaml + secrets: inherit + + EKSE2EJMXContainerInsightsTest: + needs: [ GetLatestOperatorCommitSHA, GenerateTestMatrix, OutputEnvVariables ] + name: 'EKSE2EJMXContainerInsightsTest' + uses: ./.github/workflows/eks-e2e-test.yml + with: + terraform_dir: terraform/eks/e2e + job_id: eks-e2e-jmx-containerinsights-test + test_props: ${{ needs.GenerateTestMatrix.outputs.eks_e2e_jmx_matrix }} + test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} + test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} + test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} + cloudwatch_agent_repository: ${{ needs.OutputEnvVariables.outputs.ECR_INTEGRATION_TEST_REPO }} + cloudwatch_agent_tag: ${{ github.sha }} + cloudwatch_agent_operator_repository: ${{ needs.OutputEnvVariables.outputs.ECR_OPERATOR_REPO }} + cloudwatch_agent_operator_tag: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} + region: ${{ inputs.region }} + helm_charts_branch: ${{ inputs.helm-charts-branch }} + terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} + agent_config: resources/cwagent_configs/containerinsights.json + sample_app: resources/sample_apps/tomcat.yaml + secrets: inherit diff --git a/.github/workflows/eks-e2e-test.yml b/.github/workflows/eks-e2e-test.yml index 31edb07b0a..a70d8da61e 100644 --- a/.github/workflows/eks-e2e-test.yml +++ b/.github/workflows/eks-e2e-test.yml @@ -124,6 +124,7 @@ jobs: if terraform apply --auto-approve \ -var="region=${{ inputs.region }}" \ -var="k8s_version=${{ matrix.arrays.k8s_version }}" \ + -var="nodes=${{ matrix.arrays.nodes }}" \ -var="helm_charts_branch=${{ inputs.helm_charts_branch }}" \ -var="cloudwatch_agent_repository_url=${{ steps.login-ecr.outputs.registry }}" \ -var="cloudwatch_agent_repository=${{ inputs.cloudwatch_agent_repository }}" \ diff --git a/tool/clean/clean_eks/clean_eks.go b/tool/clean/clean_eks/clean_eks.go index 607e8062a8..a7dffc07bc 100644 --- a/tool/clean/clean_eks/clean_eks.go +++ b/tool/clean/clean_eks/clean_eks.go @@ -25,6 +25,7 @@ var ( "cwagent-operator-helm-integ-", "cwagent-helm-chart-integ-", "cwagent-operator-eks-integ-", + "cwagent-monitoring-config-e2e-eks-", } ) From dfd207047018b0d7afe1905bdd747790241c0cfa Mon Sep 17 00:00:00 2001 From: zhihonl <61301537+zhihonl@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:05:35 -0500 Subject: [PATCH 10/14] [processor/awsentity] Add awsentity processor into EMF pipeline (#1482) --- plugins/processors/awsentity/factory.go | 24 ++++++++++++++++++- plugins/processors/awsentity/factory_test.go | 4 ++-- plugins/processors/awsentity/processor.go | 5 ++++ .../base_container_insights_config.yaml | 4 ++++ .../sampleConfig/complete_darwin_config.yaml | 4 ++++ .../sampleConfig/complete_linux_config.yaml | 4 ++++ .../sampleConfig/complete_windows_config.yaml | 4 ++++ .../sampleConfig/config_with_env.yaml | 4 ++++ .../emf_and_kubernetes_config.yaml | 4 ++++ .../emf_and_kubernetes_with_gpu_config.yaml | 4 ++++ .../emf_and_kubernetes_with_kueue_config.yaml | 4 ++++ .../kueue_container_insights_config.yaml | 4 ++++ .../logs_and_kubernetes_config.yaml | 4 ++++ .../otel/pipeline/emf_logs/translator.go | 6 +++++ .../otel/pipeline/emf_logs/translator_test.go | 8 +++---- 15 files changed, 80 insertions(+), 7 deletions(-) diff --git a/plugins/processors/awsentity/factory.go b/plugins/processors/awsentity/factory.go index 32887ffa6a..caf4696c87 100644 --- a/plugins/processors/awsentity/factory.go +++ b/plugins/processors/awsentity/factory.go @@ -26,7 +26,9 @@ func NewFactory() processor.Factory { return processor.NewFactory( TypeStr, createDefaultConfig, - processor.WithMetrics(createMetricsProcessor, stability)) + processor.WithMetrics(createMetricsProcessor, stability), + processor.WithLogs(createLogsProcessor, stability), + ) } func createDefaultConfig() component.Config { @@ -53,3 +55,23 @@ func createMetricsProcessor( metricsProcessor.processMetrics, processorhelper.WithCapabilities(processorCapabilities)) } + +func createLogsProcessor( + ctx context.Context, + set processor.Settings, + cfg component.Config, + nextConsumer consumer.Logs, +) (processor.Logs, error) { + processorConfig, ok := cfg.(*Config) + if !ok { + return nil, errors.New("configuration parsing error") + } + logProcessor := newAwsEntityProcessor(processorConfig, set.Logger) + return processorhelper.NewLogsProcessor( + ctx, + set, + cfg, + nextConsumer, + logProcessor.processLogs, + processorhelper.WithCapabilities(processorCapabilities)) +} diff --git a/plugins/processors/awsentity/factory_test.go b/plugins/processors/awsentity/factory_test.go index a00799bc55..e98c61b26d 100644 --- a/plugins/processors/awsentity/factory_test.go +++ b/plugins/processors/awsentity/factory_test.go @@ -40,6 +40,6 @@ func TestCreateProcessor(t *testing.T) { assert.NotNil(t, mProcessor) lProcessor, err := factory.CreateLogsProcessor(context.Background(), setting, cfg, consumertest.NewNop()) - assert.Equal(t, err, component.ErrDataTypeIsNotSupported) - assert.Nil(t, lProcessor) + assert.NoError(t, err) + assert.NotNil(t, lProcessor) } diff --git a/plugins/processors/awsentity/processor.go b/plugins/processors/awsentity/processor.go index bd1a63b079..b39f4ec8c1 100644 --- a/plugins/processors/awsentity/processor.go +++ b/plugins/processors/awsentity/processor.go @@ -9,6 +9,7 @@ import ( "github.com/go-playground/validator/v10" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" semconv "go.opentelemetry.io/collector/semconv/v1.22.0" "go.uber.org/zap" @@ -110,6 +111,10 @@ func newAwsEntityProcessor(config *Config, logger *zap.Logger) *awsEntityProcess } } +func (p *awsEntityProcessor) processLogs(_ context.Context, ld plog.Logs) (plog.Logs, error) { + return ld, nil +} + func (p *awsEntityProcessor) processMetrics(_ context.Context, md pmetric.Metrics) (pmetric.Metrics, error) { // Get the following metric attributes from the EntityStore: PlatformType, EC2.InstanceId, EC2.AutoScalingGroup diff --git a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml index 4df5992b20..5002e989b6 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -159,6 +159,9 @@ extensions: mode: ec2 region: us-east-1 processors: + awsentity/service/emf: + entity_type: Service + platform: ec2 batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -235,6 +238,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index cb9b62b5d7..04253829b9 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -105,6 +105,9 @@ processors: awsentity/resource: entity_type: Resource platform: ec2 + awsentity/service/emf: + entity_type: Service + platform: ec2 awsentity/service/telegraf: entity_type: Service platform: ec2 @@ -273,6 +276,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - udplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml index 6105f937bc..5ee86838e1 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -111,6 +111,9 @@ processors: awsentity/resource: entity_type: Resource platform: ec2 + awsentity/service/emf: + entity_type: Service + platform: ec2 awsentity/service/telegraf: entity_type: Service platform: ec2 @@ -380,6 +383,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - udplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/complete_windows_config.yaml b/translator/tocwconfig/sampleConfig/complete_windows_config.yaml index e7fa12f152..0a7fb5c98f 100644 --- a/translator/tocwconfig/sampleConfig/complete_windows_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_windows_config.yaml @@ -105,6 +105,9 @@ processors: awsentity/resource: entity_type: Resource platform: ec2 + awsentity/service/emf: + entity_type: Service + platform: ec2 awsentity/service/telegraf: entity_type: Service platform: ec2 @@ -260,6 +263,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - udplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/config_with_env.yaml b/translator/tocwconfig/sampleConfig/config_with_env.yaml index 40307cc324..82dddd5788 100644 --- a/translator/tocwconfig/sampleConfig/config_with_env.yaml +++ b/translator/tocwconfig/sampleConfig/config_with_env.yaml @@ -50,6 +50,9 @@ extensions: mode: ec2 region: ${ENV_REGION} processors: + awsentity/service/emf: + entity_type: Service + platform: ec2 batch/emf_logs: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -92,6 +95,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml index 8a0d8fc3e2..766c73e1fa 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml @@ -411,6 +411,9 @@ extensions: region: us-east-1 shared_credential_file: /root/.aws/credentials processors: + awsentity/service/emf: + entity_type: Service + platform: onPremise batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -499,6 +502,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml index d70f0580c3..961f1ea924 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml @@ -669,6 +669,9 @@ extensions: region: us-east-1 shared_credential_file: /root/.aws/credentials processors: + awsentity/service/emf: + entity_type: Service + platform: onPremise batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -1171,6 +1174,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml index f59e0a6639..31d2db9286 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml @@ -491,6 +491,9 @@ extensions: region: us-east-1 shared_credential_file: /root/.aws/credentials processors: + awsentity/service/emf: + entity_type: Service + platform: onPremise batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -588,6 +591,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml index afc2bc77ed..42ff679f8b 100644 --- a/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml @@ -237,6 +237,9 @@ extensions: mode: ec2 region: us-east-1 processors: + awsentity/service/emf: + entity_type: Service + platform: ec2 batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -322,6 +325,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml index 46216e4031..0ff9a6b06d 100644 --- a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml @@ -405,6 +405,9 @@ extensions: mode: ec2 region: us-east-1 processors: + awsentity/service/emf: + entity_type: Service + platform: ec2 batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -491,6 +494,7 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: + - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/translate/otel/pipeline/emf_logs/translator.go b/translator/translate/otel/pipeline/emf_logs/translator.go index c155b8176c..7172e6df98 100644 --- a/translator/translate/otel/pipeline/emf_logs/translator.go +++ b/translator/translate/otel/pipeline/emf_logs/translator.go @@ -9,12 +9,15 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" + "github.com/aws/amazon-cloudwatch-agent/translator/context" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/exporter/awscloudwatchlogs" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" + "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/processor/awsentity" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/processor/batchprocessor" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/receiver/tcplog" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/receiver/udplog" + "github.com/aws/amazon-cloudwatch-agent/translator/util/ecsutil" ) var ( @@ -54,6 +57,9 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true), ), } + if !(context.CurrentContext().RunInContainer() && ecsutil.GetECSUtilSingleton().IsECS()) { + translators.Processors.Set(awsentity.NewTranslatorWithEntityType(awsentity.Service, "emf", false)) + } if serviceAddress, ok := common.GetString(conf, serviceAddressEMFKey); ok { if strings.Contains(serviceAddress, common.Udp) { translators.Receivers.Set(udplog.NewTranslatorWithName(common.PipelineNameEmfLogs)) diff --git a/translator/translate/otel/pipeline/emf_logs/translator_test.go b/translator/translate/otel/pipeline/emf_logs/translator_test.go index 2354ca057e..5ff0b97af3 100644 --- a/translator/translate/otel/pipeline/emf_logs/translator_test.go +++ b/translator/translate/otel/pipeline/emf_logs/translator_test.go @@ -46,7 +46,7 @@ func TestTranslator(t *testing.T) { want: &want{ pipelineType: "logs/emf_logs", receivers: []string{"tcplog/emf_logs", "udplog/emf_logs"}, - processors: []string{"batch/emf_logs"}, + processors: []string{"batch/emf_logs", "awsentity/service/emf"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, @@ -62,7 +62,7 @@ func TestTranslator(t *testing.T) { want: &want{ pipelineType: "logs/emf_logs", receivers: []string{"tcplog/emf_logs", "udplog/emf_logs"}, - processors: []string{"batch/emf_logs"}, + processors: []string{"batch/emf_logs", "awsentity/service/emf"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, @@ -80,7 +80,7 @@ func TestTranslator(t *testing.T) { want: &want{ pipelineType: "logs/emf_logs", receivers: []string{"udplog/emf_logs"}, - processors: []string{"batch/emf_logs"}, + processors: []string{"batch/emf_logs", "awsentity/service/emf"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, @@ -98,7 +98,7 @@ func TestTranslator(t *testing.T) { want: &want{ pipelineType: "logs/emf_logs", receivers: []string{"tcplog/emf_logs"}, - processors: []string{"batch/emf_logs"}, + processors: []string{"batch/emf_logs", "awsentity/service/emf"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, From 07361c70329fe79757221c312f062729e4b62446 Mon Sep 17 00:00:00 2001 From: Kaushik Surya <108111936+sky333999@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:49:31 -0600 Subject: [PATCH 11/14] Fix concurrent read write error for entity store (#1484) --- extension/entitystore/serviceprovider.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/extension/entitystore/serviceprovider.go b/extension/entitystore/serviceprovider.go index b43fceeea5..5acee79a6a 100644 --- a/extension/entitystore/serviceprovider.go +++ b/extension/entitystore/serviceprovider.go @@ -64,6 +64,7 @@ type serviceprovider struct { done chan struct{} logger *zap.Logger mutex sync.RWMutex + logMutex sync.RWMutex // logFiles stores the service attributes that were configured for log files in CloudWatch Agent configuration. // Example: // "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log": {ServiceName: "cloudwatch-agent"} @@ -106,6 +107,8 @@ func (s *serviceprovider) getAutoScalingGroup() string { // addEntryForLogFile adds an association between a log file glob and a service attribute, as configured in the // CloudWatch Agent config. func (s *serviceprovider) addEntryForLogFile(logFileGlob LogFileGlob, serviceAttr ServiceAttribute) { + s.logMutex.Lock() + defer s.logMutex.Unlock() if s.logFiles == nil { s.logFiles = make(map[LogFileGlob]ServiceAttribute) } @@ -115,6 +118,8 @@ func (s *serviceprovider) addEntryForLogFile(logFileGlob LogFileGlob, serviceAtt // addEntryForLogGroup adds an association between a log group name and a service attribute, as observed from incoming // telemetry received by CloudWatch Agent. func (s *serviceprovider) addEntryForLogGroup(logGroupName LogGroupName, serviceAttr ServiceAttribute) { + s.logMutex.Lock() + defer s.logMutex.Unlock() if s.logGroups == nil { s.logGroups = make(map[LogGroupName]ServiceAttribute) } @@ -178,7 +183,8 @@ func (s *serviceprovider) serviceAttributeForLogGroup(logGroup LogGroupName) Ser if logGroup == "" || s.logGroups == nil { return ServiceAttribute{} } - + s.logMutex.RLock() + defer s.logMutex.RUnlock() return s.logGroups[logGroup] } @@ -186,7 +192,8 @@ func (s *serviceprovider) serviceAttributeForLogFile(logFile LogFileGlob) Servic if logFile == "" || s.logFiles == nil { return ServiceAttribute{} } - + s.logMutex.RLock() + defer s.logMutex.RUnlock() return s.logFiles[logFile] } From ecf739b3d49f41c62b286d03e6994ec013cdf7fd Mon Sep 17 00:00:00 2001 From: zhihonl <61301537+zhihonl@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:13:31 -0500 Subject: [PATCH 12/14] Revert "[processor/awsentity] Add awsentity processor into EMF pipeline (#1482)" (#1489) --- plugins/processors/awsentity/factory.go | 24 +------------------ plugins/processors/awsentity/factory_test.go | 4 ++-- plugins/processors/awsentity/processor.go | 5 ---- .../base_container_insights_config.yaml | 4 ---- .../sampleConfig/complete_darwin_config.yaml | 4 ---- .../sampleConfig/complete_linux_config.yaml | 4 ---- .../sampleConfig/complete_windows_config.yaml | 4 ---- .../sampleConfig/config_with_env.yaml | 4 ---- .../emf_and_kubernetes_config.yaml | 4 ---- .../emf_and_kubernetes_with_gpu_config.yaml | 4 ---- .../emf_and_kubernetes_with_kueue_config.yaml | 4 ---- .../kueue_container_insights_config.yaml | 4 ---- .../logs_and_kubernetes_config.yaml | 4 ---- .../otel/pipeline/emf_logs/translator.go | 6 ----- .../otel/pipeline/emf_logs/translator_test.go | 8 +++---- 15 files changed, 7 insertions(+), 80 deletions(-) diff --git a/plugins/processors/awsentity/factory.go b/plugins/processors/awsentity/factory.go index caf4696c87..32887ffa6a 100644 --- a/plugins/processors/awsentity/factory.go +++ b/plugins/processors/awsentity/factory.go @@ -26,9 +26,7 @@ func NewFactory() processor.Factory { return processor.NewFactory( TypeStr, createDefaultConfig, - processor.WithMetrics(createMetricsProcessor, stability), - processor.WithLogs(createLogsProcessor, stability), - ) + processor.WithMetrics(createMetricsProcessor, stability)) } func createDefaultConfig() component.Config { @@ -55,23 +53,3 @@ func createMetricsProcessor( metricsProcessor.processMetrics, processorhelper.WithCapabilities(processorCapabilities)) } - -func createLogsProcessor( - ctx context.Context, - set processor.Settings, - cfg component.Config, - nextConsumer consumer.Logs, -) (processor.Logs, error) { - processorConfig, ok := cfg.(*Config) - if !ok { - return nil, errors.New("configuration parsing error") - } - logProcessor := newAwsEntityProcessor(processorConfig, set.Logger) - return processorhelper.NewLogsProcessor( - ctx, - set, - cfg, - nextConsumer, - logProcessor.processLogs, - processorhelper.WithCapabilities(processorCapabilities)) -} diff --git a/plugins/processors/awsentity/factory_test.go b/plugins/processors/awsentity/factory_test.go index e98c61b26d..a00799bc55 100644 --- a/plugins/processors/awsentity/factory_test.go +++ b/plugins/processors/awsentity/factory_test.go @@ -40,6 +40,6 @@ func TestCreateProcessor(t *testing.T) { assert.NotNil(t, mProcessor) lProcessor, err := factory.CreateLogsProcessor(context.Background(), setting, cfg, consumertest.NewNop()) - assert.NoError(t, err) - assert.NotNil(t, lProcessor) + assert.Equal(t, err, component.ErrDataTypeIsNotSupported) + assert.Nil(t, lProcessor) } diff --git a/plugins/processors/awsentity/processor.go b/plugins/processors/awsentity/processor.go index b39f4ec8c1..bd1a63b079 100644 --- a/plugins/processors/awsentity/processor.go +++ b/plugins/processors/awsentity/processor.go @@ -9,7 +9,6 @@ import ( "github.com/go-playground/validator/v10" "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" semconv "go.opentelemetry.io/collector/semconv/v1.22.0" "go.uber.org/zap" @@ -111,10 +110,6 @@ func newAwsEntityProcessor(config *Config, logger *zap.Logger) *awsEntityProcess } } -func (p *awsEntityProcessor) processLogs(_ context.Context, ld plog.Logs) (plog.Logs, error) { - return ld, nil -} - func (p *awsEntityProcessor) processMetrics(_ context.Context, md pmetric.Metrics) (pmetric.Metrics, error) { // Get the following metric attributes from the EntityStore: PlatformType, EC2.InstanceId, EC2.AutoScalingGroup diff --git a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml index 5002e989b6..4df5992b20 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -159,9 +159,6 @@ extensions: mode: ec2 region: us-east-1 processors: - awsentity/service/emf: - entity_type: Service - platform: ec2 batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -238,7 +235,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index 04253829b9..cb9b62b5d7 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -105,9 +105,6 @@ processors: awsentity/resource: entity_type: Resource platform: ec2 - awsentity/service/emf: - entity_type: Service - platform: ec2 awsentity/service/telegraf: entity_type: Service platform: ec2 @@ -276,7 +273,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - udplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml index 5ee86838e1..6105f937bc 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -111,9 +111,6 @@ processors: awsentity/resource: entity_type: Resource platform: ec2 - awsentity/service/emf: - entity_type: Service - platform: ec2 awsentity/service/telegraf: entity_type: Service platform: ec2 @@ -383,7 +380,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - udplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/complete_windows_config.yaml b/translator/tocwconfig/sampleConfig/complete_windows_config.yaml index 0a7fb5c98f..e7fa12f152 100644 --- a/translator/tocwconfig/sampleConfig/complete_windows_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_windows_config.yaml @@ -105,9 +105,6 @@ processors: awsentity/resource: entity_type: Resource platform: ec2 - awsentity/service/emf: - entity_type: Service - platform: ec2 awsentity/service/telegraf: entity_type: Service platform: ec2 @@ -263,7 +260,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - udplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/config_with_env.yaml b/translator/tocwconfig/sampleConfig/config_with_env.yaml index 82dddd5788..40307cc324 100644 --- a/translator/tocwconfig/sampleConfig/config_with_env.yaml +++ b/translator/tocwconfig/sampleConfig/config_with_env.yaml @@ -50,9 +50,6 @@ extensions: mode: ec2 region: ${ENV_REGION} processors: - awsentity/service/emf: - entity_type: Service - platform: ec2 batch/emf_logs: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -95,7 +92,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml index 766c73e1fa..8a0d8fc3e2 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml @@ -411,9 +411,6 @@ extensions: region: us-east-1 shared_credential_file: /root/.aws/credentials processors: - awsentity/service/emf: - entity_type: Service - platform: onPremise batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -502,7 +499,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml index 961f1ea924..d70f0580c3 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml @@ -669,9 +669,6 @@ extensions: region: us-east-1 shared_credential_file: /root/.aws/credentials processors: - awsentity/service/emf: - entity_type: Service - platform: onPremise batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -1174,7 +1171,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml index 31d2db9286..f59e0a6639 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_kueue_config.yaml @@ -491,9 +491,6 @@ extensions: region: us-east-1 shared_credential_file: /root/.aws/credentials processors: - awsentity/service/emf: - entity_type: Service - platform: onPremise batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -591,7 +588,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml index 42ff679f8b..afc2bc77ed 100644 --- a/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/kueue_container_insights_config.yaml @@ -237,9 +237,6 @@ extensions: mode: ec2 region: us-east-1 processors: - awsentity/service/emf: - entity_type: Service - platform: ec2 batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -325,7 +322,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml index 0ff9a6b06d..46216e4031 100644 --- a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml @@ -405,9 +405,6 @@ extensions: mode: ec2 region: us-east-1 processors: - awsentity/service/emf: - entity_type: Service - platform: ec2 batch/containerinsights: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -494,7 +491,6 @@ service: exporters: - awscloudwatchlogs/emf_logs processors: - - awsentity/service/emf - batch/emf_logs receivers: - tcplog/emf_logs diff --git a/translator/translate/otel/pipeline/emf_logs/translator.go b/translator/translate/otel/pipeline/emf_logs/translator.go index 7172e6df98..c155b8176c 100644 --- a/translator/translate/otel/pipeline/emf_logs/translator.go +++ b/translator/translate/otel/pipeline/emf_logs/translator.go @@ -9,15 +9,12 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" - "github.com/aws/amazon-cloudwatch-agent/translator/context" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/exporter/awscloudwatchlogs" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" - "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/processor/awsentity" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/processor/batchprocessor" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/receiver/tcplog" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/receiver/udplog" - "github.com/aws/amazon-cloudwatch-agent/translator/util/ecsutil" ) var ( @@ -57,9 +54,6 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators agenthealth.NewTranslatorWithStatusCode(component.MustNewType("statuscode"), nil, true), ), } - if !(context.CurrentContext().RunInContainer() && ecsutil.GetECSUtilSingleton().IsECS()) { - translators.Processors.Set(awsentity.NewTranslatorWithEntityType(awsentity.Service, "emf", false)) - } if serviceAddress, ok := common.GetString(conf, serviceAddressEMFKey); ok { if strings.Contains(serviceAddress, common.Udp) { translators.Receivers.Set(udplog.NewTranslatorWithName(common.PipelineNameEmfLogs)) diff --git a/translator/translate/otel/pipeline/emf_logs/translator_test.go b/translator/translate/otel/pipeline/emf_logs/translator_test.go index 5ff0b97af3..2354ca057e 100644 --- a/translator/translate/otel/pipeline/emf_logs/translator_test.go +++ b/translator/translate/otel/pipeline/emf_logs/translator_test.go @@ -46,7 +46,7 @@ func TestTranslator(t *testing.T) { want: &want{ pipelineType: "logs/emf_logs", receivers: []string{"tcplog/emf_logs", "udplog/emf_logs"}, - processors: []string{"batch/emf_logs", "awsentity/service/emf"}, + processors: []string{"batch/emf_logs"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, @@ -62,7 +62,7 @@ func TestTranslator(t *testing.T) { want: &want{ pipelineType: "logs/emf_logs", receivers: []string{"tcplog/emf_logs", "udplog/emf_logs"}, - processors: []string{"batch/emf_logs", "awsentity/service/emf"}, + processors: []string{"batch/emf_logs"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, @@ -80,7 +80,7 @@ func TestTranslator(t *testing.T) { want: &want{ pipelineType: "logs/emf_logs", receivers: []string{"udplog/emf_logs"}, - processors: []string{"batch/emf_logs", "awsentity/service/emf"}, + processors: []string{"batch/emf_logs"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, @@ -98,7 +98,7 @@ func TestTranslator(t *testing.T) { want: &want{ pipelineType: "logs/emf_logs", receivers: []string{"tcplog/emf_logs"}, - processors: []string{"batch/emf_logs", "awsentity/service/emf"}, + processors: []string{"batch/emf_logs"}, exporters: []string{"awscloudwatchlogs/emf_logs"}, extensions: []string{"agenthealth/logs", "agenthealth/statuscode"}, }, From 20f6bb4af17ba648b0f74568795d11856309ab0c Mon Sep 17 00:00:00 2001 From: Musa Date: Tue, 7 Jan 2025 16:58:28 -0500 Subject: [PATCH 13/14] Bump golang.org/x/net from 0.27.0 to 0.33.0 (#1488) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d91df3986f..ba786a480b 100644 --- a/go.mod +++ b/go.mod @@ -197,7 +197,7 @@ require ( go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 - golang.org/x/net v0.27.0 + golang.org/x/net v0.33.0 golang.org/x/sync v0.10.0 golang.org/x/sys v0.28.0 golang.org/x/text v0.21.0 diff --git a/go.sum b/go.sum index 15601b6998..6f1f2023f0 100644 --- a/go.sum +++ b/go.sum @@ -1819,8 +1819,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= From da53e1c167e6c27561c64b1299e3b09d235806f8 Mon Sep 17 00:00:00 2001 From: "Mengyi Zhou (bjrara)" Date: Tue, 7 Jan 2025 22:05:33 -0800 Subject: [PATCH 14/14] Support Application Signals .NET runtime metrics exporting (#1471) Co-authored-by: Kaushik Surya <108111936+sky333999@users.noreply.github.com> --- .../metrichandlers/aggregation_mutator.go | 67 +++++ .../aggregation_mutator_test.go | 87 ++++++ .../pruner.go} | 10 +- .../pruner_test.go} | 8 +- .../awsapplicationsignals/processor.go | 24 +- .../appsignals_and_ecs_config.yaml | 258 ++++++++++++++++++ .../appsignals_and_eks_config.yaml | 258 ++++++++++++++++++ .../appsignals_and_k8s_config.yaml | 258 ++++++++++++++++++ .../appsignals_fallback_and_eks_config.yaml | 258 ++++++++++++++++++ .../appsignals_over_fallback_config.yaml | 258 ++++++++++++++++++ .../sampleConfig/base_appsignals_config.yaml | 258 ++++++++++++++++++ .../base_appsignals_fallback_config.yaml | 258 ++++++++++++++++++ .../appsignals_runtime_config.yaml | 118 ++++++++ 13 files changed, 2101 insertions(+), 19 deletions(-) create mode 100644 plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator.go create mode 100644 plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator_test.go rename plugins/processors/awsapplicationsignals/internal/{prune/metric_pruner.go => metrichandlers/pruner.go} (84%) rename plugins/processors/awsapplicationsignals/internal/{prune/metric_pruner_test.go => metrichandlers/pruner_test.go} (96%) diff --git a/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator.go b/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator.go new file mode 100644 index 0000000000..7580168e30 --- /dev/null +++ b/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator.go @@ -0,0 +1,67 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + +package metrichandlers + +import ( + "context" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +type aggregationType int + +const ( + defaultAggregation aggregationType = iota + lastValueAggregation +) + +// AggregationMutator is used to convert predefined ObservableUpDownCounter metrics to use LastValue metrichandlers. This +// is necessary for cases where metrics are instrumented as cumulative, yet reported with snapshot values. +// +// For example, metrics like DotNetGCGen0HeapSize may report values such as 1000, 2000, 1000, with cumulative temporality +// When exporters, such as the EMF exporter, detect these as cumulative, they convert the values to deltas, +// resulting in outputs like -, 1000, -1000, which misrepresent the data. +// +// Normally, this issue could be resolved by configuring a view with LastValue metrichandlers within the SDK. +// However, since the view feature is not fully supported in .NET, this workaround implements the required +// conversion to LastValue metrichandlers to ensure accurate metric reporting. +// See https://github.com/open-telemetry/opentelemetry-dotnet/issues/2618. +type AggregationMutator struct { + includes map[string]aggregationType +} + +func NewAggregationMutator() AggregationMutator { + return newAggregationMutatorWithConfig(map[string]aggregationType{ + "DotNetGCGen0HeapSize": lastValueAggregation, + "DotNetGCGen1HeapSize": lastValueAggregation, + "DotNetGCGen2HeapSize": lastValueAggregation, + "DotNetGCLOHHeapSize": lastValueAggregation, + "DotNetGCPOHHeapSize": lastValueAggregation, + "DotNetThreadCount": lastValueAggregation, + "DotNetThreadQueueLength": lastValueAggregation, + }) +} + +func newAggregationMutatorWithConfig(includes map[string]aggregationType) AggregationMutator { + return AggregationMutator{ + includes, + } +} + +func (t *AggregationMutator) ProcessMetrics(_ context.Context, m pmetric.Metric, _ pcommon.Map) { + aggType, exists := t.includes[m.Name()] + if !exists || aggType == defaultAggregation { + return + } + switch m.Type() { + case pmetric.MetricTypeSum: + switch aggType { + case lastValueAggregation: + m.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityDelta) + default: + } + default: + } +} diff --git a/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator_test.go b/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator_test.go new file mode 100644 index 0000000000..31f8f69cfa --- /dev/null +++ b/plugins/processors/awsapplicationsignals/internal/metrichandlers/aggregation_mutator_test.go @@ -0,0 +1,87 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + +package metrichandlers + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" +) + +func TestAggregationMutator_ProcessMetrics(t *testing.T) { + tests := []struct { + name string + config map[string]aggregationType + metrics []pmetric.Metric + expectedTemporality map[string]pmetric.AggregationTemporality + }{ + { + "testCumulativeToDelta", + map[string]aggregationType{ + "test0": lastValueAggregation, + }, + + []pmetric.Metric{ + generateMetricWithSumAggregation("test0", pmetric.AggregationTemporalityCumulative), + }, + map[string]pmetric.AggregationTemporality{ + "test0": pmetric.AggregationTemporalityDelta, + }, + }, + { + "testNoChange", + map[string]aggregationType{ + "test0": lastValueAggregation, + "test1": defaultAggregation, + }, + []pmetric.Metric{ + generateMetricWithSumAggregation("test0", pmetric.AggregationTemporalityDelta), + generateMetricWithSumAggregation("test1", pmetric.AggregationTemporalityCumulative), + generateMetricWithSumAggregation("test2", pmetric.AggregationTemporalityCumulative), + }, + map[string]pmetric.AggregationTemporality{ + "test0": pmetric.AggregationTemporalityDelta, + "test1": pmetric.AggregationTemporalityCumulative, + "test2": pmetric.AggregationTemporalityCumulative, + }, + }, + } + + ctx := context.Background() + for _, tt := range tests { + t.Run(tt.name, func(t1 *testing.T) { + mutator := newAggregationMutatorWithConfig(tt.config) + + for _, m := range tt.metrics { + mutator.ProcessMetrics(ctx, m, pcommon.NewMap()) + assert.Equal(t1, tt.expectedTemporality[m.Name()], m.Sum().AggregationTemporality()) + } + }) + } + + mutator := NewAggregationMutator() + + m := generateMetricWithSumAggregation("DotNetGCGen0HeapSize", pmetric.AggregationTemporalityCumulative) + mutator.ProcessMetrics(ctx, m, pcommon.NewMap()) + assert.Equal(t, pmetric.MetricTypeSum, m.Type()) + assert.Equal(t, pmetric.AggregationTemporalityDelta, m.Sum().AggregationTemporality()) + + m.SetEmptyHistogram() + m.Histogram().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative) + mutator.ProcessMetrics(ctx, m, pcommon.NewMap()) + assert.Equal(t, pmetric.MetricTypeHistogram, m.Type()) + assert.Equal(t, pmetric.AggregationTemporalityCumulative, m.Histogram().AggregationTemporality()) + +} + +func generateMetricWithSumAggregation(metricName string, temporality pmetric.AggregationTemporality) pmetric.Metric { + m := pmetric.NewMetrics().ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName(metricName) + m.SetEmptySum() + m.Sum().SetAggregationTemporality(temporality) + return m +} diff --git a/plugins/processors/awsapplicationsignals/internal/prune/metric_pruner.go b/plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner.go similarity index 84% rename from plugins/processors/awsapplicationsignals/internal/prune/metric_pruner.go rename to plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner.go index 31e5d5a048..acd342afc8 100644 --- a/plugins/processors/awsapplicationsignals/internal/prune/metric_pruner.go +++ b/plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner.go @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT -package prune +package metrichandlers import ( "errors" @@ -12,10 +12,10 @@ import ( "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/common" ) -type MetricPruner struct { +type Pruner struct { } -func (p *MetricPruner) ShouldBeDropped(attributes pcommon.Map) (bool, error) { +func (p *Pruner) ShouldBeDropped(attributes pcommon.Map) (bool, error) { for _, attributeKey := range common.CWMetricAttributes { if val, ok := attributes.Get(attributeKey); ok { if !isAsciiPrintable(val.Str()) { @@ -29,8 +29,8 @@ func (p *MetricPruner) ShouldBeDropped(attributes pcommon.Map) (bool, error) { return false, nil } -func NewPruner() *MetricPruner { - return &MetricPruner{} +func NewPruner() *Pruner { + return &Pruner{} } func isAsciiPrintable(val string) bool { diff --git a/plugins/processors/awsapplicationsignals/internal/prune/metric_pruner_test.go b/plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner_test.go similarity index 96% rename from plugins/processors/awsapplicationsignals/internal/prune/metric_pruner_test.go rename to plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner_test.go index 3f715b4e87..e88c6cd33d 100644 --- a/plugins/processors/awsapplicationsignals/internal/prune/metric_pruner_test.go +++ b/plugins/processors/awsapplicationsignals/internal/metrichandlers/pruner_test.go @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT -package prune +package metrichandlers import ( "testing" @@ -41,7 +41,7 @@ func TestMetricPrunerWithIndexableAttribute(t *testing.T) { }, } - p := &MetricPruner{} + p := &Pruner{} for _, tt := range tests { attributes := pcommon.NewMap() attributes.PutStr(common.MetricAttributeTelemetrySource, "UnitTest") @@ -72,7 +72,7 @@ func TestMetricPrunerWithNonIndexableAttribute(t *testing.T) { }, } - p := &MetricPruner{} + p := &Pruner{} for _, tt := range tests { attributes := pcommon.NewMap() attributes.PutStr(common.MetricAttributeTelemetrySource, "UnitTest") @@ -99,7 +99,7 @@ func TestMetricPrunerWithNoTelemetrySourceAttribute(t *testing.T) { }, } - p := &MetricPruner{} + p := &Pruner{} for _, tt := range tests { attributes := pcommon.NewMap() attributes.PutStr(common.AttributeEC2InstanceId, tt.val) diff --git a/plugins/processors/awsapplicationsignals/processor.go b/plugins/processors/awsapplicationsignals/processor.go index 784ee9dd96..adc85f6bcb 100644 --- a/plugins/processors/awsapplicationsignals/processor.go +++ b/plugins/processors/awsapplicationsignals/processor.go @@ -17,8 +17,8 @@ import ( appsignalsconfig "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/config" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/cardinalitycontrol" + "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/metrichandlers" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/normalizer" - "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/prune" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/internal/resolver" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/awsapplicationsignals/rules" ) @@ -44,14 +44,15 @@ type stopper interface { } type awsapplicationsignalsprocessor struct { - logger *zap.Logger - config *appsignalsconfig.Config - replaceActions *rules.ReplaceActions - allowlistMutators []allowListMutator - metricMutators []attributesMutator - traceMutators []attributesMutator - limiter cardinalitycontrol.Limiter - stoppers []stopper + logger *zap.Logger + config *appsignalsconfig.Config + replaceActions *rules.ReplaceActions + allowlistMutators []allowListMutator + metricMutators []attributesMutator + traceMutators []attributesMutator + limiter cardinalitycontrol.Limiter + aggregationMutator metrichandlers.AggregationMutator + stoppers []stopper } func (ap *awsapplicationsignalsprocessor) StartMetrics(ctx context.Context, _ component.Host) error { @@ -76,11 +77,13 @@ func (ap *awsapplicationsignalsprocessor) StartMetrics(ctx context.Context, _ co ap.replaceActions = rules.NewReplacer(ap.config.Rules, !limiterConfig.Disabled) - pruner := prune.NewPruner() + pruner := metrichandlers.NewPruner() keeper := rules.NewKeeper(ap.config.Rules, !limiterConfig.Disabled) dropper := rules.NewDropper(ap.config.Rules) ap.allowlistMutators = []allowListMutator{pruner, keeper, dropper} + ap.aggregationMutator = metrichandlers.NewAggregationMutator() + return nil } @@ -143,6 +146,7 @@ func (ap *awsapplicationsignalsprocessor) processMetrics(ctx context.Context, md m.SetName(metricCaser.String(m.Name())) // Ensure metric name is in sentence case } ap.processMetricAttributes(ctx, m, resourceAttributes) + ap.aggregationMutator.ProcessMetrics(ctx, m, resourceAttributes) } } } diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml index 8ecedac6e1..ac1ea7b86e 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml @@ -780,6 +780,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml index e8ce5d1bc7..26ee65ff2b 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml @@ -908,6 +908,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index bdca9dc8c9..bdb8069db5 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml @@ -909,6 +909,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index e8ce5d1bc7..26ee65ff2b 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -908,6 +908,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index e8ce5d1bc7..26ee65ff2b 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -908,6 +908,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index a9e969978a..2c5d844ff3 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -789,6 +789,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index a1e35f125c..cf91c88e64 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -785,6 +785,264 @@ processors: new_label: Telemetry.Source new_value: RuntimeMetric submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen0Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen1Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.collections.count + match_type: "" + new_name: DotNetGCGen2Count + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.gc.duration + match_type: "" + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen0 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen0HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen1 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen1HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: gen2 + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCGen2HeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: loh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCLOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: insert + aggregation_type: "" + experimental_match_labels: + generation: poh + include: process.runtime.dotnet.gc.heap.size + match_type: "" + new_name: DotNetGCPOHHeapSize + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.threads.count + match_type: "" + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" + - action: update + aggregation_type: "" + include: process.runtime.dotnet.thread_pool.queue.length + match_type: "" + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + aggregation_type: sum + experimental_scale: 0 + label: "" + label_set: [] + label_value: "" + new_label: "" + new_value: "" + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Telemetry.Source + new_value: RuntimeMetric + submatch_case: "" resourcedetection: aks: resource_attributes: diff --git a/translator/translate/otel/processor/metricstransformprocessor/appsignals_runtime_config.yaml b/translator/translate/otel/processor/metricstransformprocessor/appsignals_runtime_config.yaml index 80812fdcf3..1f74eee608 100644 --- a/translator/translate/otel/processor/metricstransformprocessor/appsignals_runtime_config.yaml +++ b/translator/translate/otel/processor/metricstransformprocessor/appsignals_runtime_config.yaml @@ -277,3 +277,121 @@ transforms: - action: add_label new_label: Telemetry.Source new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.collections.count + action: insert + new_name: DotNetGCGen0Count + experimental_match_labels: {"generation": "gen0"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.collections.count + action: insert + new_name: DotNetGCGen1Count + experimental_match_labels: {"generation": "gen1"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.collections.count + action: insert + new_name: DotNetGCGen2Count + experimental_match_labels: {"generation": "gen2"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.duration + action: update + new_name: DotNetGCDuration + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCGen0HeapSize + experimental_match_labels: {"generation": "gen0"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCGen1HeapSize + experimental_match_labels: {"generation": "gen1"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCGen2HeapSize + experimental_match_labels: {"generation": "gen2"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCLOHHeapSize + experimental_match_labels: {"generation": "loh"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.gc.heap.size + action: insert + new_name: DotNetGCPOHHeapSize + experimental_match_labels: {"generation": "poh"} + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.thread_pool.threads.count + action: update + new_name: DotNetThreadCount + operations: + - action: aggregate_labels + label_set: [] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric + - include: process.runtime.dotnet.thread_pool.queue.length + action: update + new_name: DotNetThreadQueueLength + operations: + - action: aggregate_labels + label_set: [ ] + aggregation_type: sum + - action: add_label + new_label: Telemetry.Source + new_value: RuntimeMetric