From 2348639577cfe71171497433ae3f11fadd9d93e4 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 12 Nov 2024 15:44:33 -0500 Subject: [PATCH 01/91] fixing issue --- extension/agenthealth/config.go | 5 +- extension/agenthealth/extension.go | 26 +++- .../agenthealth/handler/stats/agent/agent.go | 62 ++++++-- .../agenthealth/handler/stats/handler.go | 60 ++++++-- .../handler/stats/provider/statuscode.go | 132 ++++++++++++++++++ plugins/processors/ec2tagger/config.go | 2 + plugins/processors/ec2tagger/ec2tagger.go | 65 +++++++-- plugins/processors/ec2tagger/factory.go | 9 +- .../otel/extension/agenthealth/translator.go | 13 +- .../otel/pipeline/host/translator.go | 1 + 10 files changed, 325 insertions(+), 50 deletions(-) create mode 100644 extension/agenthealth/handler/stats/provider/statuscode.go diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index dd1f94c06c..aa8e642e76 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"` + StatusCode agent.StatusCodeConfig `mapstructure:"status_code"` //not sure if this supposed to be a different name?????? } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 14ab08eb57..ea0216418b 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -22,13 +22,37 @@ type agentHealth struct { var _ awsmiddleware.Extension = (*agentHealth)(nil) func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { + // Initialize handlers var responseHandlers []awsmiddleware.ResponseHandler requestHandlers := []awsmiddleware.RequestHandler{useragent.NewHandler(ah.cfg.IsUsageDataEnabled)} + + // Log the initialization + ah.logger.Debug("Initialized default request handler with user agent handler") + if ah.cfg.IsUsageDataEnabled { - req, res := stats.NewHandlers(ah.logger, ah.cfg.Stats) + // Log usage data configuration + ah.logger.Debug("Usage data is enabled, creating stats handlers") + + // Create stats handlers + req, res := stats.NewHandlers(ah.logger, ah.cfg.Stats, true) + + // Add stats handlers + ah.logger.Debug("Appending request handlers", zap.Int("count", len(req))) requestHandlers = append(requestHandlers, req...) + + ah.logger.Debug("Appending response handlers", zap.Int("count", len(res))) responseHandlers = append(responseHandlers, res...) + } else { + // Log usage data configuration is disabled + ah.logger.Debug("Usage data is disabled, skipping stats handlers") } + + // Log final handlers + ah.logger.Debug("Handlers created", + zap.Int("requestHandlersCount", len(requestHandlers)), + zap.Int("responseHandlersCount", len(responseHandlers)), + ) + return requestHandlers, responseHandlers } diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 83237d54e6..1d1ecc7b87 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -15,21 +15,22 @@ 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][2]int `json:"codes,omitempty"` } // Merge the other Stats into the current. If the field is not nil, @@ -80,6 +81,20 @@ 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][2]int) + } + for key, value := range other.StatusCodes { + if existing, ok := s.StatusCodes[key]; ok { + // Merge the existing value with the new one + s.StatusCodes[key] = [2]int{existing[0] + value[0], existing[1] + value[1]} + } else { + // Add the new value if the key doesn't exist + s.StatusCodes[key] = value + } + } + } } func (s *Stats) Marshal() (string, error) { @@ -118,3 +133,20 @@ type StatsConfig struct { // UsageFlags are the usage flags to set on start up. UsageFlags map[Flag]any `mapstructure:"usage_flags,omitempty"` } + +type StatusCodeConfig struct { + // Operations are the allowed operation names to gather stats for. + Operations []string `json:"operations,omitempty"` + + // AllowedStatusCodes are the allowed status codes to gather stats for. + AllowedStatusCodes []int `json:"allowedStatusCodes,omitempty"` +} + +// NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. +func NewStatusCodeOperationsFilter(cfg StatusCodeConfig) OperationsFilter { + allowed := collections.NewSet[string](cfg.Operations...) + return OperationsFilter{ + operations: allowed, + allowAll: allowed.Contains(AllowAllOperations), + } +} diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 7e12f12b5c..bfcbe59772 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -21,12 +21,54 @@ 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()}) - agent.UsageFlags().SetValues(cfg.UsageFlags) - return []awsmiddleware.RequestHandler{stats, clientStats}, []awsmiddleware.ResponseHandler{clientStats} +func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { + if statsB { + logger.Debug("Stats are enabled, creating handlers") + + // Create the operations filter + filter := agent.NewOperationsFilter(cfg.Operations...) + logger.Debug("Operations filter created", zap.Strings("operations", cfg.Operations)) + + // Create client stats handler + clientStats := client.NewHandler(filter) + logger.Debug("Client stats handler created") + + // Get status code stats + statusCodeStats := provider.GetStatusCodeStats() + logger.Debug("Status code stats handler retrieved") + + // Create stats handler + stats := newStatsHandler(logger, filter, []agent.StatsProvider{ + clientStats, + provider.GetProcessStats(), + provider.GetFlagsStats(), + statusCodeStats, + }) + logger.Debug("Stats handler created with providers") + + // Set usage flags + agent.UsageFlags().SetValues(cfg.UsageFlags) + + // Return handlers + logger.Debug("Returning request and response handlers", + zap.Int("requestHandlerCount", 2), + zap.Int("responseHandlerCount", 1), + ) + return []awsmiddleware.RequestHandler{stats, clientStats}, []awsmiddleware.ResponseHandler{statusCodeStats} + } else { + logger.Debug("Stats are disabled, creating only status code stats handler") + + // Get status code stats + statusCodeStats := provider.GetStatusCodeStats() + logger.Debug("Status code stats handler retrieved") + + // Return empty request handlers and response handlers with status code stats + logger.Debug("Returning handlers", + zap.Int("requestHandlerCount", 0), + zap.Int("responseHandlerCount", 1), + ) + return []awsmiddleware.RequestHandler{}, []awsmiddleware.ResponseHandler{statusCodeStats} + } } type statsHandler struct { @@ -58,9 +100,9 @@ func (sh *statsHandler) Position() awsmiddleware.HandlerPosition { func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { operation := awsmiddleware.GetOperationName(ctx) - if !sh.filter.IsAllowed(operation) { - return - } + //if !sh.filter.IsAllowed(operation) { + // return + //} header := sh.Header(operation) if header != "" { r.Header.Set(headerKeyAgentStats, header) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go new file mode 100644 index 0000000000..677471241f --- /dev/null +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -0,0 +1,132 @@ +package provider + +import ( + "context" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "log" + "net/http" + "sync" + "time" + + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" +) + +const ( + statusResetInterval = 5 * time.Minute + statusHandlerID = "cloudwatchagent.StatusCodeHandler" +) + +var ( + statusCodeSingleton *StatusCodeHandler + statusCodeStatsOnce sync.Once +) + +// StatusCodeHandler provides monitoring for status codes per operation. +type StatusCodeHandler struct { + statsByOperation sync.Map + mu sync.Mutex + resetTimer *time.Timer +} + +// GetStatusCodeStats retrieves or initializes the singleton StatusCodeHandler. +func GetStatusCodeStats() *StatusCodeHandler { + statusCodeStatsOnce.Do(func() { + handler := &StatusCodeHandler{} + handler.startResetTimer() + statusCodeSingleton = handler + }) + return statusCodeSingleton +} + +// startResetTimer initializes a reset timer to clear stats every 5 minutes. +func (h *StatusCodeHandler) startResetTimer() { + h.resetTimer = time.AfterFunc(statusResetInterval, func() { + h.mu.Lock() + defer h.mu.Unlock() + + h.statsByOperation.Range(func(key, _ interface{}) bool { + h.statsByOperation.Delete(key) + return true + }) + log.Println("Status code stats reset.") + h.startResetTimer() + }) +} + +// HandleRequest is a no-op for the StatusCodeHandler. +func (h *StatusCodeHandler) HandleRequest(ctx context.Context, _ *http.Request) {} + +// HandleResponse processes the HTTP response to update status code stats. +func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { + // Extract the operation name + operation := awsmiddleware.GetOperationName(ctx) + if operation == "" { + log.Println("No operation name found in the context") + } else { + log.Printf("Processing response for operation: %s", operation) + } + + // Extract the status code + statusCode := r.StatusCode + log.Printf("Received status code: %d for operation: %s", statusCode, operation) + + h.mu.Lock() + defer h.mu.Unlock() + + // Load or initialize stats for the operation + value, loaded := h.statsByOperation.LoadOrStore(operation, &[2]int{}) + if !loaded { + log.Printf("Initializing stats for operation: %s", operation) + } + stats := value.(*[2]int) + + // Update success or failure count + if statusCode >= 200 && statusCode < 300 { + stats[0]++ + log.Printf("Incremented success count for operation: %s. New Success=%d", operation, stats[0]) + } else { + stats[1]++ + log.Printf("Incremented failure count for operation: %s. New Failures=%d", operation, stats[1]) + } + + // Store updated stats back in the map + h.statsByOperation.Store(operation, stats) + log.Printf("Updated stats for operation '%s': Success=%d, Failures=%d", operation, stats[0], stats[1]) +} + +// GetStats retrieves the success and failure counts for a specific operation. +func (h *StatusCodeHandler) GetStats(operation string) (successCount, failureCount int) { + value, ok := h.statsByOperation.Load(operation) + if !ok { + return 0, 0 + } + stats := value.(*[2]int) + return stats[0], stats[1] +} + +// ID returns the unique identifier for the handler. +func (h *StatusCodeHandler) ID() string { + return statusHandlerID +} + +// Position specifies the handler's position in the middleware chain. +func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { + return awsmiddleware.After +} + +// Stats implements the `Stats` method required by the `agent.StatsProvider` interface. +func (h *StatusCodeHandler) Stats(operation string) agent.Stats { + value, ok := h.statsByOperation.Load(operation) + if !ok { + return agent.Stats{ + StatusCodes: map[string][2]int{}, + } + } + + stats := value.(*[2]int) + return agent.Stats{ + StatusCodes: map[string][2]int{ + operation: {stats[0], stats[1]}, + }, + } +} 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..367a522e83 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -5,7 +5,10 @@ package ec2tagger import ( "context" + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" "hash/fnv" + "log" "os" "sync" "time" @@ -19,7 +22,6 @@ import ( "go.uber.org/zap" configaws "github.com/aws/amazon-cloudwatch-agent/cfg/aws" - "github.com/aws/amazon-cloudwatch-agent/internal/ec2metadataprovider" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/ec2tagger/internal/volume" translatorCtx "github.com/aws/amazon-cloudwatch-agent/translator/context" ) @@ -44,7 +46,7 @@ type Tagger struct { logger *zap.Logger cancelFunc context.CancelFunc - metadataProvider ec2metadataprovider.MetadataProvider + metadataProvider MetadataProvider ec2Provider ec2ProviderType shutdownC chan bool @@ -64,11 +66,13 @@ func newTagger(config *Config, logger *zap.Logger) *Tagger { _, cancel := context.WithCancel(context.Background()) mdCredentialConfig := &configaws.CredentialConfig{} + config.MiddlewareID = &agenthealth.StatusCodeID + p := &Tagger{ Config: config, logger: logger, cancelFunc: cancel, - metadataProvider: ec2metadataprovider.NewMetadataProvider(mdCredentialConfig.Credentials(), config.IMDSRetries), + metadataProvider: NewMetadataProvider(mdCredentialConfig.Credentials(), config.IMDSRetries), ec2Provider: func(ec2CredentialConfig *configaws.CredentialConfig) ec2iface.EC2API { return ec2.New( ec2CredentialConfig.Credentials(), @@ -173,7 +177,7 @@ func (t *Tagger) updateTags() error { } for _, tag := range result.Tags { key := *tag.Key - if Ec2InstanceTagKeyASG == key { + if ec2InstanceTagKeyASG == key { // rename to match CW dimension as applied by AutoScaling service, not the EC2 tag key = cwDimensionASG } @@ -247,7 +251,7 @@ func (t *Tagger) ec2TagsRetrieved() bool { defer t.RUnlock() if t.ec2TagCache != nil { for _, key := range t.EC2InstanceTagKeys { - if key == Ec2InstanceTagKeyASG { + if key == ec2InstanceTagKeyASG { key = cwDimensionASG } if key == "*" { @@ -280,14 +284,25 @@ 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.logger.Debug("ec2tagger: Starting the EC2 tagger.") + log.Printf("start function called with host: %s\n", host) + t.shutdownC = make(chan bool) t.ec2TagCache = map[string]string{} + // Derive EC2 Metadata + t.logger.Debug("ec2tagger: Deriving EC2 metadata from IMDS.") if err := t.deriveEC2MetadataFromIMDS(ctx); err != nil { + t.logger.Error("ec2tagger: Failed to derive EC2 metadata from IMDS.", zap.Error(err)) return err } + t.logger.Debug("ec2tagger: Successfully derived EC2 metadata from IMDS.", + zap.String("instanceId", t.ec2MetadataRespond.instanceId), + zap.String("region", t.ec2MetadataRespond.region)) + // Set up tag filters + t.logger.Debug("ec2tagger: Setting up tag filters.") t.tagFilters = []*ec2.Filter{ { Name: aws.String("resource-type"), @@ -300,13 +315,14 @@ func (t *Tagger) Start(ctx context.Context, _ component.Host) error { } 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' + t.logger.Debug("ec2tagger: Processing specified EC2InstanceTagKeys.", + zap.Strings("keys", t.EC2InstanceTagKeys)) + for i, key := range t.EC2InstanceTagKeys { if cwDimensionASG == key { - t.EC2InstanceTagKeys[i] = Ec2InstanceTagKeyASG + t.logger.Debug("ec2tagger: Replacing 'AutoScalingGroupName' with the correct EC2 tag name.") + t.EC2InstanceTagKeys[i] = ec2InstanceTagKeyASG } } @@ -317,6 +333,10 @@ func (t *Tagger) Start(ctx context.Context, _ component.Host) error { } if len(t.EC2InstanceTagKeys) > 0 || len(t.EBSDeviceKeys) > 0 { + t.logger.Debug("ec2tagger: Configuring EC2 API client.", + zap.String("region", t.ec2MetadataRespond.region), + zap.String("roleARN", t.RoleARN)) + ec2CredentialConfig := &configaws.CredentialConfig{ AccessKey: t.AccessKey, SecretKey: t.SecretKey, @@ -327,16 +347,33 @@ func (t *Tagger) Start(ctx context.Context, _ component.Host) error { Region: t.ec2MetadataRespond.region, } t.ec2API = t.ec2Provider(ec2CredentialConfig) - go func() { //Async start of initial retrieval to prevent block of agent start + + if ec2Client, ok := t.ec2API.(*ec2.EC2); ok { + if t.Config.MiddlewareID == nil { + TypeStr, _ = component.NewType("agenthealth") + defaultMiddlewareID := component.NewIDWithName(TypeStr, component.DataTypeMetrics.String()) + t.Config.MiddlewareID = &defaultMiddlewareID + t.logger.Debug("ec2tagger: MiddlewareID was nil, initialized to default value.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) + } + + t.logger.Debug("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) + awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) + } + + go func() { + t.logger.Info("ec2tagger: Starting initial retrieval of tags and volumes.") t.initialRetrievalOfTagsAndVolumes() + t.logger.Info("ec2tagger: Starting refresh loop to update tags and volumes.") t.refreshLoopToUpdateTagsAndVolumes() }() t.logger.Info("ec2tagger: EC2 tagger has started initialization.") } else { + t.logger.Info("ec2tagger: No EC2 instance or EBS device keys specified. Skipping tagger initialization.") t.setStarted() } + t.logger.Debug("ec2tagger: EC2 tagger has started successfully.") return nil } @@ -443,10 +480,10 @@ func (t *Tagger) initialRetrievalOfTagsAndVolumes() { retry := 0 for { var waitDuration time.Duration - if retry < len(BackoffSleepArray) { - waitDuration = BackoffSleepArray[retry] + if retry < len(backoffSleepArray) { + waitDuration = backoffSleepArray[retry] } else { - waitDuration = BackoffSleepArray[len(BackoffSleepArray)-1] + waitDuration = backoffSleepArray[len(backoffSleepArray)-1] } wait := time.NewTimer(waitDuration) diff --git a/plugins/processors/ec2tagger/factory.go b/plugins/processors/ec2tagger/factory.go index 72b5576b9d..1bfa955de7 100644 --- a/plugins/processors/ec2tagger/factory.go +++ b/plugins/processors/ec2tagger/factory.go @@ -44,11 +44,14 @@ func createMetricsProcessor( return nil, fmt.Errorf("configuration parsing error") } + // Now passing host to newTagger metricsProcessor := newTagger(processorConfig, set.Logger) - return processorhelper.NewMetricsProcessor(ctx, set, cfg, nextConsumer, + return processorhelper.NewMetricsProcessor( + ctx, set, cfg, nextConsumer, metricsProcessor.processMetrics, processorhelper.WithCapabilities(processorCapabilities), - processorhelper.WithStart(metricsProcessor.Start), - processorhelper.WithShutdown(metricsProcessor.Shutdown)) + processorhelper.WithStart(metricsProcessor.Start), // Use the Start method of metricsProcessor + processorhelper.WithShutdown(metricsProcessor.Shutdown), + ) } diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index ef39f9390c..65ac3dc71c 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 { @@ -56,9 +57,9 @@ func (t *translator) ID() component.ID { func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg := t.factory.CreateDefaultConfig().(*agenthealth.Config) cfg.IsUsageDataEnabled = t.isUsageDataEnabled - if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok { - cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData - } + //if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok { + // cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData + //} // for now we will comment this ??????? cfg.Stats = agent.StatsConfig{ Operations: t.operations, UsageFlags: map[agent.Flag]any{ diff --git a/translator/translate/otel/pipeline/host/translator.go b/translator/translate/otel/pipeline/host/translator.go index 641ed43e93..17793b23da 100644 --- a/translator/translate/otel/pipeline/host/translator.go +++ b/translator/translate/otel/pipeline/host/translator.go @@ -90,6 +90,7 @@ func (t translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators, if t.Destination() != common.CloudWatchLogsKey { if conf.IsSet(common.ConfigKey(common.MetricsKey, common.AppendDimensionsKey)) { log.Printf("D! ec2tagger processor required because append_dimensions is set") + translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeMetrics, []string{"*"})) //not sure if we need to change this?????? translators.Processors.Set(ec2taggerprocessor.NewTranslator()) } From b7fac5ed1514c1ef63f125b0d61ccca0cb8dfcd1 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 12 Nov 2024 16:01:55 -0500 Subject: [PATCH 02/91] trying to fix logs --- extension/agenthealth/handler/stats/handler.go | 4 ++-- translator/translate/otel/extension/agenthealth/translator.go | 2 +- translator/translate/otel/pipeline/host/translator.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index bfcbe59772..3b1e606ac6 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -54,7 +54,7 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsm zap.Int("requestHandlerCount", 2), zap.Int("responseHandlerCount", 1), ) - return []awsmiddleware.RequestHandler{stats, clientStats}, []awsmiddleware.ResponseHandler{statusCodeStats} + return []awsmiddleware.RequestHandler{stats, clientStats, statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } else { logger.Debug("Stats are disabled, creating only status code stats handler") @@ -67,7 +67,7 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsm zap.Int("requestHandlerCount", 0), zap.Int("responseHandlerCount", 1), ) - return []awsmiddleware.RequestHandler{}, []awsmiddleware.ResponseHandler{statusCodeStats} + return []awsmiddleware.RequestHandler{statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } } diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 65ac3dc71c..7720a8c54a 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -59,7 +59,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg.IsUsageDataEnabled = t.isUsageDataEnabled //if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok { // cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData - //} // for now we will comment this ??????? + //} // for now we will comment this ???????c cfg.Stats = agent.StatsConfig{ Operations: t.operations, UsageFlags: map[agent.Flag]any{ diff --git a/translator/translate/otel/pipeline/host/translator.go b/translator/translate/otel/pipeline/host/translator.go index 17793b23da..796662806a 100644 --- a/translator/translate/otel/pipeline/host/translator.go +++ b/translator/translate/otel/pipeline/host/translator.go @@ -104,7 +104,7 @@ func (t translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators, switch t.Destination() { case common.DefaultDestination, common.CloudWatchKey: translators.Exporters.Set(awscloudwatch.NewTranslator()) - translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeMetrics, []string{agenthealth.OperationPutMetricData})) + translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeMetrics, []string{"*"})) case common.AMPKey: if conf.IsSet(common.MetricsAggregationDimensionsKey) { translators.Processors.Set(rollupprocessor.NewTranslator()) @@ -115,7 +115,7 @@ func (t translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators, case common.CloudWatchLogsKey: 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.NewTranslator(component.DataTypeLogs, []string{"*"})) default: return nil, fmt.Errorf("pipeline (%s) does not support destination (%s) in configuration", t.name, t.Destination()) } From 45536b804df279343fd6464bcf447cea5b2ddf62 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 12 Nov 2024 17:38:58 -0500 Subject: [PATCH 03/91] fixing issue --- plugins/processors/ec2tagger/ec2tagger.go | 20 ++++----- .../sampleConfig/advanced_config_linux.json | 45 ++++++++++++------- .../sampleConfig/complete_linux_config.json | 10 ++--- 3 files changed, 42 insertions(+), 33 deletions(-) diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 367a522e83..87051537d9 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -6,7 +6,6 @@ package ec2tagger import ( "context" "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" - "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" "hash/fnv" "log" "os" @@ -22,6 +21,7 @@ import ( "go.uber.org/zap" configaws "github.com/aws/amazon-cloudwatch-agent/cfg/aws" + "github.com/aws/amazon-cloudwatch-agent/internal/ec2metadataprovider" "github.com/aws/amazon-cloudwatch-agent/plugins/processors/ec2tagger/internal/volume" translatorCtx "github.com/aws/amazon-cloudwatch-agent/translator/context" ) @@ -46,7 +46,7 @@ type Tagger struct { logger *zap.Logger cancelFunc context.CancelFunc - metadataProvider MetadataProvider + metadataProvider ec2metadataprovider.MetadataProvider ec2Provider ec2ProviderType shutdownC chan bool @@ -66,13 +66,11 @@ func newTagger(config *Config, logger *zap.Logger) *Tagger { _, cancel := context.WithCancel(context.Background()) mdCredentialConfig := &configaws.CredentialConfig{} - config.MiddlewareID = &agenthealth.StatusCodeID - p := &Tagger{ Config: config, logger: logger, cancelFunc: cancel, - metadataProvider: NewMetadataProvider(mdCredentialConfig.Credentials(), config.IMDSRetries), + metadataProvider: ec2metadataprovider.NewMetadataProvider(mdCredentialConfig.Credentials(), config.IMDSRetries), ec2Provider: func(ec2CredentialConfig *configaws.CredentialConfig) ec2iface.EC2API { return ec2.New( ec2CredentialConfig.Credentials(), @@ -177,7 +175,7 @@ func (t *Tagger) updateTags() error { } for _, tag := range result.Tags { key := *tag.Key - if ec2InstanceTagKeyASG == key { + if Ec2InstanceTagKeyASG == key { // rename to match CW dimension as applied by AutoScaling service, not the EC2 tag key = cwDimensionASG } @@ -251,7 +249,7 @@ func (t *Tagger) ec2TagsRetrieved() bool { defer t.RUnlock() if t.ec2TagCache != nil { for _, key := range t.EC2InstanceTagKeys { - if key == ec2InstanceTagKeyASG { + if key == Ec2InstanceTagKeyASG { key = cwDimensionASG } if key == "*" { @@ -322,7 +320,7 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { for i, key := range t.EC2InstanceTagKeys { if cwDimensionASG == key { t.logger.Debug("ec2tagger: Replacing 'AutoScalingGroupName' with the correct EC2 tag name.") - t.EC2InstanceTagKeys[i] = ec2InstanceTagKeyASG + t.EC2InstanceTagKeys[i] = Ec2InstanceTagKeyASG } } @@ -480,10 +478,10 @@ func (t *Tagger) initialRetrievalOfTagsAndVolumes() { retry := 0 for { var waitDuration time.Duration - if retry < len(backoffSleepArray) { - waitDuration = backoffSleepArray[retry] + if retry < len(BackoffSleepArray) { + waitDuration = BackoffSleepArray[retry] } else { - waitDuration = backoffSleepArray[len(backoffSleepArray)-1] + waitDuration = BackoffSleepArray[len(BackoffSleepArray)-1] } wait := time.NewTimer(waitDuration) diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.json b/translator/tocwconfig/sampleConfig/advanced_config_linux.json index 87d7d3003c..bb70dd5c72 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.json +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.json @@ -1,4 +1,9 @@ { + "agent": { + "debug": true, + "aws_sdk_log_level": "LogDebugWithHTTPBody", + "region": "us-west-2" + }, "metrics": { "append_dimensions": { "AutoScalingGroupName": "${aws:AutoScalingGroupName}", @@ -14,7 +19,8 @@ "cpu_usage_user", "cpu_usage_system" ], - "totalcpu": false + "totalcpu": false, + "metrics_collection_interval": 10 }, "disk": { "resources": [ @@ -23,7 +29,8 @@ "measurement": [ "used_percent", "inodes_free" - ] + ], + "metrics_collection_interval": 60 }, "diskio": { "resources": [ @@ -35,23 +42,27 @@ "read_bytes", "writes", "reads" - ] + ], + "metrics_collection_interval": 60 }, "mem": { "measurement": [ "mem_used_percent" - ] + ], + "metrics_collection_interval": 10 }, "netstat": { "measurement": [ "tcp_established", "tcp_time_wait" - ] + ], + "metrics_collection_interval": 60 }, "swap": { "measurement": [ "swap_used_percent" - ] + ], + "metrics_collection_interval": 10 }, "ethtool": { "interface_include": [ @@ -65,15 +76,19 @@ "conntrack_allowance_exceeded", "linklocal_allowance_exceeded" ] - }, - "nvidia_gpu": { - "measurement": [ - "utilization_gpu", - "utilization_memory", - "power_draw", - "temperature_gpu" - ], - "metrics_collection_interval": 60 + } + } + }, + "logs": { + "logs_collected": { + "files": { + "collect_list": [ + { + "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log", + "log_group_name": "StatusCode", + "log_stream_name": "agent-1" + } + ] } } } diff --git a/translator/tocwconfig/sampleConfig/complete_linux_config.json b/translator/tocwconfig/sampleConfig/complete_linux_config.json index c2fb70e151..39130d073a 100755 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.json +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.json @@ -5,7 +5,7 @@ "internal": true, "debug": true, "quiet": true, - "aws_sdk_log_level": "LogDebug", + "aws_sdk_log_level": "LogDebugWithHTTPBody", "user_agent": "CUSTOM USER AGENT VALUE", "credentials": { "role_arn": "global_role_arn_value" @@ -14,10 +14,6 @@ "omit_hostname": true }, "metrics": { - "metrics_destinations": { - "cloudwatch": { - } - }, "metrics_collected": { "jmx": [ { @@ -255,8 +251,8 @@ "collect_list": [ { "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log", - "log_group_name": "amazon-cloudwatch-agent.log", - "log_stream_name": "amazon-cloudwatch-agent.log", + "log_group_name": "/aws/amazon-cloudwatch-agent", + "log_stream_name": "agent-1", "timezone": "UTC", "retention_in_days": 5 }, From 75b024a813e0e788a5819a32d60a77affdea3144 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 11:52:28 -0500 Subject: [PATCH 04/91] adding debug statements (swapping logger with log.print) --- .../agenthealth/handler/stats/handler.go | 25 ++++++--------- plugins/processors/ec2tagger/ec2tagger.go | 32 +++++++++++++------ 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 3b1e606ac6..f27cafff48 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -5,6 +5,7 @@ package stats import ( "context" + "log" "net/http" "sync" @@ -23,19 +24,19 @@ const ( func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { if statsB { - logger.Debug("Stats are enabled, creating handlers") + log.Println("Stats are enabled, creating handlers") // Create the operations filter filter := agent.NewOperationsFilter(cfg.Operations...) - logger.Debug("Operations filter created", zap.Strings("operations", cfg.Operations)) + log.Println("Operations filter created, operations:", cfg.Operations) // Create client stats handler clientStats := client.NewHandler(filter) - logger.Debug("Client stats handler created") + log.Println("Client stats handler created") // Get status code stats statusCodeStats := provider.GetStatusCodeStats() - logger.Debug("Status code stats handler retrieved") + log.Println("Status code stats handler retrieved") // Create stats handler stats := newStatsHandler(logger, filter, []agent.StatsProvider{ @@ -44,29 +45,23 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsm provider.GetFlagsStats(), statusCodeStats, }) - logger.Debug("Stats handler created with providers") + log.Println("Stats handler created with providers") // Set usage flags agent.UsageFlags().SetValues(cfg.UsageFlags) // Return handlers - logger.Debug("Returning request and response handlers", - zap.Int("requestHandlerCount", 2), - zap.Int("responseHandlerCount", 1), - ) + log.Println("Returning request and response handlers, requestHandlerCount: 2, responseHandlerCount: 1") return []awsmiddleware.RequestHandler{stats, clientStats, statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } else { - logger.Debug("Stats are disabled, creating only status code stats handler") + log.Println("Stats are disabled, creating only status code stats handler") // Get status code stats statusCodeStats := provider.GetStatusCodeStats() - logger.Debug("Status code stats handler retrieved") + log.Println("Status code stats handler retrieved") // Return empty request handlers and response handlers with status code stats - logger.Debug("Returning handlers", - zap.Int("requestHandlerCount", 0), - zap.Int("responseHandlerCount", 1), - ) + log.Println("Returning handlers, requestHandlerCount: 0, responseHandlerCount: 1") return []awsmiddleware.RequestHandler{statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } } diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 87051537d9..0618c027cd 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -283,24 +283,24 @@ 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, host component.Host) error { - t.logger.Debug("ec2tagger: Starting the EC2 tagger.") + t.logger.Info("ec2tagger: Starting the EC2 tagger.") log.Printf("start function called with host: %s\n", host) t.shutdownC = make(chan bool) t.ec2TagCache = map[string]string{} // Derive EC2 Metadata - t.logger.Debug("ec2tagger: Deriving EC2 metadata from IMDS.") + t.logger.Info("ec2tagger: Deriving EC2 metadata from IMDS.") if err := t.deriveEC2MetadataFromIMDS(ctx); err != nil { t.logger.Error("ec2tagger: Failed to derive EC2 metadata from IMDS.", zap.Error(err)) return err } - t.logger.Debug("ec2tagger: Successfully derived EC2 metadata from IMDS.", + t.logger.Info("ec2tagger: Successfully derived EC2 metadata from IMDS.", zap.String("instanceId", t.ec2MetadataRespond.instanceId), zap.String("region", t.ec2MetadataRespond.region)) // Set up tag filters - t.logger.Debug("ec2tagger: Setting up tag filters.") + t.logger.Info("ec2tagger: Setting up tag filters.") t.tagFilters = []*ec2.Filter{ { Name: aws.String("resource-type"), @@ -314,12 +314,12 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { useAllTags := len(t.EC2InstanceTagKeys) == 1 && t.EC2InstanceTagKeys[0] == "*" if !useAllTags && len(t.EC2InstanceTagKeys) > 0 { - t.logger.Debug("ec2tagger: Processing specified EC2InstanceTagKeys.", + t.logger.Info("ec2tagger: Processing specified EC2InstanceTagKeys.", zap.Strings("keys", t.EC2InstanceTagKeys)) for i, key := range t.EC2InstanceTagKeys { if cwDimensionASG == key { - t.logger.Debug("ec2tagger: Replacing 'AutoScalingGroupName' with the correct EC2 tag name.") + t.logger.Info("ec2tagger: Replacing 'AutoScalingGroupName' with the correct EC2 tag name.") t.EC2InstanceTagKeys[i] = Ec2InstanceTagKeyASG } } @@ -329,9 +329,13 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { Values: aws.StringSlice(t.EC2InstanceTagKeys), }) } + log.Print("Outside ec2tagger instance key") + t.logger.Info("Outside ec2tagger instance key - t.logger statement ") if len(t.EC2InstanceTagKeys) > 0 || len(t.EBSDeviceKeys) > 0 { - t.logger.Debug("ec2tagger: Configuring EC2 API client.", + log.Print("Inside ec2tagger instance key") + + t.logger.Info("ec2tagger: Configuring EC2 API client.", zap.String("region", t.ec2MetadataRespond.region), zap.String("roleARN", t.RoleARN)) @@ -347,14 +351,22 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { t.ec2API = t.ec2Provider(ec2CredentialConfig) if ec2Client, ok := t.ec2API.(*ec2.EC2); ok { + t.logger.Info("Inside ec2tagger ec2api logger statement") + log.Print("Inside ec2tagger ec2api - log printf statement") + if t.Config.MiddlewareID == nil { + t.logger.Info("Inside ec2tagger middleware default") + log.Print("Inside ec2tagger ec2api - log printf statement") + TypeStr, _ = component.NewType("agenthealth") defaultMiddlewareID := component.NewIDWithName(TypeStr, component.DataTypeMetrics.String()) t.Config.MiddlewareID = &defaultMiddlewareID - t.logger.Debug("ec2tagger: MiddlewareID was nil, initialized to default value.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) + t.logger.Info("ec2tagger: MiddlewareID was nil, initialized to default value.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) } - t.logger.Debug("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) + t.logger.Info("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) + log.Print("Inside ec2tagger ec2api - log printf statement") + log.Print(*t.Config.MiddlewareID) awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) } @@ -371,7 +383,7 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { t.setStarted() } - t.logger.Debug("ec2tagger: EC2 tagger has started successfully.") + t.logger.Info("ec2tagger: EC2 tagger has started successfully.") return nil } From b41de0902068217f460e65f4d9aba6f94cf360df Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 12:06:43 -0500 Subject: [PATCH 05/91] adding more log statments --- .../agenthealth/handler/stats/provider/statuscode.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 677471241f..ef3590793b 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -92,6 +92,17 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response // Store updated stats back in the map h.statsByOperation.Store(operation, stats) log.Printf("Updated stats for operation '%s': Success=%d, Failures=%d", operation, stats[0], stats[1]) + + // Log the entire status code map + log.Println("Complete status code map:") + h.statsByOperation.Range(func(key, value interface{}) bool { + log.Print("Printing all stats by operations map") + + operation := key.(string) + stats := value.(*[2]int) + log.Printf("Operation: %s, Success=%d, Failures=%d", operation, stats[0], stats[1]) + return true + }) } // GetStats retrieves the success and failure counts for a specific operation. From 90a22a3e1c836f2ec8045b30652a90ec9716fa38 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 13:46:10 -0500 Subject: [PATCH 06/91] fixing tags --- .../agenthealth/handler/stats/agent/agent.go | 18 ++++++++++++++++ .../agenthealth/handler/stats/handler.go | 21 ++++++++++++------- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 1d1ecc7b87..4835239010 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -5,6 +5,7 @@ package agent import ( "encoding/json" + "log" "strings" "github.com/aws/amazon-cloudwatch-agent/internal/util/collections" @@ -82,19 +83,36 @@ func (s *Stats) Merge(other Stats) { s.EntityRejected = other.EntityRejected } if other.StatusCodes != nil { + log.Println("Merging status codes from another source.") + if s.StatusCodes == nil { + log.Println("Initializing status codes map as it was nil.") s.StatusCodes = make(map[string][2]int) } + for key, value := range other.StatusCodes { + log.Printf("Processing key: %s with value: Success=%d, Failures=%d", key, value[0], value[1]) + if existing, ok := s.StatusCodes[key]; ok { + log.Printf( + "Key %s already exists. Existing: Success=%d, Failures=%d. Merging with: Success=%d, Failures=%d", + key, existing[0], existing[1], value[0], value[1], + ) // Merge the existing value with the new one s.StatusCodes[key] = [2]int{existing[0] + value[0], existing[1] + value[1]} + log.Printf( + "Updated key %s: Success=%d, Failures=%d", + key, s.StatusCodes[key][0], s.StatusCodes[key][1], + ) } else { // Add the new value if the key doesn't exist + log.Printf("Key %s does not exist. Adding it with: Success=%d, Failures=%d", key, value[0], value[1]) s.StatusCodes[key] = value } } + log.Println("Merging of status codes completed.") } + } func (s *Stats) Marshal() (string, error) { diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index f27cafff48..7f869f0fb3 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -5,6 +5,7 @@ package stats import ( "context" + "fmt" "log" "net/http" "sync" @@ -30,15 +31,12 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsm filter := agent.NewOperationsFilter(cfg.Operations...) log.Println("Operations filter created, operations:", cfg.Operations) - // Create client stats handler clientStats := client.NewHandler(filter) log.Println("Client stats handler created") - // Get status code stats statusCodeStats := provider.GetStatusCodeStats() log.Println("Status code stats handler retrieved") - // Create stats handler stats := newStatsHandler(logger, filter, []agent.StatsProvider{ clientStats, provider.GetProcessStats(), @@ -56,11 +54,9 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsm } else { log.Println("Stats are disabled, creating only status code stats handler") - // Get status code stats statusCodeStats := provider.GetStatusCodeStats() log.Println("Status code stats handler retrieved") - // Return empty request handlers and response handlers with status code stats log.Println("Returning handlers, requestHandlerCount: 0, responseHandlerCount: 1") return []awsmiddleware.RequestHandler{statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } @@ -105,13 +101,24 @@ func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { } func (sh *statsHandler) Header(operation string) string { + log.Println("Generating header for operation:", operation) + stats := &agent.Stats{} for _, p := range sh.providers { - stats.Merge(p.Stats(operation)) + log.Println("Merging stats from provider:", fmt.Sprintf("%T", p)) + stats.Merge(p.Stats("PutMetricData")) + stats.Merge(p.Stats("DescribeTags")) + } + + log.Println("Stats after merging all providers:", stats) + header, err := stats.Marshal() if err != nil { - sh.logger.Warn("Failed to serialize agent stats", zap.Error(err)) + log.Println("Failed to serialize agent stats:", err) + return "" } + + log.Println("Successfully generated header for operation:", operation) return header } From 8c6d037cfd27edcc6ce0cde4a4b8da04e9996ce9 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 13:53:55 -0500 Subject: [PATCH 07/91] fixing logs --- .../agenthealth/handler/stats/handler.go | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 7f869f0fb3..72c94b8356 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -90,13 +90,27 @@ func (sh *statsHandler) Position() awsmiddleware.HandlerPosition { } func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { + // Extract the operation name from the context operation := awsmiddleware.GetOperationName(ctx) - //if !sh.filter.IsAllowed(operation) { - // return - //} + log.Println("Handling request for operation:", operation) + + // If filtering is enabled, check if the operation is allowed (commented out for now) + // if !sh.filter.IsAllowed(operation) { + // log.Println("Operation not allowed:", operation) + // return + // } + + // Generate the header for the operation + log.Println("Generating header for operation:", operation) header := sh.Header(operation) + + // If a valid header is generated, set it in the request if header != "" { + log.Println("Setting header for operation:", operation) r.Header.Set(headerKeyAgentStats, header) + log.Println("Header set successfully for operation:", operation) + } else { + log.Println("No header generated for operation:", operation) } } From 6ff99f88bfc95977068ff8f6d7a1b1528caf1110 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 14:02:34 -0500 Subject: [PATCH 08/91] fixing logs --- extension/agenthealth/handler/stats/handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 72c94b8356..85e432dde6 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -104,6 +104,7 @@ func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { log.Println("Generating header for operation:", operation) header := sh.Header(operation) + fmt.Println("This is the header", header) // If a valid header is generated, set it in the request if header != "" { log.Println("Setting header for operation:", operation) From 667f608979c7d63b184fe40f0d43acd854f67f36 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 14:27:03 -0500 Subject: [PATCH 09/91] adding a log --- extension/agenthealth/handler/stats/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 85e432dde6..de7592e0f9 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -104,7 +104,7 @@ func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { log.Println("Generating header for operation:", operation) header := sh.Header(operation) - fmt.Println("This is the header", header) + log.Println("This is the header", header) // If a valid header is generated, set it in the request if header != "" { log.Println("Setting header for operation:", operation) From 9de94489f2a9ec31c2fa130ba6adc00aac58d1bb Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 14:35:36 -0500 Subject: [PATCH 10/91] fixing stats function for statuscodehandler --- .../agenthealth/handler/stats/handler.go | 3 +-- .../handler/stats/provider/statuscode.go | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index de7592e0f9..e49e182670 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -121,8 +121,7 @@ func (sh *statsHandler) Header(operation string) string { stats := &agent.Stats{} for _, p := range sh.providers { log.Println("Merging stats from provider:", fmt.Sprintf("%T", p)) - stats.Merge(p.Stats("PutMetricData")) - stats.Merge(p.Stats("DescribeTags")) + stats.Merge(p.Stats(operation)) } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index ef3590793b..6e257c82cd 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -127,17 +127,21 @@ func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { // Stats implements the `Stats` method required by the `agent.StatsProvider` interface. func (h *StatusCodeHandler) Stats(operation string) agent.Stats { - value, ok := h.statsByOperation.Load(operation) - if !ok { - return agent.Stats{ - StatusCodes: map[string][2]int{}, - } - } + h.mu.Lock() + defer h.mu.Unlock() + + // Initialize the map to store status codes for all operations + statusCodeMap := make(map[string][2]int) + + // Iterate over all operations and collect their status codes + h.statsByOperation.Range(func(key, value interface{}) bool { + operation := key.(string) + stats := value.(*[2]int) + statusCodeMap[operation] = [2]int{stats[0], stats[1]} + return true + }) - stats := value.(*[2]int) return agent.Stats{ - StatusCodes: map[string][2]int{ - operation: {stats[0], stats[1]}, - }, + StatusCodes: statusCodeMap, } } From 1e690e3243c46de9bf7d60b33b83072d6f873469 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 15:35:24 -0500 Subject: [PATCH 11/91] fixing issue --- .../agenthealth/handler/stats/agent/agent.go | 30 +++++++---- .../handler/stats/provider/statuscode.go | 51 ++++++++++++------- plugins/processors/ec2tagger/ec2tagger.go | 2 +- 3 files changed, 53 insertions(+), 30 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 4835239010..c3f53cabf2 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -31,7 +31,7 @@ type Stats struct { RegionType *string `json:"rt,omitempty"` Mode *string `json:"m,omitempty"` EntityRejected *int `json:"ent,omitempty"` - StatusCodes map[string][2]int `json:"codes,omitempty"` + StatusCodes map[string][5]int `json:"codes,omitempty"` } // Merge the other Stats into the current. If the field is not nil, @@ -87,26 +87,34 @@ func (s *Stats) Merge(other Stats) { if s.StatusCodes == nil { log.Println("Initializing status codes map as it was nil.") - s.StatusCodes = make(map[string][2]int) + s.StatusCodes = make(map[string][5]int) } for key, value := range other.StatusCodes { - log.Printf("Processing key: %s with value: Success=%d, Failures=%d", key, value[0], value[1]) + log.Printf("Processing key: %s with value: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", key, value[0], value[1], value[2], value[3], value[4]) if existing, ok := s.StatusCodes[key]; ok { log.Printf( - "Key %s already exists. Existing: Success=%d, Failures=%d. Merging with: Success=%d, Failures=%d", - key, existing[0], existing[1], value[0], value[1], + "Key %s already exists. Existing: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d. Merging with: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", + key, existing[0], existing[1], existing[2], existing[3], existing[4], + value[0], value[1], value[2], value[3], value[4], ) - // Merge the existing value with the new one - s.StatusCodes[key] = [2]int{existing[0] + value[0], existing[1] + value[1]} + + //Merge the values for each status code + 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 + } + log.Printf( - "Updated key %s: Success=%d, Failures=%d", - key, s.StatusCodes[key][0], s.StatusCodes[key][1], + "Updated key %s: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", + key, s.StatusCodes[key][0], s.StatusCodes[key][1], s.StatusCodes[key][2], s.StatusCodes[key][3], s.StatusCodes[key][4], ) } else { - // Add the new value if the key doesn't exist - log.Printf("Key %s does not exist. Adding it with: Success=%d, Failures=%d", key, value[0], value[1]) + log.Printf("Key %s does not exist. Adding it with: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", key, value[0], value[1], value[2], value[3], value[4]) s.StatusCodes[key] = value } } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 6e257c82cd..36c450ac5b 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -74,24 +74,18 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response defer h.mu.Unlock() // Load or initialize stats for the operation - value, loaded := h.statsByOperation.LoadOrStore(operation, &[2]int{}) + value, loaded := h.statsByOperation.LoadOrStore(operation, &[5]int{}) // Adjusted to hold counts for multiple status codes if !loaded { log.Printf("Initializing stats for operation: %s", operation) } - stats := value.(*[2]int) + stats := value.(*[5]int) - // Update success or failure count - if statusCode >= 200 && statusCode < 300 { - stats[0]++ - log.Printf("Incremented success count for operation: %s. New Success=%d", operation, stats[0]) - } else { - stats[1]++ - log.Printf("Incremented failure count for operation: %s. New Failures=%d", operation, stats[1]) - } + // Update counts based on specific status codes + h.updateStatusCodeCount(stats, statusCode, operation) // Store updated stats back in the map h.statsByOperation.Store(operation, stats) - log.Printf("Updated stats for operation '%s': Success=%d, Failures=%d", operation, stats[0], stats[1]) + log.Printf("Updated stats for operation '%s': 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", operation, stats[0], stats[1], stats[2], stats[3], stats[4]) // Log the entire status code map log.Println("Complete status code map:") @@ -99,12 +93,35 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response log.Print("Printing all stats by operations map") operation := key.(string) - stats := value.(*[2]int) - log.Printf("Operation: %s, Success=%d, Failures=%d", operation, stats[0], stats[1]) + stats := value.(*[5]int) + log.Printf("Operation: %s, 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", operation, stats[0], stats[1], stats[2], stats[3], stats[4]) return true }) } +// Helper function to update the status code counts +func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int, operation string) { + switch statusCode { + case 200: + stats[0]++ + log.Printf("Incremented 200 count for operation: %s. New 200=%d", operation, stats[0]) + case 400: + stats[1]++ + log.Printf("Incremented 400 count for operation: %s. New 400=%d", operation, stats[1]) + case 408: + stats[2]++ + log.Printf("Incremented 408 count for operation: %s. New 408=%d", operation, stats[2]) + case 413: + stats[3]++ + log.Printf("Incremented 413 count for operation: %s. New 413=%d", operation, stats[3]) + case 429: + stats[4]++ + log.Printf("Incremented 429 count for operation: %s. New 429=%d", operation, stats[4]) + default: + log.Printf("Received an untracked status code %d for operation: %s", statusCode, operation) + } +} + // GetStats retrieves the success and failure counts for a specific operation. func (h *StatusCodeHandler) GetStats(operation string) (successCount, failureCount int) { value, ok := h.statsByOperation.Load(operation) @@ -130,14 +147,12 @@ func (h *StatusCodeHandler) Stats(operation string) agent.Stats { h.mu.Lock() defer h.mu.Unlock() - // Initialize the map to store status codes for all operations - statusCodeMap := make(map[string][2]int) + statusCodeMap := make(map[string][5]int) - // Iterate over all operations and collect their status codes h.statsByOperation.Range(func(key, value interface{}) bool { operation := key.(string) - stats := value.(*[2]int) - statusCodeMap[operation] = [2]int{stats[0], stats[1]} + stats := value.(*[5]int) + statusCodeMap[operation] = [5]int{stats[0], stats[1], stats[2], stats[3], stats[4]} return true }) diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 0618c027cd..9a34c6ac15 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -367,7 +367,7 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { t.logger.Info("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) log.Print("Inside ec2tagger ec2api - log printf statement") log.Print(*t.Config.MiddlewareID) - awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) + awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) //Change this so that we confiugure new tegger to have the status code middware id !!!!!!!!!!!?????? } go func() { From 4c6adcf0aebc6dd3d8ff8977dad6004dc9853713 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 15:45:50 -0500 Subject: [PATCH 12/91] making operation names shorter --- .../handler/stats/provider/statuscode.go | 39 ++++++++++++++++--- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 36c450ac5b..32897eb4c6 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -66,28 +66,24 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response log.Printf("Processing response for operation: %s", operation) } - // Extract the status code + operation = GetShortOperationName(operation) statusCode := r.StatusCode log.Printf("Received status code: %d for operation: %s", statusCode, operation) h.mu.Lock() defer h.mu.Unlock() - // Load or initialize stats for the operation - value, loaded := h.statsByOperation.LoadOrStore(operation, &[5]int{}) // Adjusted to hold counts for multiple status codes + value, loaded := h.statsByOperation.LoadOrStore(operation, &[5]int{}) if !loaded { log.Printf("Initializing stats for operation: %s", operation) } stats := value.(*[5]int) - // Update counts based on specific status codes h.updateStatusCodeCount(stats, statusCode, operation) - // Store updated stats back in the map h.statsByOperation.Store(operation, stats) log.Printf("Updated stats for operation '%s': 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", operation, stats[0], stats[1], stats[2], stats[3], stats[4]) - // Log the entire status code map log.Println("Complete status code map:") h.statsByOperation.Range(func(key, value interface{}) bool { log.Print("Printing all stats by operations map") @@ -122,6 +118,37 @@ func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int, } } +func GetShortOperationName(operation string) string { + switch operation { + case "PutMetricData": + return "pmd" + case "DescribeInstances": + return "di" + case "DescribeTags": + return "dt" + 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 "sts" + default: + return operation + } +} + // GetStats retrieves the success and failure counts for a specific operation. func (h *StatusCodeHandler) GetStats(operation string) (successCount, failureCount int) { value, ok := h.statsByOperation.Load(operation) From dc129c9734a910cffd0e805e65fb2b1c8c5a2680 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 17:07:01 -0500 Subject: [PATCH 13/91] Last commit works to reduce name- this one is for filtering operations from status codes --- extension/agenthealth/config.go | 1 + extension/agenthealth/extension.go | 14 +------- .../agenthealth/handler/stats/agent/agent.go | 21 ++++++++--- .../agenthealth/handler/stats/handler.go | 19 +++++----- .../handler/stats/provider/statuscode.go | 6 +++- .../otel/extension/agenthealth/translator.go | 35 +++++++++++++++---- 6 files changed, 62 insertions(+), 34 deletions(-) diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index aa8e642e76..368596fec4 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -13,6 +13,7 @@ type Config struct { IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` Stats agent.StatsConfig `mapstructure:"stats"` StatusCode agent.StatusCodeConfig `mapstructure:"status_code"` //not sure if this supposed to be a different name?????? + StatusCodeOnly bool `mapstructure:"is_status_code_only"` } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index ea0216418b..385524f2a4 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -26,21 +26,9 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa var responseHandlers []awsmiddleware.ResponseHandler requestHandlers := []awsmiddleware.RequestHandler{useragent.NewHandler(ah.cfg.IsUsageDataEnabled)} - // Log the initialization - ah.logger.Debug("Initialized default request handler with user agent handler") - if ah.cfg.IsUsageDataEnabled { - // Log usage data configuration - ah.logger.Debug("Usage data is enabled, creating stats handlers") - - // Create stats handlers - req, res := stats.NewHandlers(ah.logger, ah.cfg.Stats, true) - - // Add stats handlers - ah.logger.Debug("Appending request handlers", zap.Int("count", len(req))) + req, res := stats.NewHandlers(ah.logger, ah.cfg) requestHandlers = append(requestHandlers, req...) - - ah.logger.Debug("Appending response handlers", zap.Int("count", len(res))) responseHandlers = append(responseHandlers, res...) } else { // Log usage data configuration is disabled diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index c3f53cabf2..217d8541f7 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -163,14 +163,27 @@ type StatsConfig struct { type StatusCodeConfig struct { // Operations are the allowed operation names to gather stats for. Operations []string `json:"operations,omitempty"` +} - // AllowedStatusCodes are the allowed status codes to gather stats for. - AllowedStatusCodes []int `json:"allowedStatusCodes,omitempty"` +var StatusCodeOperations = []string{ + "DescribeInstances", + "DescribeTags", + "DescribeVolumes", + "DescribeContainerInstances", + "DescribeServices", + "DescribeTaskDefinition", + "ListServices", + "ListTasks", + "CreateLogGroup", + "CreateLogStream", } // NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. -func NewStatusCodeOperationsFilter(cfg StatusCodeConfig) OperationsFilter { - allowed := collections.NewSet[string](cfg.Operations...) +func NewStatusCodeOperationsFilter() OperationsFilter { + //Need to add more operations !!!!!!!?????? + + allowed := collections.NewSet[string](StatusCodeOperations...) + return OperationsFilter{ operations: allowed, allowAll: allowed.Contains(AllowAllOperations), diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index e49e182670..26b4d0b2f7 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -6,6 +6,7 @@ package stats import ( "context" "fmt" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth" "log" "net/http" "sync" @@ -23,18 +24,17 @@ const ( headerKeyAgentStats = "X-Amz-Agent-Stats" ) -func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { - if statsB { +func NewHandlers(logger *zap.Logger, cfg agenthealth.Config) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { + statusCodeFilter := agent.NewStatusCodeOperationsFilter() + if !cfg.StatusCodeOnly { log.Println("Stats are enabled, creating handlers") - - // Create the operations filter - filter := agent.NewOperationsFilter(cfg.Operations...) - log.Println("Operations filter created, operations:", cfg.Operations) + filter := agent.NewOperationsFilter(cfg.Stats.Operations...) + log.Println("Operations filter created, operations:", cfg.Stats.Operations) clientStats := client.NewHandler(filter) log.Println("Client stats handler created") - statusCodeStats := provider.GetStatusCodeStats() + statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) log.Println("Status code stats handler retrieved") stats := newStatsHandler(logger, filter, []agent.StatsProvider{ @@ -46,15 +46,14 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statsB bool) ([]awsm log.Println("Stats handler created with providers") // Set usage flags - agent.UsageFlags().SetValues(cfg.UsageFlags) + agent.UsageFlags().SetValues(cfg.Stats.UsageFlags) // Return handlers log.Println("Returning request and response handlers, requestHandlerCount: 2, responseHandlerCount: 1") return []awsmiddleware.RequestHandler{stats, clientStats, statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } else { log.Println("Stats are disabled, creating only status code stats handler") - - statusCodeStats := provider.GetStatusCodeStats() + statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) log.Println("Status code stats handler retrieved") log.Println("Returning handlers, requestHandlerCount: 0, responseHandlerCount: 1") diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 32897eb4c6..1c9d3e9db2 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -26,12 +26,14 @@ type StatusCodeHandler struct { statsByOperation sync.Map mu sync.Mutex resetTimer *time.Timer + filter agent.OperationsFilter } // GetStatusCodeStats retrieves or initializes the singleton StatusCodeHandler. -func GetStatusCodeStats() *StatusCodeHandler { +func GetStatusCodeStats(filter agent.OperationsFilter) *StatusCodeHandler { statusCodeStatsOnce.Do(func() { handler := &StatusCodeHandler{} + handler.filter = filter handler.startResetTimer() statusCodeSingleton = handler }) @@ -62,6 +64,8 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response operation := awsmiddleware.GetOperationName(ctx) if operation == "" { log.Println("No operation name found in the context") + } else if !h.filter.IsAllowed(operation) { + log.Printf("Operation %s is not allowed", operation) } else { log.Printf("Processing response for operation: %s", operation) } diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 7720a8c54a..d385666fdf 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -4,15 +4,15 @@ package agenthealth import ( + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "github.com/aws/amazon-cloudwatch-agent/translator/context" + translateagent "github.com/aws/amazon-cloudwatch-agent/translator/translate/agent" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension" "github.com/aws/amazon-cloudwatch-agent/cfg/envconfig" "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" - "github.com/aws/amazon-cloudwatch-agent/translator/context" - translateagent "github.com/aws/amazon-cloudwatch-agent/translator/translate/agent" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common" ) @@ -36,16 +36,28 @@ type translator struct { operations []string isUsageDataEnabled bool factory extension.Factory + statuscodeonly bool } var _ common.Translator[component.Config] = (*translator)(nil) +func NewTranslatorWithStatusCode(name component.DataType, operations []string, statuscodeonly bool) common.Translator[component.Config] { + return &translator{ + name: name.String(), + operations: operations, + factory: agenthealth.NewFactory(), + isUsageDataEnabled: envconfig.IsUsageDataEnabled(), + statuscodeonly: statuscodeonly, + } +} + func NewTranslator(name component.DataType, operations []string) common.Translator[component.Config] { return &translator{ name: name.String(), operations: operations, factory: agenthealth.NewFactory(), isUsageDataEnabled: envconfig.IsUsageDataEnabled(), + statuscodeonly: false, } } @@ -57,9 +69,16 @@ func (t *translator) ID() component.ID { func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg := t.factory.CreateDefaultConfig().(*agenthealth.Config) cfg.IsUsageDataEnabled = t.isUsageDataEnabled - //if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok { - // cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData - //} // for now we will comment this ???????c + if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok { + cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData + } + cfg.StatusCodeOnly = t.statuscodeonly + if t.statuscodeonly { + cfg.StatusCode = agent.StatusCodeConfig{ + Operations: agent.StatusCodeOperations, + } + return cfg, nil + } cfg.Stats = agent.StatsConfig{ Operations: t.operations, UsageFlags: map[agent.Flag]any{ @@ -67,5 +86,9 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { agent.FlagRegionType: translateagent.Global_Config.RegionType, }, } + cfg.StatusCode = agent.StatusCodeConfig{ + Operations: agent.StatusCodeOperations, + } + return cfg, nil } From 07a06fa667b5d985ad51c2b9819222dbb15f8dbc Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 17:28:16 -0500 Subject: [PATCH 14/91] adding status code only filter --- extension/agenthealth/extension.go | 2 +- extension/agenthealth/handler/stats/handler.go | 11 +++++------ .../agenthealth/handler/stats/provider/statuscode.go | 6 +++++- plugins/processors/ec2tagger/ec2tagger.go | 3 ++- .../otel/extension/agenthealth/translator.go | 6 +++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 385524f2a4..60ad8974e9 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -27,7 +27,7 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa requestHandlers := []awsmiddleware.RequestHandler{useragent.NewHandler(ah.cfg.IsUsageDataEnabled)} if ah.cfg.IsUsageDataEnabled { - req, res := stats.NewHandlers(ah.logger, ah.cfg) + req, res := stats.NewHandlers(ah.logger, ah.cfg.Stats, ah.cfg.StatusCodeOnly) requestHandlers = append(requestHandlers, req...) responseHandlers = append(responseHandlers, res...) } else { diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 26b4d0b2f7..37948efad0 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -6,7 +6,6 @@ package stats import ( "context" "fmt" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth" "log" "net/http" "sync" @@ -24,12 +23,12 @@ const ( headerKeyAgentStats = "X-Amz-Agent-Stats" ) -func NewHandlers(logger *zap.Logger, cfg agenthealth.Config) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { +func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statuscodeonly bool) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { statusCodeFilter := agent.NewStatusCodeOperationsFilter() - if !cfg.StatusCodeOnly { + if !statuscodeonly { log.Println("Stats are enabled, creating handlers") - filter := agent.NewOperationsFilter(cfg.Stats.Operations...) - log.Println("Operations filter created, operations:", cfg.Stats.Operations) + filter := agent.NewOperationsFilter(cfg.Operations...) + log.Println("Operations filter created, operations:", cfg.Operations) clientStats := client.NewHandler(filter) log.Println("Client stats handler created") @@ -46,7 +45,7 @@ func NewHandlers(logger *zap.Logger, cfg agenthealth.Config) ([]awsmiddleware.Re log.Println("Stats handler created with providers") // Set usage flags - agent.UsageFlags().SetValues(cfg.Stats.UsageFlags) + agent.UsageFlags().SetValues(cfg.UsageFlags) // Return handlers log.Println("Returning request and response handlers, requestHandlerCount: 2, responseHandlerCount: 1") diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 1c9d3e9db2..58d8ab6b92 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,14 +1,18 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider import ( "context" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "log" "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 ( diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 9a34c6ac15..9c01df455f 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -5,13 +5,14 @@ package ec2tagger import ( "context" - "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" "hash/fnv" "log" "os" "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" diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index d385666fdf..62c7629ff7 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -4,15 +4,15 @@ package agenthealth import ( - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" - "github.com/aws/amazon-cloudwatch-agent/translator/context" - translateagent "github.com/aws/amazon-cloudwatch-agent/translator/translate/agent" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension" "github.com/aws/amazon-cloudwatch-agent/cfg/envconfig" "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "github.com/aws/amazon-cloudwatch-agent/translator/context" + translateagent "github.com/aws/amazon-cloudwatch-agent/translator/translate/agent" "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common" ) From 0f76726364c2b0c52ac6e2b3c0ebc1b5caf1c0aa Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 17:32:31 -0500 Subject: [PATCH 15/91] removing status code from otel config --- .../otel/extension/agenthealth/translator.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 62c7629ff7..107126ec46 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -74,9 +74,9 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { } cfg.StatusCodeOnly = t.statuscodeonly if t.statuscodeonly { - cfg.StatusCode = agent.StatusCodeConfig{ - Operations: agent.StatusCodeOperations, - } + //cfg.StatusCode = agent.StatusCodeConfig{ + // Operations: agent.StatusCodeOperations, + //} return cfg, nil } cfg.Stats = agent.StatsConfig{ @@ -86,9 +86,9 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { agent.FlagRegionType: translateagent.Global_Config.RegionType, }, } - cfg.StatusCode = agent.StatusCodeConfig{ - Operations: agent.StatusCodeOperations, - } + //cfg.StatusCode = agent.StatusCodeConfig{ + // Operations: agent.StatusCodeOperations, + //} //Do we need to add anything to otel config? return cfg, nil } From 965ccdb93e64f32aa94b3a62a3261c79bd5d5952 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 17:38:20 -0500 Subject: [PATCH 16/91] had to add return statments to filter --- extension/agenthealth/handler/stats/provider/statuscode.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 58d8ab6b92..1449cc57fa 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -68,8 +68,10 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response operation := awsmiddleware.GetOperationName(ctx) if operation == "" { log.Println("No operation name found in the context") + return } else if !h.filter.IsAllowed(operation) { log.Printf("Operation %s is not allowed", operation) + return } else { log.Printf("Processing response for operation: %s", operation) } From a8268fd07a49b00c002d895a2196fdcf0ea6145b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 17:46:44 -0500 Subject: [PATCH 17/91] commenting out try configure for ec2tagger --- plugins/processors/ec2tagger/ec2tagger.go | 40 +++++++++++------------ 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 9c01df455f..5f0122174f 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -11,8 +11,6 @@ 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" @@ -351,25 +349,25 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { } t.ec2API = t.ec2Provider(ec2CredentialConfig) - if ec2Client, ok := t.ec2API.(*ec2.EC2); ok { - t.logger.Info("Inside ec2tagger ec2api logger statement") - log.Print("Inside ec2tagger ec2api - log printf statement") - - if t.Config.MiddlewareID == nil { - t.logger.Info("Inside ec2tagger middleware default") - log.Print("Inside ec2tagger ec2api - log printf statement") - - TypeStr, _ = component.NewType("agenthealth") - defaultMiddlewareID := component.NewIDWithName(TypeStr, component.DataTypeMetrics.String()) - t.Config.MiddlewareID = &defaultMiddlewareID - t.logger.Info("ec2tagger: MiddlewareID was nil, initialized to default value.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) - } - - t.logger.Info("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) - log.Print("Inside ec2tagger ec2api - log printf statement") - log.Print(*t.Config.MiddlewareID) - awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) //Change this so that we confiugure new tegger to have the status code middware id !!!!!!!!!!!?????? - } + //if ec2Client, ok := t.ec2API.(*ec2.EC2); ok { + // t.logger.Info("Inside ec2tagger ec2api logger statement") + // log.Print("Inside ec2tagger ec2api - log printf statement") + // + // if t.Config.MiddlewareID == nil { + // t.logger.Info("Inside ec2tagger middleware default") + // log.Print("Inside ec2tagger ec2api - log printf statement") + // + // TypeStr, _ = component.NewType("agenthealth") + // defaultMiddlewareID := component.NewIDWithName(TypeStr, component.DataTypeMetrics.String()) + // t.Config.MiddlewareID = &defaultMiddlewareID + // t.logger.Info("ec2tagger: MiddlewareID was nil, initialized to default value.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) + // } + // + // t.logger.Info("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) + // log.Print("Inside ec2tagger ec2api - log printf statement") + // log.Print(*t.Config.MiddlewareID) + //awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) //Change this so that we confiugure new tegger to have the status code middware id !!!!!!!!!!!?????? + //} go func() { t.logger.Info("ec2tagger: Starting initial retrieval of tags and volumes.") From 8ddb463c108caa769dcbf83dd2529bdcca4448f7 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 18:05:12 -0500 Subject: [PATCH 18/91] adding ecw client for ec2 tagger --- plugins/processors/ec2tagger/ec2tagger.go | 44 ++++++++++++----------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 5f0122174f..6c458e1c16 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -5,12 +5,16 @@ package ec2tagger import ( "context" + "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" + "hash/fnv" "log" "os" "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" @@ -64,7 +68,7 @@ type Tagger struct { func newTagger(config *Config, logger *zap.Logger) *Tagger { _, cancel := context.WithCancel(context.Background()) mdCredentialConfig := &configaws.CredentialConfig{} - + config.MiddlewareID = &agenthealth.StatusCodeID p := &Tagger{ Config: config, logger: logger, @@ -349,25 +353,25 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { } t.ec2API = t.ec2Provider(ec2CredentialConfig) - //if ec2Client, ok := t.ec2API.(*ec2.EC2); ok { - // t.logger.Info("Inside ec2tagger ec2api logger statement") - // log.Print("Inside ec2tagger ec2api - log printf statement") - // - // if t.Config.MiddlewareID == nil { - // t.logger.Info("Inside ec2tagger middleware default") - // log.Print("Inside ec2tagger ec2api - log printf statement") - // - // TypeStr, _ = component.NewType("agenthealth") - // defaultMiddlewareID := component.NewIDWithName(TypeStr, component.DataTypeMetrics.String()) - // t.Config.MiddlewareID = &defaultMiddlewareID - // t.logger.Info("ec2tagger: MiddlewareID was nil, initialized to default value.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) - // } - // - // t.logger.Info("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) - // log.Print("Inside ec2tagger ec2api - log printf statement") - // log.Print(*t.Config.MiddlewareID) - //awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) //Change this so that we confiugure new tegger to have the status code middware id !!!!!!!!!!!?????? - //} + if ec2Client, ok := t.ec2API.(*ec2.EC2); ok { + t.logger.Info("Inside ec2tagger ec2api logger statement") + log.Print("Inside ec2tagger ec2api - log printf statement") + + if t.Config.MiddlewareID == nil { + t.logger.Info("Inside ec2tagger middleware default") + log.Print("Inside ec2tagger ec2api - log printf statement") + + TypeStr, _ = component.NewType("agenthealth") + defaultMiddlewareID := component.NewIDWithName(TypeStr, component.DataTypeMetrics.String()) + t.Config.MiddlewareID = &defaultMiddlewareID + log.Println("ec2tagger: MiddlewareID was nil, initialized to default value.", t.Config.MiddlewareID.Name()) + } + + t.logger.Info("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) + log.Print("Inside ec2tagger ec2api - log printf statement") + log.Print(*t.Config.MiddlewareID) + awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) //Change this so that we confiugure new tegger to have the status code middware id !!!!!!!!!!!?????? + } go func() { t.logger.Info("ec2tagger: Starting initial retrieval of tags and volumes.") From 3c15e8147cda820a6a9cf75c322845eb4e757c0e Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 18:13:41 -0500 Subject: [PATCH 19/91] changing the middleware to metricID --- plugins/processors/ec2tagger/ec2tagger.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 6c458e1c16..55b6866bff 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -5,8 +5,6 @@ package ec2tagger import ( "context" - "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/extension/agenthealth" - "hash/fnv" "log" "os" @@ -68,7 +66,6 @@ type Tagger struct { func newTagger(config *Config, logger *zap.Logger) *Tagger { _, cancel := context.WithCancel(context.Background()) mdCredentialConfig := &configaws.CredentialConfig{} - config.MiddlewareID = &agenthealth.StatusCodeID p := &Tagger{ Config: config, logger: logger, From 947b8f31c702e97d7a597a0bf0ec71e25c31f86c Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 13 Nov 2024 19:04:40 -0500 Subject: [PATCH 20/91] trying to get stat --- extension/agenthealth/handler/stats/handler.go | 10 +++++----- .../agenthealth/handler/stats/provider/statuscode.go | 10 ---------- .../translate/otel/extension/agenthealth/translator.go | 7 +++---- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 37948efad0..a26b98c67d 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -36,7 +36,7 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statuscodeonly bool) statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) log.Println("Status code stats handler retrieved") - stats := newStatsHandler(logger, filter, []agent.StatsProvider{ + stats := newStatsHandler(logger, statusCodeFilter, []agent.StatsProvider{ clientStats, provider.GetProcessStats(), provider.GetFlagsStats(), @@ -93,10 +93,10 @@ func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { log.Println("Handling request for operation:", operation) // If filtering is enabled, check if the operation is allowed (commented out for now) - // if !sh.filter.IsAllowed(operation) { - // log.Println("Operation not allowed:", operation) - // return - // } + //if !sh.filter.IsAllowed(operation) { + // log.Println("Operation not allowed:", operation) + // return + //} // Generate the header for the operation log.Println("Generating header for operation:", operation) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 1449cc57fa..d000f62889 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -159,16 +159,6 @@ func GetShortOperationName(operation string) string { } } -// GetStats retrieves the success and failure counts for a specific operation. -func (h *StatusCodeHandler) GetStats(operation string) (successCount, failureCount int) { - value, ok := h.statsByOperation.Load(operation) - if !ok { - return 0, 0 - } - stats := value.(*[2]int) - return stats[0], stats[1] -} - // ID returns the unique identifier for the handler. func (h *StatusCodeHandler) ID() string { return statusHandlerID diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 107126ec46..1a43a1d0a4 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -25,10 +25,9 @@ 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()) - StatusCodeID = component.NewIDWithName(agenthealth.TypeStr, "StatusCode") + MetricsID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeMetrics.String()) + LogsID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeLogs.String()) + TracesID = component.NewIDWithName(agenthealth.TypeStr, component.DataTypeTraces.String()) ) type translator struct { From a76ef499a7bc613252002156493519a170f90e6b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 15 Nov 2024 15:44:52 -0500 Subject: [PATCH 21/91] everything works just removing some debug statement and filter from handler --- extension/agenthealth/extension.go | 7 --- .../agenthealth/handler/stats/agent/agent.go | 6 +-- .../agenthealth/handler/stats/handler.go | 54 +++++++------------ 3 files changed, 20 insertions(+), 47 deletions(-) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 60ad8974e9..d129fe02c8 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -31,16 +31,9 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa requestHandlers = append(requestHandlers, req...) responseHandlers = append(responseHandlers, res...) } else { - // Log usage data configuration is disabled ah.logger.Debug("Usage data is disabled, skipping stats handlers") } - // Log final handlers - ah.logger.Debug("Handlers created", - zap.Int("requestHandlersCount", len(requestHandlers)), - zap.Int("responseHandlersCount", len(responseHandlers)), - ) - return requestHandlers, responseHandlers } diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 217d8541f7..0a5cdae335 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -31,7 +31,7 @@ type Stats struct { RegionType *string `json:"rt,omitempty"` Mode *string `json:"m,omitempty"` EntityRejected *int `json:"ent,omitempty"` - StatusCodes map[string][5]int `json:"codes,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, @@ -165,7 +165,7 @@ type StatusCodeConfig struct { Operations []string `json:"operations,omitempty"` } -var StatusCodeOperations = []string{ +var StatusCodeOperations = []string{ // all the operations that are allowed "DescribeInstances", "DescribeTags", "DescribeVolumes", @@ -180,8 +180,6 @@ var StatusCodeOperations = []string{ // NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. func NewStatusCodeOperationsFilter() OperationsFilter { - //Need to add more operations !!!!!!!?????? - allowed := collections.NewSet[string](StatusCodeOperations...) return OperationsFilter{ diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index a26b98c67d..51d61b6641 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -25,39 +25,23 @@ const ( func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statuscodeonly bool) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { statusCodeFilter := agent.NewStatusCodeOperationsFilter() - if !statuscodeonly { - log.Println("Stats are enabled, creating handlers") - filter := agent.NewOperationsFilter(cfg.Operations...) - log.Println("Operations filter created, operations:", cfg.Operations) - - clientStats := client.NewHandler(filter) - log.Println("Client stats handler created") - - statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) - log.Println("Status code stats handler retrieved") - - stats := newStatsHandler(logger, statusCodeFilter, []agent.StatsProvider{ - clientStats, - provider.GetProcessStats(), - provider.GetFlagsStats(), - statusCodeStats, - }) - log.Println("Stats handler created with providers") - - // Set usage flags - agent.UsageFlags().SetValues(cfg.UsageFlags) - - // Return handlers - log.Println("Returning request and response handlers, requestHandlerCount: 2, responseHandlerCount: 1") - return []awsmiddleware.RequestHandler{stats, clientStats, statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} - } else { - log.Println("Stats are disabled, creating only status code stats handler") + if statuscodeonly { statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) - log.Println("Status code stats handler retrieved") - - log.Println("Returning handlers, requestHandlerCount: 0, responseHandlerCount: 1") return []awsmiddleware.RequestHandler{statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } + filter := agent.NewOperationsFilter(cfg.Operations...) + clientStats := client.NewHandler(filter) + statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) + + stats := newStatsHandler(logger, statusCodeFilter, []agent.StatsProvider{ + clientStats, + provider.GetProcessStats(), + provider.GetFlagsStats(), + statusCodeStats, + }) + agent.UsageFlags().SetValues(cfg.UsageFlags) + + return []awsmiddleware.RequestHandler{stats, clientStats, statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } type statsHandler struct { @@ -88,15 +72,13 @@ func (sh *statsHandler) Position() awsmiddleware.HandlerPosition { } func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { - // Extract the operation name from the context operation := awsmiddleware.GetOperationName(ctx) log.Println("Handling request for operation:", operation) - // If filtering is enabled, check if the operation is allowed (commented out for now) - //if !sh.filter.IsAllowed(operation) { - // log.Println("Operation not allowed:", operation) - // return - //} + if !sh.filter.IsAllowed(operation) { + log.Println("Operation not allowed:", operation) + return + } // Generate the header for the operation log.Println("Generating header for operation:", operation) From abf484b907d0dbfcda35aec3db6d958a746d2e35 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 15 Nov 2024 16:22:21 -0500 Subject: [PATCH 22/91] fixing filter issue --- .../agenthealth/handler/stats/agent/agent.go | 25 ++++++++++ .../agenthealth/handler/stats/handler.go | 6 +-- .../sampleConfig/advanced_config_linux.json | 47 +++++++------------ .../sampleConfig/complete_linux_config.json | 10 ++-- 4 files changed, 50 insertions(+), 38 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 0a5cdae335..ce234ef94b 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -178,6 +178,22 @@ var StatusCodeOperations = []string{ // all the operations that are allowed "CreateLogStream", } +var StatusCodeAndOtherOperations = []string{ // all the operations that are allowed + "PutMetricData", + "PutLogEvents", + "PutTraceSegments", + "DescribeInstances", + "DescribeTags", + "DescribeVolumes", + "DescribeContainerInstances", + "DescribeServices", + "DescribeTaskDefinition", + "ListServices", + "ListTasks", + "CreateLogGroup", + "CreateLogStream", +} + // NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. func NewStatusCodeOperationsFilter() OperationsFilter { allowed := collections.NewSet[string](StatusCodeOperations...) @@ -187,3 +203,12 @@ func NewStatusCodeOperationsFilter() OperationsFilter { allowAll: allowed.Contains(AllowAllOperations), } } + +func NewStatusCodeAndOtherOperationsFilter() OperationsFilter { + allowed := collections.NewSet[string](StatusCodeAndOtherOperations...) + + return OperationsFilter{ + operations: allowed, + allowAll: allowed.Contains(AllowAllOperations), + } +} diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 51d61b6641..b4d9d32caa 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -29,11 +29,11 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statuscodeonly bool) statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) return []awsmiddleware.RequestHandler{statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } - filter := agent.NewOperationsFilter(cfg.Operations...) + filter := agent.NewStatusCodeAndOtherOperationsFilter() clientStats := client.NewHandler(filter) statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) - stats := newStatsHandler(logger, statusCodeFilter, []agent.StatsProvider{ + stats := newStatsHandler(logger, filter, []agent.StatsProvider{ clientStats, provider.GetProcessStats(), provider.GetFlagsStats(), @@ -80,12 +80,10 @@ func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { return } - // Generate the header for the operation log.Println("Generating header for operation:", operation) header := sh.Header(operation) log.Println("This is the header", header) - // If a valid header is generated, set it in the request if header != "" { log.Println("Setting header for operation:", operation) r.Header.Set(headerKeyAgentStats, header) diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.json b/translator/tocwconfig/sampleConfig/advanced_config_linux.json index bb70dd5c72..ae8b1cef02 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.json +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.json @@ -1,9 +1,4 @@ { - "agent": { - "debug": true, - "aws_sdk_log_level": "LogDebugWithHTTPBody", - "region": "us-west-2" - }, "metrics": { "append_dimensions": { "AutoScalingGroupName": "${aws:AutoScalingGroupName}", @@ -19,8 +14,7 @@ "cpu_usage_user", "cpu_usage_system" ], - "totalcpu": false, - "metrics_collection_interval": 10 + "totalcpu": false }, "disk": { "resources": [ @@ -29,8 +23,7 @@ "measurement": [ "used_percent", "inodes_free" - ], - "metrics_collection_interval": 60 + ] }, "diskio": { "resources": [ @@ -42,27 +35,23 @@ "read_bytes", "writes", "reads" - ], - "metrics_collection_interval": 60 + ] }, "mem": { "measurement": [ "mem_used_percent" - ], - "metrics_collection_interval": 10 + ] }, "netstat": { "measurement": [ "tcp_established", "tcp_time_wait" - ], - "metrics_collection_interval": 60 + ] }, "swap": { "measurement": [ "swap_used_percent" - ], - "metrics_collection_interval": 10 + ] }, "ethtool": { "interface_include": [ @@ -76,20 +65,16 @@ "conntrack_allowance_exceeded", "linklocal_allowance_exceeded" ] - } - } - }, - "logs": { - "logs_collected": { - "files": { - "collect_list": [ - { - "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log", - "log_group_name": "StatusCode", - "log_stream_name": "agent-1" - } - ] + }, + "nvidia_gpu": { + "measurement": [ + "utilization_gpu", + "utilization_memory", + "power_draw", + "temperature_gpu" + ], + "metrics_collection_interval": 60 } } } -} +} \ No newline at end of file diff --git a/translator/tocwconfig/sampleConfig/complete_linux_config.json b/translator/tocwconfig/sampleConfig/complete_linux_config.json index 39130d073a..c2fb70e151 100755 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.json +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.json @@ -5,7 +5,7 @@ "internal": true, "debug": true, "quiet": true, - "aws_sdk_log_level": "LogDebugWithHTTPBody", + "aws_sdk_log_level": "LogDebug", "user_agent": "CUSTOM USER AGENT VALUE", "credentials": { "role_arn": "global_role_arn_value" @@ -14,6 +14,10 @@ "omit_hostname": true }, "metrics": { + "metrics_destinations": { + "cloudwatch": { + } + }, "metrics_collected": { "jmx": [ { @@ -251,8 +255,8 @@ "collect_list": [ { "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log", - "log_group_name": "/aws/amazon-cloudwatch-agent", - "log_stream_name": "agent-1", + "log_group_name": "amazon-cloudwatch-agent.log", + "log_stream_name": "amazon-cloudwatch-agent.log", "timezone": "UTC", "retention_in_days": 5 }, From c849f6182a7b6007f5d4095d1693df3edc305007 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 15 Nov 2024 16:43:30 -0500 Subject: [PATCH 23/91] previous commit works, just cleaning up debug statemtns --- .../agenthealth/handler/stats/handler.go | 13 ------- .../handler/stats/provider/statuscode.go | 9 ----- plugins/processors/ec2tagger/ec2tagger.go | 39 ------------------- plugins/processors/ec2tagger/factory.go | 9 ++--- .../sampleConfig/advanced_config_linux.json | 2 +- 5 files changed, 4 insertions(+), 68 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index b4d9d32caa..e6d00ece83 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -5,7 +5,6 @@ package stats import ( "context" - "fmt" "log" "net/http" "sync" @@ -73,44 +72,32 @@ func (sh *statsHandler) Position() awsmiddleware.HandlerPosition { func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { operation := awsmiddleware.GetOperationName(ctx) - log.Println("Handling request for operation:", operation) if !sh.filter.IsAllowed(operation) { - log.Println("Operation not allowed:", operation) return } - log.Println("Generating header for operation:", operation) header := sh.Header(operation) - log.Println("This is the header", header) if header != "" { - log.Println("Setting header for operation:", operation) r.Header.Set(headerKeyAgentStats, header) - log.Println("Header set successfully for operation:", operation) } else { log.Println("No header generated for operation:", operation) } } func (sh *statsHandler) Header(operation string) string { - log.Println("Generating header for operation:", operation) stats := &agent.Stats{} for _, p := range sh.providers { - log.Println("Merging stats from provider:", fmt.Sprintf("%T", p)) stats.Merge(p.Stats(operation)) } - log.Println("Stats after merging all providers:", stats) - header, err := stats.Marshal() if err != nil { - log.Println("Failed to serialize agent stats:", err) return "" } - log.Println("Successfully generated header for operation:", operation) return header } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index d000f62889..0e49e4bb81 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -78,7 +78,6 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response operation = GetShortOperationName(operation) statusCode := r.StatusCode - log.Printf("Received status code: %d for operation: %s", statusCode, operation) h.mu.Lock() defer h.mu.Unlock() @@ -92,11 +91,8 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response h.updateStatusCodeCount(stats, statusCode, operation) h.statsByOperation.Store(operation, stats) - log.Printf("Updated stats for operation '%s': 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", operation, stats[0], stats[1], stats[2], stats[3], stats[4]) - log.Println("Complete status code map:") h.statsByOperation.Range(func(key, value interface{}) bool { - log.Print("Printing all stats by operations map") operation := key.(string) stats := value.(*[5]int) @@ -110,19 +106,14 @@ func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int, switch statusCode { case 200: stats[0]++ - log.Printf("Incremented 200 count for operation: %s. New 200=%d", operation, stats[0]) case 400: stats[1]++ - log.Printf("Incremented 400 count for operation: %s. New 400=%d", operation, stats[1]) case 408: stats[2]++ - log.Printf("Incremented 408 count for operation: %s. New 408=%d", operation, stats[2]) case 413: stats[3]++ - log.Printf("Incremented 413 count for operation: %s. New 413=%d", operation, stats[3]) case 429: stats[4]++ - log.Printf("Incremented 429 count for operation: %s. New 429=%d", operation, stats[4]) default: log.Printf("Received an untracked status code %d for operation: %s", statusCode, operation) } diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 55b6866bff..a6f6e967f7 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -6,7 +6,6 @@ package ec2tagger import ( "context" "hash/fnv" - "log" "os" "sync" "time" @@ -283,24 +282,13 @@ 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, host component.Host) error { - t.logger.Info("ec2tagger: Starting the EC2 tagger.") - log.Printf("start function called with host: %s\n", host) - t.shutdownC = make(chan bool) t.ec2TagCache = map[string]string{} - // Derive EC2 Metadata - t.logger.Info("ec2tagger: Deriving EC2 metadata from IMDS.") if err := t.deriveEC2MetadataFromIMDS(ctx); err != nil { - t.logger.Error("ec2tagger: Failed to derive EC2 metadata from IMDS.", zap.Error(err)) return err } - t.logger.Info("ec2tagger: Successfully derived EC2 metadata from IMDS.", - zap.String("instanceId", t.ec2MetadataRespond.instanceId), - zap.String("region", t.ec2MetadataRespond.region)) - // Set up tag filters - t.logger.Info("ec2tagger: Setting up tag filters.") t.tagFilters = []*ec2.Filter{ { Name: aws.String("resource-type"), @@ -314,12 +302,9 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { useAllTags := len(t.EC2InstanceTagKeys) == 1 && t.EC2InstanceTagKeys[0] == "*" if !useAllTags && len(t.EC2InstanceTagKeys) > 0 { - t.logger.Info("ec2tagger: Processing specified EC2InstanceTagKeys.", - zap.Strings("keys", t.EC2InstanceTagKeys)) for i, key := range t.EC2InstanceTagKeys { if cwDimensionASG == key { - t.logger.Info("ec2tagger: Replacing 'AutoScalingGroupName' with the correct EC2 tag name.") t.EC2InstanceTagKeys[i] = Ec2InstanceTagKeyASG } } @@ -329,16 +314,8 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { Values: aws.StringSlice(t.EC2InstanceTagKeys), }) } - log.Print("Outside ec2tagger instance key") - t.logger.Info("Outside ec2tagger instance key - t.logger statement ") if len(t.EC2InstanceTagKeys) > 0 || len(t.EBSDeviceKeys) > 0 { - log.Print("Inside ec2tagger instance key") - - t.logger.Info("ec2tagger: Configuring EC2 API client.", - zap.String("region", t.ec2MetadataRespond.region), - zap.String("roleARN", t.RoleARN)) - ec2CredentialConfig := &configaws.CredentialConfig{ AccessKey: t.AccessKey, SecretKey: t.SecretKey, @@ -351,39 +328,23 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { t.ec2API = t.ec2Provider(ec2CredentialConfig) if ec2Client, ok := t.ec2API.(*ec2.EC2); ok { - t.logger.Info("Inside ec2tagger ec2api logger statement") - log.Print("Inside ec2tagger ec2api - log printf statement") - if t.Config.MiddlewareID == nil { - t.logger.Info("Inside ec2tagger middleware default") - log.Print("Inside ec2tagger ec2api - log printf statement") - TypeStr, _ = component.NewType("agenthealth") defaultMiddlewareID := component.NewIDWithName(TypeStr, component.DataTypeMetrics.String()) t.Config.MiddlewareID = &defaultMiddlewareID - log.Println("ec2tagger: MiddlewareID was nil, initialized to default value.", t.Config.MiddlewareID.Name()) } - - t.logger.Info("ec2tagger: Configuring middleware for EC2 client.", zap.Any("MiddlewareID", t.Config.MiddlewareID)) - log.Print("Inside ec2tagger ec2api - log printf statement") - log.Print(*t.Config.MiddlewareID) awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) //Change this so that we confiugure new tegger to have the status code middware id !!!!!!!!!!!?????? } go func() { - t.logger.Info("ec2tagger: Starting initial retrieval of tags and volumes.") t.initialRetrievalOfTagsAndVolumes() - t.logger.Info("ec2tagger: Starting refresh loop to update tags and volumes.") t.refreshLoopToUpdateTagsAndVolumes() }() - t.logger.Info("ec2tagger: EC2 tagger has started initialization.") } else { - t.logger.Info("ec2tagger: No EC2 instance or EBS device keys specified. Skipping tagger initialization.") t.setStarted() } - t.logger.Info("ec2tagger: EC2 tagger has started successfully.") return nil } diff --git a/plugins/processors/ec2tagger/factory.go b/plugins/processors/ec2tagger/factory.go index 1bfa955de7..72b5576b9d 100644 --- a/plugins/processors/ec2tagger/factory.go +++ b/plugins/processors/ec2tagger/factory.go @@ -44,14 +44,11 @@ func createMetricsProcessor( return nil, fmt.Errorf("configuration parsing error") } - // Now passing host to newTagger metricsProcessor := newTagger(processorConfig, set.Logger) - return processorhelper.NewMetricsProcessor( - ctx, set, cfg, nextConsumer, + return processorhelper.NewMetricsProcessor(ctx, set, cfg, nextConsumer, metricsProcessor.processMetrics, processorhelper.WithCapabilities(processorCapabilities), - processorhelper.WithStart(metricsProcessor.Start), // Use the Start method of metricsProcessor - processorhelper.WithShutdown(metricsProcessor.Shutdown), - ) + processorhelper.WithStart(metricsProcessor.Start), + processorhelper.WithShutdown(metricsProcessor.Shutdown)) } diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.json b/translator/tocwconfig/sampleConfig/advanced_config_linux.json index ae8b1cef02..87d7d3003c 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.json +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.json @@ -77,4 +77,4 @@ } } } -} \ No newline at end of file +} From bd33dbcca5ad4990fcbab7939e2fb2234e535cd3 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 15 Nov 2024 17:33:12 -0500 Subject: [PATCH 24/91] adding unit tests --- extension/agenthealth/config.go | 7 +- extension/agenthealth/extension_test.go | 2 +- .../agenthealth/handler/stats/agent/agent.go | 5 - .../handler/stats/agent/agent_test.go | 122 ++--- .../agenthealth/handler/stats/handler_test.go | 15 +- .../handler/stats/provider/interval.go | 17 +- .../handler/stats/provider/process_test.go | 5 +- .../handler/stats/provider/statuscode_test.go | 30 ++ internal/tls/testdata/server.crt | 42 +- internal/tls/testdata/server.key | 52 +- internal/tls/testdata/tls-ca.crt | 50 +- .../base_container_insights_config.yaml | 501 +++++++++--------- 12 files changed, 428 insertions(+), 420 deletions(-) create mode 100644 extension/agenthealth/handler/stats/provider/statuscode_test.go diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index 368596fec4..ad326129be 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -10,10 +10,9 @@ import ( ) type Config struct { - IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` - Stats agent.StatsConfig `mapstructure:"stats"` - StatusCode agent.StatusCodeConfig `mapstructure:"status_code"` //not sure if this supposed to be a different name?????? - StatusCodeOnly bool `mapstructure:"is_status_code_only"` + IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` + Stats agent.StatsConfig `mapstructure:"stats"` + StatusCodeOnly bool `mapstructure:"is_status_code_only"` } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 504dc8c50e..fa9e42f605 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -20,7 +20,7 @@ func TestExtension(t *testing.T) { assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost())) requestHandlers, responseHandlers := extension.Handlers() // user agent, client stats, stats - assert.Len(t, requestHandlers, 3) + assert.Len(t, requestHandlers, 4) // client stats assert.Len(t, responseHandlers, 1) cfg.IsUsageDataEnabled = false diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index ce234ef94b..85e4d252aa 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -160,11 +160,6 @@ type StatsConfig struct { UsageFlags map[Flag]any `mapstructure:"usage_flags,omitempty"` } -type StatusCodeConfig struct { - // Operations are the allowed operation names to gather stats for. - Operations []string `json:"operations,omitempty"` -} - var StatusCodeOperations = []string{ // all the operations that are allowed "DescribeInstances", "DescribeTags", diff --git a/extension/agenthealth/handler/stats/agent/agent_test.go b/extension/agenthealth/handler/stats/agent/agent_test.go index c379facc19..9ec8177156 100644 --- a/extension/agenthealth/handler/stats/agent/agent_test.go +++ b/extension/agenthealth/handler/stats/agent/agent_test.go @@ -10,105 +10,77 @@ import ( "github.com/stretchr/testify/assert" ) -func TestMerge(t *testing.T) { - stats := &Stats{CpuPercent: aws.Float64(1.2)} - assert.EqualValues(t, 1.2, *stats.CpuPercent) - assert.Nil(t, stats.MemoryBytes) +func TestMergeWithStatusCodes(t *testing.T) { + // Initial stats with some status codes + stats := &Stats{ + StatusCodes: map[string][5]int{ + "operation1": {1, 2, 3, 4, 5}, + }, + } + + // Merge with new stats containing additional status codes stats.Merge(Stats{ - CpuPercent: aws.Float64(1.3), - MemoryBytes: aws.Uint64(123), + 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.EqualValues(t, 1.3, *stats.CpuPercent) - assert.EqualValues(t, 123, *stats.MemoryBytes) + + // Assert merged values + 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 + + // Merge with empty StatusCodes map stats.Merge(Stats{ - CpuPercent: aws.Float64(1.5), - MemoryBytes: aws.Uint64(133), - FileDescriptorCount: aws.Int32(456), - ThreadCount: aws.Int32(789), - LatencyMillis: aws.Int64(1234), - PayloadBytes: aws.Int(5678), - StatusCode: aws.Int(200), - SharedConfigFallback: aws.Int(1), - ImdsFallbackSucceed: aws.Int(1), - AppSignals: aws.Int(1), - EnhancedContainerInsights: aws.Int(1), - RunningInContainer: aws.Int(0), - RegionType: aws.String("RegionType"), - Mode: aws.String("Mode"), + StatusCodes: nil, }) - 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) - assert.EqualValues(t, 1234, *stats.LatencyMillis) - assert.EqualValues(t, 5678, *stats.PayloadBytes) - assert.EqualValues(t, 200, *stats.StatusCode) - assert.EqualValues(t, 1, *stats.ImdsFallbackSucceed) - assert.EqualValues(t, 1, *stats.SharedConfigFallback) - assert.EqualValues(t, 1, *stats.AppSignals) - assert.EqualValues(t, 1, *stats.EnhancedContainerInsights) - assert.EqualValues(t, 0, *stats.RunningInContainer) - assert.EqualValues(t, "RegionType", *stats.RegionType) - assert.EqualValues(t, "Mode", *stats.Mode) + + // Assert that StatusCodes remains unchanged + 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 TestMarshal(t *testing.T) { +func TestMarshalWithStatusCodes(t *testing.T) { testCases := map[string]struct { stats *Stats want string }{ - "WithEmpty": { - stats: &Stats{}, - want: "", - }, - "WithPartial": { + "WithEmptyStatusCodes": { stats: &Stats{ - CpuPercent: aws.Float64(1.2), - MemoryBytes: aws.Uint64(123), - ThreadCount: aws.Int32(789), - PayloadBytes: aws.Int(5678), + StatusCodes: map[string][5]int{}, }, - want: `"cpu":1.2,"mem":123,"th":789,"load":5678`, + want: "", }, - "WithFull": { + "WithStatusCodes": { stats: &Stats{ - CpuPercent: aws.Float64(1.2), - MemoryBytes: aws.Uint64(123), - FileDescriptorCount: aws.Int32(456), - ThreadCount: aws.Int32(789), - LatencyMillis: aws.Int64(1234), - PayloadBytes: aws.Int(5678), - StatusCode: aws.Int(200), - ImdsFallbackSucceed: aws.Int(1), + StatusCodes: map[string][5]int{ + "operation1": {1, 2, 3, 4, 5}, + "operation2": {0, 1, 2, 3, 4}, + }, }, - want: `"cpu":1.2,"mem":123,"fd":456,"th":789,"lat":1234,"load":5678,"code":200,"ifs":1`, + 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.Equal(t, testCase.want, got) + assert.Contains(t, got, testCase.want) }) } } -func TestOperationFilter(t *testing.T) { - testCases := map[string]struct { - allowedOperations []string - testOperations []string - want []bool - }{ - "WithNoneAllowed": {allowedOperations: nil, testOperations: []string{"nothing", "is", "allowed"}, want: []bool{false, false, false}}, - "WithSomeAllowed": {allowedOperations: []string{"are"}, testOperations: []string{"some", "are", "allowed"}, want: []bool{false, true, false}}, - "WithAllAllowed": {allowedOperations: []string{"*"}, testOperations: []string{"all", "are", "allowed"}, want: []bool{true, true, true}}, - } - for name, testCase := range testCases { - t.Run(name, func(t *testing.T) { - filter := NewOperationsFilter(testCase.allowedOperations...) - for index, testOperation := range testCase.testOperations { - assert.Equal(t, testCase.want[index], filter.IsAllowed(testOperation)) - } - }) +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"]) } diff --git a/extension/agenthealth/handler/stats/handler_test.go b/extension/agenthealth/handler/stats/handler_test.go index f40bebd481..ae0612a10a 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -37,9 +37,12 @@ func TestStatsHandler(t *testing.T) { ThreadCount: aws.Int32(789), LatencyMillis: aws.Int64(1234), PayloadBytes: aws.Int(5678), - 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(), @@ -59,15 +62,9 @@ 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,"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)) -} - -func TestNewHandlers(t *testing.T) { - requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}) - assert.Len(t, requestHandlers, 2) - assert.Len(t, responseHandlers, 1) + 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)) } diff --git a/extension/agenthealth/handler/stats/provider/interval.go b/extension/agenthealth/handler/stats/provider/interval.go index bc5dc8e24e..d2ac2e57ab 100644 --- a/extension/agenthealth/handler/stats/provider/interval.go +++ b/extension/agenthealth/handler/stats/provider/interval.go @@ -4,6 +4,7 @@ package provider import ( + "log" "sync" "sync/atomic" "time" @@ -39,9 +40,23 @@ func (p *intervalStats) Stats(string) agent.Stats { func (p *intervalStats) getStats() agent.Stats { var stats agent.Stats + + // Load the value from the stats field if value := p.stats.Load(); value != nil { - stats = value.(agent.Stats) + // Perform type assertion safely + if s, ok := value.(agent.Stats); ok { + stats = s + } else { + // Handle the case where the value is not of the expected type + log.Println("Error: Loaded value is not of type agent.Stats") + } + } + + // Ensure that the map is not nil + if stats.StatusCodes == nil { + stats.StatusCodes = make(map[string][5]int) } + return stats } diff --git a/extension/agenthealth/handler/stats/provider/process_test.go b/extension/agenthealth/handler/stats/provider/process_test.go index 19fac625fb..ee31bbb2f8 100644 --- a/extension/agenthealth/handler/stats/provider/process_test.go +++ b/extension/agenthealth/handler/stats/provider/process_test.go @@ -11,8 +11,6 @@ import ( "github.com/shirou/gopsutil/v3/process" "github.com/stretchr/testify/assert" - - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) type mockProcessMetrics struct { @@ -77,6 +75,7 @@ func TestProcessStats(t *testing.T) { mock.mu.Unlock() provider.refresh() assert.Eventually(t, func() bool { - return provider.getStats() == agent.Stats{} + stats := provider.getStats() + return len(stats.StatusCodes) == 0 //map isn't comparable so we can just do this }, 5*time.Millisecond, time.Millisecond) } 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..b5b99c0eaa --- /dev/null +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -0,0 +1,30 @@ +package provider + +import ( + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestStatusCodeHandler(t *testing.T) { + // Create a mock OperationsFilter + filter := agent.NewStatusCodeOperationsFilter() + + // Retrieve the handler with the mock filter + handler := GetStatusCodeStats(filter) + require.NotNil(t, handler) + + handler.statsByOperation.Store("pmd", &[5]int{1, 2, 0, 1, 0}) + + stats := handler.Stats("pmd") + + expected := [5]int{1, 2, 0, 1, 0} + + actualStats := stats.StatusCodes["pmd"] + assert.Equal(t, expected, actualStats, "Unexpected stats values for operation 'pmd'") + + assert.Contains(t, stats.StatusCodes, "pmd", "Status code map should contain 'pmd'") + assert.Equal(t, expected, stats.StatusCodes["pmd"], "Stats for 'pmd' do not match") +} diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..78085fe975 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwd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grqS5LCW4BbUuSULHDTvrN5R/sR4LoQ95kVfQ +ht1M+E+Nl/jT1jt2EpWzIrkoXJ2DIx7kYroKjQ5Xr2JSBe7R67DBsy1M+NMCzg9O +OPsj/SeVysH6o98IRGVB8v9LZ15Co+ztp2tAKn8sY9Wo4mNsbYHIW62jNzn0oOee +eYVg/mBRFD/0pH6fvFzWU4VTMonC1oRNiOJCiZnni/ZeR3QIFuHYoj6GEuCaPEtu +k9/oWm3L7otVvvoU11YxIZuCgX8yYjXonAF+XBDaT7dUza07tn9Luh9+MOOkbB5w +OOtoR1o4Q2BvxVyroNeT2/mbKex7AQwXGfoSAnY7KkBZOQbxQX7hnhR/76904ZNL +q6DGI9HBeN7KwwrObil0RhEJH9/JJ1ugA31ObvtIJxkUAdpJ5oytN9Tmf00rXp5/ +fwX4De9DlqKyaKa+0PglzObv8EaczMrjv2A2/TS7EZblZ2WBqQ3Hpevy2oBKH+4J +WeG8aZep3pTWgwq7D/Z+zgP5ur7ZC7DoRP3rJ2HqRXh7Mrgk3WccAzqFaXE= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..9184b71478 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHn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gckOSncwZaz81aOB+JptOouTuR3DtI/xEKgPjhLVGTj24mW2qRJy8/5wdETXk +Dlp2eeWjYBxb0u3gcTOV0lCBSdMCgYEA71d7BmPQr1MKyHoZFTMfRSnqGonfruWr +ALaMDz3pX62Qwsh0rkEI0bCg60I/oXbnz/QUjr1ukJ//GN3ZRDlo2pK52WuyVFLZ +U0Br1PDR7kAA6SjJEnSl4Nq+0vW85BNz/drnXMbWPUGWDKP3NwxTBe3+Oh9IffGW +Puvif3pdEu0CgYEAt8KACs2bn885BuAD66aaSCYc3xUQuvGlQ54balu8bsOXDjHh +zl9vQbMrL0H4WHF7xGQLNX3FlvBuNERdl1K+E0GiIT6v2jTUHKVZqduTqDsv930Y +AUuiCFaralKiEr59TI99AejSkFMy4TwYuLVafvfDE5Ciy3/OgFwrSWQNIEkCgYBS +BT2wy+YJH0EzwLv1yuYtcpa6b4NLUYOPo/9Nfd8LHdTdG4r46GqYSZpr5PEfaTs5 +xaCB5iMMxvfJ0sURH0dymBO+kay0Pwwg/pO1jq2yoxZs0MBPZdAuxWfdrb8EvjHi +zfC5l551sZM1U791ivCsuImF65CRMIhXmcit/QYGZQKBgQDnCTp/M0bq7WQvsE5B +SEuHqNAOLzeE8I83/KxzRiraacioaKYFVzPiEabVhOBARi432Pe+hgl1ysR9qAJd +74N80fg9vQ58920GZ3pbTDmo9xHZ2pouoWhR+OjIYnKcdvjkDsY5K0UzMTYdcLER +g8yfaFM5NveYWl7HPOKpYB+cmA== -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..a81899d32a 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEj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j2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso -kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto -onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g -XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g -qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= +BBQJ8MOtObDAQTqAg/456ZAkQE0cDjANBgkqhkiG9w0BAQsFAAOCAgEAZxHDqHNZ +9Dq6jJ8lNPRCMyhNk+m6y8p8xdrGey0GJXKecMHzcBARVFCtBViavC67mUxIU6lb +Y+3MISAMBQVTKA/dVaYN6ZZMFzWWulujP+GQLdON+ILNqbNT1ktoCKBtWoJm3HGj +NbqoWtFKZDfzcZwyHek8Wl43doX1d+bj1s8DDR/15tsFTt4j8ux4kBTfyBAZ6a/k +t04WPg97nPOJY3FvULAY2q5IoQuZ/9bJoScPiR4oxi/RuzsL5caZrcXnp6MwFwIh ++0w2G8THFFI84527a9buRXwWoXWFMv2097VBXez1U2v10anXMDcgOq0vbi78f4mH +S/fRc3MPBJ1XRa25Miu/yaG1SJq4FeIZeFZhjRW2G2o8jg0pP//+By1vB6O1aA1F +R40d+CzUKG5pmg7m4KlMhpRe+VKBfaMK0XfU1ToXUiqOanq6pIc1wfxYqyXdhKCF +j5v9QnuB1WD1e0gcvjCq806tT+yGo6DkHeuGE6WlY0F8MxeClrbZyeTCAk+5sJ43 +vE3FsGt+DbqJeLBKLK4qIgK1E9G+eaqe3qFAo18L9gsc+k8u88Kqcw0J829WoZ3q +qfIqjX60oaYE5rkECJLyS8FOkaO9I0eejcaZlNigI2cLn1EYAbDFW93gCOto992b +XadrKpgssBTm6pfgeMzKS+eH8bq5zfotx9s= -----END CERTIFICATE----- diff --git a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml index 618e81c072..d928ab262d 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -1,255 +1,256 @@ exporters: - awscloudwatchlogs/emf_logs: - certificate_file_path: /etc/test/ca_bundle.pem - emf_only: true - endpoint: https://fake_endpoint - imds_retries: 1 - local_mode: false - log_group_name: emf/logs/default - log_retention: 0 - log_stream_name: host_name_from_env - max_retries: 2 - middleware: agenthealth/logs - no_verify_ssl: false - num_workers: 8 - profile: "" - proxy_address: "" - raw_log: true - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - retry_on_failure: - enabled: true - initial_interval: 5s - max_elapsed_time: 5m0s - max_interval: 30s - multiplier: 1.5 - randomization_factor: 0.5 - role_arn: "" - sending_queue: - enabled: true - num_consumers: 1 - queue_size: 1000 - awsemf/containerinsights: - certificate_file_path: /etc/test/ca_bundle.pem - 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" + awscloudwatchlogs/emf_logs: + certificate_file_path: /etc/test/ca_bundle.pem + emf_only: true + endpoint: https://fake_endpoint + imds_retries: 1 + local_mode: false + log_group_name: emf/logs/default + log_retention: 0 + log_stream_name: host_name_from_env + max_retries: 2 + middleware: agenthealth/logs + no_verify_ssl: false + num_workers: 8 + profile: "" + proxy_address: "" + raw_log: true + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + retry_on_failure: + enabled: true + initial_interval: 5s + max_elapsed_time: 5m0s + max_interval: 30s + multiplier: 1.5 + randomization_factor: 0.5 + role_arn: "" + sending_queue: + enabled: true + num_consumers: 1 + queue_size: 1000 + awsemf/containerinsights: + certificate_file_path: /etc/test/ca_bundle.pem + 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" extensions: - agenthealth/logs: - is_usage_data_enabled: true - stats: - operations: - - PutLogEvents - usage_flags: - mode: EC2 - region_type: ACJ - entitystore: - mode: ec2 - region: us-east-1 + agenthealth/logs: + is_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: EC2 + region_type: ACJ + entitystore: + mode: ec2 + region: us-east-1 processors: - batch/containerinsights: - metadata_cardinality_limit: 1000 - send_batch_max_size: 0 - send_batch_size: 8192 - timeout: 5s - batch/emf_logs: - metadata_cardinality_limit: 1000 - send_batch_max_size: 0 - send_batch_size: 8192 - timeout: 5s + batch/containerinsights: + metadata_cardinality_limit: 1000 + send_batch_max_size: 0 + send_batch_size: 8192 + timeout: 5s + batch/emf_logs: + metadata_cardinality_limit: 1000 + send_batch_max_size: 0 + send_batch_size: 8192 + timeout: 5s 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: true - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 0 - resource_arn: "" - role_arn: "" - tcplog/emf_logs: - encoding: utf-8 - id: tcp_input - listen_address: 0.0.0.0:25888 - operators: [] - retry_on_failure: - enabled: false - initial_interval: 0s - max_elapsed_time: 0s - max_interval: 0s - type: tcp_input - udplog/emf_logs: - encoding: utf-8 - id: udp_input - listen_address: 0.0.0.0:25888 - multiline: - line_end_pattern: .^ - line_start_pattern: "" - omit_pattern: false - operators: [] - retry_on_failure: - enabled: false - initial_interval: 0s - max_elapsed_time: 0s - max_interval: 0s - type: udp_input + 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: true + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 0 + resource_arn: "" + role_arn: "" + tcplog/emf_logs: + encoding: utf-8 + id: tcp_input + listen_address: 0.0.0.0:25888 + operators: [] + retry_on_failure: + enabled: false + initial_interval: 0s + max_elapsed_time: 0s + max_interval: 0s + type: tcp_input + udplog/emf_logs: + encoding: utf-8 + id: udp_input + listen_address: 0.0.0.0:25888 + multiline: + line_end_pattern: .^ + line_start_pattern: "" + omit_pattern: false + operators: [] + retry_on_failure: + enabled: false + initial_interval: 0s + max_elapsed_time: 0s + max_interval: 0s + type: udp_input service: - extensions: - - agenthealth/logs - - entitystore - pipelines: - logs/emf_logs: - exporters: - - awscloudwatchlogs/emf_logs - processors: - - batch/emf_logs - receivers: - - tcplog/emf_logs - - udplog/emf_logs - metrics/containerinsights: - exporters: - - awsemf/containerinsights - processors: - - batch/containerinsights - receivers: - - awscontainerinsightreceiver - 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 + - entitystore + pipelines: + logs/emf_logs: + exporters: + - awscloudwatchlogs/emf_logs + processors: + - batch/emf_logs + receivers: + - tcplog/emf_logs + - udplog/emf_logs + metrics/containerinsights: + exporters: + - awsemf/containerinsights + processors: + - batch/containerinsights + receivers: + - awscontainerinsightreceiver + 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: {} From 822680faa182506e96c18c292dde95e697f9cc4b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 15:48:51 -0500 Subject: [PATCH 25/91] fixing test --- internal/tls/testdata/server.crt | 42 +- internal/tls/testdata/server.key | 52 +- internal/tls/testdata/tls-ca.crt | 50 +- .../sampleConfig/base_appsignals_config.yaml | 1163 +++++++++-------- .../base_container_insights_config.yaml | 501 ++++--- .../otel/pipeline/host/translator.go | 4 +- 6 files changed, 913 insertions(+), 899 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 78085fe975..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQddgi32E7oVLwIASrhGtTLzANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTExNTIyMjE1M1oXDTI0MTExNTIzMjE1 -M1owFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANtYQZdKnNhTKWrtEhJDGzmsKsC06haQGEBRXg+BOENj7OVK9PLr -cSwhwmCfGNGkB1vVKZ0SkeNiiMCtqWJme4hDgKPWeRA6CeoI1TsKPt/9HRnZWV+8 -rONt/1SMCTnBE/ZZgJkJVtj4m+trNlEWoz2gdgqvqhIPqi1ex1RlKrXHa/Iqk+WR -yRYcazEpLiFOm4PbGB1FaEH/gPTg67z9bgps9u1Kco07o3j92F/Aoy+1ecJsJnYF -43R3u1zMMTpPnSVriG14mgMcduQKbwVX+IbPJkgiFQv01nu403WIt1RyOUq9NSLh -CvbYkyZKtatLX9J+mhSoLc98BxA/MP6JLlcCAwEAAaNnMGUwDgYDVR0PAQH/BAQD +MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS +MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz +NlowFTETMBEGA1UEChMKS3ViZXJ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ZNL -q6DGI9HBeN7KwwrObil0RhEJH9/JJ1ugA31ObvtIJxkUAdpJ5oytN9Tmf00rXp5/ -fwX4De9DlqKyaKa+0PglzObv8EaczMrjv2A2/TS7EZblZ2WBqQ3Hpevy2oBKH+4J -WeG8aZep3pTWgwq7D/Z+zgP5ur7ZC7DoRP3rJ2HqRXh7Mrgk3WccAzqFaXE= +FoAUhscCtqKglSlRCx9YNN1D/Xz5MpMwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG +9w0BAQsFAAOCAgEAcxCGmWNtuM9V2yi0SOSLfxlSK7F1OS5qQuLWkZSDB1f+XG82 +PNDwSrV4J42qZcFfKrEt1HtS/Ws6VRlLrSnYArNSyQvNTeNf0q/rX9yO8wRcCM5K +sb8uv27xdawjN6F3z59rpJOf9ldX4ASrRZHzX/ttvvNcUdbCZsF5+h2EhcwNVVUa +Q6vlAW8u4Ik9HXxJ+W2HEdlSYWcCdTK4hDCtJhwqEBua1VdKwSdrlDZJPswAdCzv +CR3Fj4NsmPRDw8uCPIL4hwk5fbffcn3rZrsOXSMTKxvdyP+XBPKWEoIs6cxvdE3o +sG65EZeGpj0vLN+rLEbumkvgCAHACgVxvyDeJnajoA6lPNxfzby+9CmhLZfgaVbE +nVQTj8hkUW1gtvnAP3v1Zbe3QMhlqWqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 9184b71478..0efcb40bb3 100644 --- a/internal/tls/testdata/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NSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index a81899d32a..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTExNTIyMjE1NloXDTM0MTExNTIyMjE1NlowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKE02JUhofLV -qg7y+e9SHvXJE3VJZPGlOQb/bdwpA9IThlillTH1GRQW6xyohNBARBVPr+u6d2TQ -yIyl54he8iLppNR/DKMJH6ufqnl8scKbRAxYWgEC0/LJBgXrTxtewpPaH9lZrSae -VUOmzdDCRWmvGqfymBwsziUqPFuyhxXXM38SBPwZzf9vq0ma3fbg/k0iU7chF9Zy -Cyw4r0iQUiAqvMEcwZw3l3JYywk38GJfpLplqSDaf3/2GawRgFdL7VNNwXita+je -UL29di1OfkMspAcE4ANPeglvKHPStjcCHDK/+Hpqj+hq4tQLMyUYm4lDN9R4gzGt -cnEGaVjVhD2auaCHzilOlh9hb0bQoY0v3htjwRtiGwJFt6aWPMq57eTAfHuVdNyv -mOq3Pib7d+e6Q6jZKjXeFVn7IR5f4Sb8t3sBSbBqhZAJON+98WBVyUzav8/yurkw -8JlGxPiOoszmaB4t73gr4A3b0JROoUCeDD8NItf+ULSnF9+a2CIMphlRye8XrOKW -gIaX38vYryTnxTV3Vj/VzIN8X8iSG0SgC7yQ3IWqSSa0pMRvxn70yTcOuokUJF3+ -1RGy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/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 24afc038e6..36f817297d 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -15,73 +15,74 @@ exporters: 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 - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - - RemoteService + - - Environment + - Operation + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - 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$' + regex: ^RuntimeMetric$ separator: ; metric_name_selectors: - - '^.*$' + - ^.*$ middleware: agenthealth/logs namespace: ApplicationSignals no_verify_ssl: false @@ -135,6 +136,7 @@ exporters: verbosity: Detailed extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -143,6 +145,7 @@ extensions: mode: OP region_type: ACJ agenthealth/traces: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -175,857 +178,869 @@ processors: 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 + - action: update aggregation_type: "" - submatch_case: "" + include: jvm.cpu.recent_utilization match_type: "" + new_name: JVMCpuRecentUtilization operations: - action: aggregate_labels - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" 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: "" + 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 - label_set: [ ] aggregation_type: sum experimental_scale: 0 label: "" - new_label: "" + label_set: [] label_value: "" + new_label: "" new_value: "" - action: add_label - new_label: Telemetry.Source - new_value: RuntimeMetric 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 receivers: otlp/application_signals: protocols: @@ -1089,4 +1104,4 @@ service: metrics: address: "" level: None - traces: {} + traces: {} \ No newline at end of file diff --git a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml index d928ab262d..618e81c072 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -1,256 +1,255 @@ exporters: - awscloudwatchlogs/emf_logs: - certificate_file_path: /etc/test/ca_bundle.pem - emf_only: true - endpoint: https://fake_endpoint - imds_retries: 1 - local_mode: false - log_group_name: emf/logs/default - log_retention: 0 - log_stream_name: host_name_from_env - max_retries: 2 - middleware: agenthealth/logs - no_verify_ssl: false - num_workers: 8 - profile: "" - proxy_address: "" - raw_log: true - region: us-east-1 - request_timeout_seconds: 30 - resource_arn: "" - retry_on_failure: - enabled: true - initial_interval: 5s - max_elapsed_time: 5m0s - max_interval: 30s - multiplier: 1.5 - randomization_factor: 0.5 - role_arn: "" - sending_queue: - enabled: true - num_consumers: 1 - queue_size: 1000 - awsemf/containerinsights: - certificate_file_path: /etc/test/ca_bundle.pem - 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" + awscloudwatchlogs/emf_logs: + certificate_file_path: /etc/test/ca_bundle.pem + emf_only: true + endpoint: https://fake_endpoint + imds_retries: 1 + local_mode: false + log_group_name: emf/logs/default + log_retention: 0 + log_stream_name: host_name_from_env + max_retries: 2 + middleware: agenthealth/logs + no_verify_ssl: false + num_workers: 8 + profile: "" + proxy_address: "" + raw_log: true + region: us-east-1 + request_timeout_seconds: 30 + resource_arn: "" + retry_on_failure: + enabled: true + initial_interval: 5s + max_elapsed_time: 5m0s + max_interval: 30s + multiplier: 1.5 + randomization_factor: 0.5 + role_arn: "" + sending_queue: + enabled: true + num_consumers: 1 + queue_size: 1000 + awsemf/containerinsights: + certificate_file_path: /etc/test/ca_bundle.pem + 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" extensions: - agenthealth/logs: - is_status_code_only: false - is_usage_data_enabled: true - stats: - operations: - - PutLogEvents - usage_flags: - mode: EC2 - region_type: ACJ - entitystore: - mode: ec2 - region: us-east-1 + agenthealth/logs: + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: EC2 + region_type: ACJ + entitystore: + mode: ec2 + region: us-east-1 processors: - batch/containerinsights: - metadata_cardinality_limit: 1000 - send_batch_max_size: 0 - send_batch_size: 8192 - timeout: 5s - batch/emf_logs: - metadata_cardinality_limit: 1000 - send_batch_max_size: 0 - send_batch_size: 8192 - timeout: 5s + batch/containerinsights: + metadata_cardinality_limit: 1000 + send_batch_max_size: 0 + send_batch_size: 8192 + timeout: 5s + batch/emf_logs: + metadata_cardinality_limit: 1000 + send_batch_max_size: 0 + send_batch_size: 8192 + timeout: 5s 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: true - profile: "" - proxy_address: "" - region: us-east-1 - request_timeout_seconds: 0 - resource_arn: "" - role_arn: "" - tcplog/emf_logs: - encoding: utf-8 - id: tcp_input - listen_address: 0.0.0.0:25888 - operators: [] - retry_on_failure: - enabled: false - initial_interval: 0s - max_elapsed_time: 0s - max_interval: 0s - type: tcp_input - udplog/emf_logs: - encoding: utf-8 - id: udp_input - listen_address: 0.0.0.0:25888 - multiline: - line_end_pattern: .^ - line_start_pattern: "" - omit_pattern: false - operators: [] - retry_on_failure: - enabled: false - initial_interval: 0s - max_elapsed_time: 0s - max_interval: 0s - type: udp_input + 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: true + profile: "" + proxy_address: "" + region: us-east-1 + request_timeout_seconds: 0 + resource_arn: "" + role_arn: "" + tcplog/emf_logs: + encoding: utf-8 + id: tcp_input + listen_address: 0.0.0.0:25888 + operators: [] + retry_on_failure: + enabled: false + initial_interval: 0s + max_elapsed_time: 0s + max_interval: 0s + type: tcp_input + udplog/emf_logs: + encoding: utf-8 + id: udp_input + listen_address: 0.0.0.0:25888 + multiline: + line_end_pattern: .^ + line_start_pattern: "" + omit_pattern: false + operators: [] + retry_on_failure: + enabled: false + initial_interval: 0s + max_elapsed_time: 0s + max_interval: 0s + type: udp_input service: - extensions: - - agenthealth/logs - - entitystore - pipelines: - logs/emf_logs: - exporters: - - awscloudwatchlogs/emf_logs - processors: - - batch/emf_logs - receivers: - - tcplog/emf_logs - - udplog/emf_logs - metrics/containerinsights: - exporters: - - awsemf/containerinsights - processors: - - batch/containerinsights - receivers: - - awscontainerinsightreceiver - 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 + - entitystore + pipelines: + logs/emf_logs: + exporters: + - awscloudwatchlogs/emf_logs + processors: + - batch/emf_logs + receivers: + - tcplog/emf_logs + - udplog/emf_logs + metrics/containerinsights: + exporters: + - awsemf/containerinsights + processors: + - batch/containerinsights + receivers: + - awscontainerinsightreceiver + 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/translate/otel/pipeline/host/translator.go b/translator/translate/otel/pipeline/host/translator.go index 796662806a..17793b23da 100644 --- a/translator/translate/otel/pipeline/host/translator.go +++ b/translator/translate/otel/pipeline/host/translator.go @@ -104,7 +104,7 @@ func (t translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators, switch t.Destination() { case common.DefaultDestination, common.CloudWatchKey: translators.Exporters.Set(awscloudwatch.NewTranslator()) - translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeMetrics, []string{"*"})) + translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeMetrics, []string{agenthealth.OperationPutMetricData})) case common.AMPKey: if conf.IsSet(common.MetricsAggregationDimensionsKey) { translators.Processors.Set(rollupprocessor.NewTranslator()) @@ -115,7 +115,7 @@ func (t translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators, case common.CloudWatchLogsKey: translators.Processors.Set(batchprocessor.NewTranslatorWithNameAndSection(t.name, common.LogsKey)) translators.Exporters.Set(awsemf.NewTranslator()) - translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeLogs, []string{"*"})) + translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeLogs, []string{agenthealth.OperationPutLogEvents})) default: return nil, fmt.Errorf("pipeline (%s) does not support destination (%s) in configuration", t.name, t.Destination()) } From d547e1cbd8bf85ef85605fc56b9da1f1ac26bb51 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 16:37:36 -0500 Subject: [PATCH 26/91] fixing unit tests --- internal/tls/testdata/server.crt | 44 +- internal/tls/testdata/server.key | 52 +- internal/tls/testdata/tls-ca.crt | 50 +- .../sampleConfig/advanced_config_darwin.yaml | 5 +- .../sampleConfig/advanced_config_linux.yaml | 9 +- .../sampleConfig/advanced_config_windows.yaml | 5 +- .../sampleConfig/amp_config_linux.yaml | 327 +-- .../appsignals_and_ecs_config.yaml | 1394 ++++----- .../appsignals_and_eks_config.yaml | 1163 ++++---- .../appsignals_and_k8s_config.yaml | 1167 ++++---- .../appsignals_fallback_and_eks_config.yaml | 2591 +++++++++-------- .../appsignals_over_fallback_config.yaml | 2591 +++++++++-------- .../sampleConfig/base_appsignals_config.yaml | 896 +++--- .../base_appsignals_fallback_config.yaml | 2177 +++++++------- .../base_container_insights_config.yaml | 5 +- .../sampleConfig/basic_config_linux.yaml | 3 +- .../sampleConfig/basic_config_windows.yaml | 5 +- .../sampleConfig/collectd_config_linux.yaml | 3 +- .../sampleConfig/compass_linux_config.yaml | 5 +- .../sampleConfig/complete_darwin_config.yaml | 27 +- .../sampleConfig/complete_linux_config.yaml | 39 +- .../sampleConfig/config_with_env.yaml | 1 + .../sampleConfig/container_insights_jmx.yaml | 5 +- .../sampleConfig/delta_config_linux.yaml | 15 +- .../sampleConfig/delta_net_config_linux.yaml | 5 +- .../sampleConfig/drop_origin_linux.yaml | 11 +- .../emf_and_kubernetes_config.yaml | 3 +- .../emf_and_kubernetes_with_gpu_config.yaml | 187 +- .../ignore_append_dimensions.yaml | 3 +- .../sampleConfig/invalid_input_linux.yaml | 1 + .../sampleConfig/jmx_config_linux.yaml | 13 +- .../sampleConfig/jmx_eks_config_linux.yaml | 7 +- .../kubernetes_on_prem_config.yaml | 5 +- .../sampleConfig/log_ecs_metric_only.yaml | 1 + .../tocwconfig/sampleConfig/log_filter.yaml | 64 +- .../sampleConfig/log_only_config_windows.yaml | 64 +- .../logs_and_kubernetes_config.yaml | 6 +- .../sampleConfig/no_skip_log_timestamp.yaml | 64 +- .../no_skip_log_timestamp_windows.yaml | 64 +- .../otlp_metrics_cloudwatchlogs_config.yaml | 243 +- .../sampleConfig/otlp_metrics_config.yaml | 211 +- .../procstat_memory_swap_config.yaml | 115 +- .../sampleConfig/prometheus_config_linux.yaml | 1 + .../prometheus_config_windows.yaml | 1 + .../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 | 5 +- ...ndard_config_linux_with_common_config.yaml | 5 +- .../sampleConfig/standard_config_windows.yaml | 3 +- ...ard_config_windows_with_common_config.yaml | 7 +- .../sampleConfig/statsd_config_linux.yaml | 3 +- .../sampleConfig/statsd_config_windows.yaml | 3 +- .../sampleConfig/statsd_ecs_config.yaml | 93 +- .../sampleConfig/statsd_eks_config.yaml | 115 +- .../sampleConfig/trace_config_linux.yaml | 1 + .../sampleConfig/trace_config_windows.yaml | 1 + .../windows_eventlog_only_config.yaml | 18 +- translator/tocwconfig/tocwconfig_test.go | 3 +- 60 files changed, 7141 insertions(+), 7020 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..ea76fdfd7b 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCg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I +hvcNAQELBQADggIBAALYTNCcFEJnSIUL81+Fxb0U9KgdNwhJfou5WTgRSFqLwuJf +hYfzSHCZYQbANb93o7jsa0cj2Wqj8jL+UEhGLLXg6jLUGdG93WoVCtO2FchwWoay +6trRPJ0aHzfhKLZzU4cVp649iygbs5RFNbjMz+ehpC2FOizjA+2zysPchJ9xYCUl +0vYnm6XlzPegIQPNpdZNYHsOWVgeNgWjAcMVoenpBbqhYIEypZ3WnNqRxxrUwCLF +zB+TopgTnhmvMs3AtGzpZiqOdWxOQE7YMH6WDZFGGZ0B/I8dcDJiVhcd9EA+09F4 +ubX4CW0BCA92m9P7XgeE3oZouZztHSp64oaeasskucV8yOl2LhlofCoMKgMo2cgp +XscMQL15+I+RNtTRNB/eoGiIfjHJgTxWkYmfHT1zJrKAPUrVYLzybrTuquKNkpOm +m+1+x5hux/CXXXFxkr0QIl8IeL4Ca1ibTuHrTYNunMq1d0gL5WsRerg2MMXdY2MW ++Yubjna8tpNeFjaxmdb9+p9rVDdPfyttrLXq3ZTbams+43O00l3NDiVGZFRQzLF7 +GoqyHDOuUPY/0vGQAveDA0MsPlgp0vSehl2WnwNFoYiLJpF/Ls7Kfki1FGNsWCBL +lNkxboFTrq7LmvUHUD7ohYhtVC6/kyy/9+lb+KrzPOWKtvI5qckAwqX6Z7uK -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..3673072582 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7X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XAy1nUryFvjA3ASSgzxPFSull8Wlmi7tbS8iAnqyoQKBgQDj8U9gfzkOsSoQN4fe +FU4Ei4uk93KGQe32w1mEa674y128LUHeqrPwUotrNsuppbbM1mArc3GiKJEfww2H +xvR4bOGVBcOm/P+rtJMqlyZhGAd1i5HsMsuCHlovq47Pg/wdtTEnfnkNhe925JTr +3IpR69cymS+Q3OkJCrMLxxS+sQKBgQD+wcG/RbmGa1hUkLKPLL3jpDgZoSTvkajm +YXK8xLAwmU62pVnOuVNtPET3QwOg/YgeVx1h8lVV6ASRscdZpS4IcTIlxD6/MfQq +tv448kzET5CKRAEbv4nufc6Gs1Hdlb6V9PwG70gGdenKpc04lFIIFtie5S+MIdXO +D3jR3VrrgwKBgQDV/fd9KjMQvfY1X0yoi+vAjJk++CeGL2MN5PunO8j6PUH0pbBP +MIbZOUU2FC1DSRXCXAfRAwJNMDR+UwnizD86x01IMC8sGByWwGHg/CHFyV9HVQ5b +ZpxzvbcBRdg+rTQFV9ObtjpDHdhgD9xXSaZ5niVblUB4iUwlduv8RJwPIQKBgDow +FUnT6ik6sYU3O6GaLZEmPC4WcXJKydI9JdDZ+AhRq/np0JZ4HAcSQgpcAyMtZX7Q +lQR/LmCdyxVgDtF5+gaxnCumJFLVXRi4jV6CcWhRaAk8uSgWWrHfiGGZ6bP79PkZ +aMtIsiHPouPHdRVcQ1RXq4i3fmG6hLQ5MnZ04cRzAoGAJfOfYNOvI0LGZmjd5VtZ +S7ptY0NOeDSD9w9qvtCewstRaSMZCW+L4FcuNMJ/o9aa5qcNewq4NwT0RTXGjCzD +W5z8A3L5WNp7TR2wXrFy8+xU6fiIFYOFKY86eixHC7+PyueDT7140wRKBU5+7Uti +T8X9YtJowPDgRhh/SHWvkq8= -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..1c22e4a6c1 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @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5aisr +YWRaXIXWgSe1aNDlV+nLo9t/Hv6tcGUSnpdRSy4X8lBMw1DDLp4NwCcrDmNAE6hX +cIo7pbgTZEBHHpzcKB+3sKb5Q0J4f7SqPyk= -----END CERTIFICATE----- diff --git a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml index 64d81aaa17..d5fa199e7c 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -80,11 +81,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_disk + - telegraf_mem - telegraf_netstat - telegraf_swap - telegraf_cpu - - telegraf_mem + - telegraf_disk metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml index b202e49fd9..addecabd25 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,7 +24,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict @@ -88,13 +89,13 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_cpu - - telegraf_disk - - telegraf_mem - telegraf_netstat - telegraf_swap - telegraf_ethtool - telegraf_nvidia_smi + - telegraf_cpu + - telegraf_disk + - telegraf_mem metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml index 0b7068462e..35ccae8ff9 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -28,9 +29,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: @@ -81,13 +82,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..f17a3e72cc 100644 --- a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml @@ -1,168 +1,169 @@ 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_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - '*' + 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: + - InstanceId + - InstanceType + - ImageId + 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: [] 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 + - 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 a97027c87f..8e083a6072 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml @@ -1,106 +1,106 @@ 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 - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - - RemoteService + - - Environment + - Operation + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - 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: @@ -117,17 +117,18 @@ 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 extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -136,6 +137,7 @@ extensions: mode: EC2 region_type: ACJ agenthealth/traces: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -144,18 +146,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: @@ -165,8 +167,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: @@ -199,11 +777,11 @@ processors: host.name: enabled: true tags: [] - compression: '' + compression: "" consul: - address: '' - datacenter: '' - namespace: '' + address: "" + datacenter: "" + namespace: "" resource_attributes: cloud.region: enabled: true @@ -211,7 +789,7 @@ processors: enabled: true host.name: enabled: true - token_file: '' + token_file: "" detectors: - env - ecs @@ -244,7 +822,7 @@ processors: host.type: enabled: true tags: - - '^aws:autoscaling:groupName' + - ^aws:autoscaling:groupName ecs: resource_attributes: aws.ecs.cluster.arn: @@ -255,10 +833,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: @@ -297,7 +875,7 @@ processors: enabled: true service.version: enabled: true - endpoint: '' + endpoint: "" gcp: resource_attributes: cloud.account.id: @@ -357,9 +935,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 @@ -387,7 +965,7 @@ processors: enabled: true max_idle_conns: 100 openshift: - address: '' + address: "" resource_attributes: cloud.platform: enabled: true @@ -398,19 +976,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: @@ -442,631 +1020,55 @@ 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: @@ -1105,6 +1107,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..609149736b 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 @@ -266,6 +267,7 @@ exporters: include_metadata: true extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -274,6 +276,7 @@ extensions: mode: EKS region_type: ACJ agenthealth/traces: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -295,14 +298,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 +327,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 +1190,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 diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index 5b099d0315..e82573525c 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 @@ -267,6 +268,7 @@ exporters: transit_spans_in_otlp_format: true extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -275,6 +277,7 @@ extensions: mode: K8E region_type: ACJ agenthealth/traces: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -296,14 +299,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 +316,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 +328,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 +1191,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 diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index bfcea74610..609149736b 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -1,1294 +1,1309 @@ 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_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: EKS + region_type: ACJ + agenthealth/traces: + is_status_code_only: false + 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: + - 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: {} diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index 454a1bfa23..609149736b 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -1,1294 +1,1309 @@ 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_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: EKS + region_type: ACJ + agenthealth/traces: + is_status_code_only: false + 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: + - 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: {} diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 36f817297d..23b90150be 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -15,74 +15,74 @@ exporters: 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 - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - - RemoteService + - - Environment + - Operation + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - 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 @@ -186,21 +186,21 @@ processors: 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 + - 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: "" @@ -208,21 +208,21 @@ processors: 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 + - 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: "" @@ -230,21 +230,21 @@ processors: 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 + - 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: "" @@ -252,21 +252,21 @@ processors: 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 + - 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: "" @@ -274,21 +274,21 @@ processors: 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 + - 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: "" @@ -296,21 +296,21 @@ processors: 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 + - 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: "" @@ -318,93 +318,93 @@ processors: 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 + - 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$ + 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 + - 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$ + 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 + - 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$ + 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 + - 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: "" @@ -412,21 +412,21 @@ processors: 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 + - 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: "" @@ -434,117 +434,117 @@ processors: 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 + - 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 + 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 + - 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 + 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 + - 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 + 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 + - 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 + 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 + - 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: "" @@ -552,93 +552,93 @@ processors: 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 + - 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" + 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 + - 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" + 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 + - 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" + 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 + - 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: "" @@ -646,21 +646,21 @@ processors: 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 + - 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: "" @@ -668,21 +668,21 @@ processors: 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 + - 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: "" @@ -690,69 +690,69 @@ processors: 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 + - 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 + 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 + - 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 + 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 + - 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: @@ -1104,4 +1104,4 @@ service: metrics: address: "" level: None - traces: {} \ No newline at end of file + traces: {} diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index 9791f903dd..dfe5442a0d 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -1,1086 +1,1101 @@ 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 - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - 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 + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - 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_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + usage_flags: + mode: OP + region_type: ACJ + agenthealth/traces: + is_status_code_only: false + 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/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..5c333f6a0e 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -141,6 +141,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -149,8 +150,8 @@ extensions: 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 diff --git a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml index 9a349c682e..74b74f384f 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -54,8 +55,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..69475eceb3 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,7 +24,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName @@ -56,8 +57,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_win_perf_counters/1492679118 - telegraf_win_perf_counters/4283769065 + - telegraf_win_perf_counters/1492679118 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml b/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml index a1ecf22c1e..c77a8271c3 100644 --- a/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,8 +24,8 @@ extensions: processors: awsentity/service/telegraf: entity_type: Service + platform: ec2 scrape_datapoint_attribute: true - platform: ec2 receivers: telegraf_socket_listener: collection_interval: 1m0s diff --git a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml index ab934cba89..3a4978afae 100644 --- a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml @@ -21,6 +21,7 @@ exporters: - [] extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -34,15 +35,15 @@ extensions: processors: awsentity/service/telegraf: entity_type: Service - scrape_datapoint_attribute: true platform: ec2 + scrape_datapoint_attribute: true ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index ec2a2d8994..444b4ad32f 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -68,6 +68,7 @@ exporters: include_metadata: true extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -76,6 +77,7 @@ extensions: mode: EC2 region_type: ACJ agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -84,6 +86,7 @@ extensions: mode: EC2 region_type: ACJ agenthealth/traces: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -100,8 +103,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,9 +129,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s transform: @@ -138,11 +141,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: @@ -275,13 +278,13 @@ service: - ec2tagger - transform receivers: - - telegraf_procstat/1917393364 - - telegraf_cpu + - telegraf_swap - telegraf_mem - telegraf_netstat + - telegraf_procstat/1917393364 - telegraf_processes - - telegraf_swap - telegraf_disk + - telegraf_cpu metrics/hostCustomMetrics: exporters: - awscloudwatch @@ -290,8 +293,8 @@ service: - ec2tagger - transform receivers: - - telegraf_socket_listener - telegraf_statsd + - telegraf_socket_listener metrics/hostDeltaMetrics: exporters: - awscloudwatch @@ -301,8 +304,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..e896c3799b 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -73,6 +73,7 @@ exporters: include_metadata: true extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -81,6 +82,7 @@ extensions: mode: EC2 region_type: ACJ agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -89,6 +91,7 @@ extensions: mode: EC2 region_type: ACJ agenthealth/traces: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -102,11 +105,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,9 +141,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceId - InstanceType - ImageId - - InstanceId imds_retries: 1 refresh_interval_seconds: 0s filter/jmx/0: @@ -189,11 +192,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 +205,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" + - set(unit, "unit") where name == "jvm.memory.heap.used" + - set(name, "JVM_MEM_HEAP_USED") where name == "jvm.memory.heap.used" trace_statements: [] transform/jmx/1: error_mode: propagate @@ -213,7 +216,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: @@ -381,13 +384,13 @@ service: - ec2tagger - transform receivers: - - telegraf_mem - - telegraf_netstat - - telegraf_procstat/1917393364 + - telegraf_processes + - telegraf_disk - telegraf_swap - telegraf_cpu - - telegraf_disk - - telegraf_processes + - telegraf_procstat/1917393364 + - telegraf_mem + - telegraf_netstat metrics/hostCustomMetrics/cloudwatch: exporters: - awscloudwatch @@ -396,8 +399,8 @@ service: - ec2tagger - transform receivers: - - telegraf_socket_listener - telegraf_statsd + - telegraf_socket_listener metrics/hostDeltaMetrics/cloudwatch: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/config_with_env.yaml b/translator/tocwconfig/sampleConfig/config_with_env.yaml index c776e99d76..1dbc4af2a9 100644 --- a/translator/tocwconfig/sampleConfig/config_with_env.yaml +++ b/translator/tocwconfig/sampleConfig/config_with_env.yaml @@ -32,6 +32,7 @@ exporters: queue_size: 1000 extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml index 28be63530c..68bdd27edb 100644 --- a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml +++ b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml @@ -175,6 +175,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -183,8 +184,8 @@ extensions: 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 diff --git a/translator/tocwconfig/sampleConfig/delta_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_config_linux.yaml index 6a27ffc90d..31be834b11 100644 --- a/translator/tocwconfig/sampleConfig/delta_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_config_linux.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,7 +24,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict @@ -50,12 +51,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: diff --git a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml index f6601c168d..c832e86571 100644 --- a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,7 +24,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: "" @@ -35,9 +36,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml index a458852b8e..0bf0648499 100644 --- a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml +++ b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml @@ -15,6 +15,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -28,7 +29,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName @@ -45,9 +46,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: @@ -75,9 +76,9 @@ service: - ec2tagger - transform receivers: + - telegraf_disk - telegraf_nvidia_smi - telegraf_cpu - - telegraf_disk 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 18e4401d58..d4b5e54ae3 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml @@ -134,9 +134,9 @@ exporters: - pod_memory_request - pod_memory_limit - pod_cpu_limit + - pod_cpu_request - pod_cpu_usage_total - pod_memory_working_set - - pod_cpu_request - pod_container_status_running - pod_container_status_terminated - pod_container_status_waiting @@ -391,6 +391,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: 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..f6d5e43542 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 @@ -649,6 +649,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -685,9 +686,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: container_gpu_memory_used + new_name: container_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -706,9 +707,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: pod_gpu_memory_used + new_name: pod_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -727,9 +728,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: node_gpu_memory_used + new_name: node_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -748,9 +749,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_TOTAL + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: container_gpu_memory_total + new_name: container_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -759,19 +760,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_TOTAL + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: pod_gpu_memory_total + new_name: pod_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -780,19 +774,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_TOTAL + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: node_gpu_memory_total + new_name: node_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -801,19 +788,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_GPU_TEMP + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: container_gpu_temperature + new_name: container_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -825,9 +805,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: pod_gpu_temperature + new_name: pod_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -839,9 +819,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: node_gpu_temperature + new_name: node_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -853,9 +833,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: container_gpu_power_draw + new_name: container_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -867,9 +847,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: pod_gpu_power_draw + new_name: pod_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -881,9 +861,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: node_gpu_power_draw + new_name: node_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -895,9 +875,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_UTIL + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: container_gpu_utilization + new_name: container_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -906,12 +886,19 @@ 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_GPU_UTIL + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: pod_gpu_utilization + new_name: pod_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -920,12 +907,19 @@ 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_GPU_UTIL + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: node_gpu_utilization + new_name: node_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -934,12 +928,19 @@ 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_PERCENT + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: container_gpu_memory_utilization + new_name: container_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -950,7 +951,7 @@ processors: new_value: ContainerGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 100 + experimental_scale: 1.048576e+06 label: "" label_value: "" new_label: "" @@ -958,9 +959,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: pod_gpu_memory_utilization + new_name: pod_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -971,7 +972,7 @@ processors: new_value: PodGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 100 + experimental_scale: 1.048576e+06 label: "" label_value: "" new_label: "" @@ -979,9 +980,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: node_gpu_memory_utilization + new_name: node_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -992,7 +993,7 @@ processors: new_value: NodeGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 100 + experimental_scale: 1.048576e+06 label: "" label_value: "" new_label: "" @@ -1000,37 +1001,44 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuron_hardware + include: neuroncore_memory_usage_model_code match_type: "" - new_name: neuron_hardware + new_name: neuroncore_memory_usage_model_code operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_errors_total + include: neuroncore_memory_usage_runtime_memory match_type: "" - new_name: neuron_execution_errors + new_name: neuroncore_memory_usage_runtime_memory operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuron_runtime_memory_used_bytes + include: neuroncore_utilization_ratio match_type: "" - new_name: neurondevice_runtime_memory_used_bytes - operations: [] + new_name: neuroncore_utilization + operations: + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 100 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_constants + include: execution_status_total match_type: "" - new_name: neuroncore_memory_usage_constants + new_name: neuron_execution_status operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_code + include: neuron_runtime_memory_used_bytes match_type: "" - new_name: neuroncore_memory_usage_model_code + new_name: neurondevice_runtime_memory_used_bytes operations: [] submatch_case: "" - action: update @@ -1049,51 +1057,44 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: execution_status_total + include: instance_info match_type: "" - new_name: neuron_execution_status + new_name: instance_info operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_runtime_memory + include: neuron_hardware match_type: "" - new_name: neuroncore_memory_usage_runtime_memory + new_name: neuron_hardware operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_utilization_ratio + include: hardware_ecc_events_total 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: neurondevice_hw_ecc_events + operations: [] submatch_case: "" - action: update aggregation_type: "" - include: instance_info + include: execution_latency_seconds match_type: "" - new_name: instance_info + new_name: neuron_execution_latency operations: [] submatch_case: "" - action: update aggregation_type: "" - include: hardware_ecc_events_total + include: execution_errors_total match_type: "" - new_name: neurondevice_hw_ecc_events + new_name: neuron_execution_errors operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_latency_seconds + include: neuroncore_memory_usage_constants match_type: "" - new_name: neuron_execution_latency + new_name: neuroncore_memory_usage_constants operations: [] submatch_case: "" receivers: diff --git a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml index d38f02f2cd..16fda231f0 100644 --- a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml +++ b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,7 +24,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: imds_retries: 1 refresh_interval_seconds: 0s diff --git a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml index 373ba8e154..74b74f384f 100644 --- a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml +++ b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml index 2bd2541d3e..ca4edcd445 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_only: false is_usage_data_enabled: true stats: operations: @@ -66,8 +67,8 @@ extensions: 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 +76,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 batch/host/amp: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -141,9 +142,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: @@ -175,8 +176,8 @@ service: - transform - batch/host/amp receivers: - - telegraf_disk - telegraf_cpu + - telegraf_disk metrics/host/cloudwatch: exporters: - awscloudwatch @@ -184,8 +185,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..3b404f215b 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_only: false 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..e930254814 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 @@ -358,6 +358,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml b/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml index 3943981aa6..db4a93c4ee 100644 --- a/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml +++ b/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml @@ -90,6 +90,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: 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..41fec32690 100644 --- a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml @@ -387,6 +387,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -395,9 +396,8 @@ extensions: 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 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..8325c25842 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml @@ -1,126 +1,127 @@ 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_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - PutLogEvents + 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 + - 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..df72c339f7 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml @@ -1,110 +1,111 @@ 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_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - PutMetricData + 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: + - InstanceId + - InstanceType + - ImageId + imds_retries: 1 + 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 + - 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..c8fd0f01d4 100644 --- a/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml +++ b/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml @@ -1,61 +1,62 @@ 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_status_code_only: false + 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 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 + - 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_config_linux.yaml b/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml index ce4ad17041..693c2dc26a 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml @@ -70,6 +70,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml b/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml index 2a47f34ae3..70a94910b9 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml @@ -52,6 +52,7 @@ exporters: version: "0" extensions: agenthealth/logs: + is_status_code_only: false is_usage_data_enabled: true stats: operations: 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..6b90ed65cf 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,7 +24,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict @@ -75,10 +76,10 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_cpu - telegraf_disk - telegraf_mem - telegraf_swap + - telegraf_cpu 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..bfe71281d3 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml @@ -12,6 +12,7 @@ exporters: shared_credential_file: fake-path extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -42,9 +43,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - ImageId - InstanceId - InstanceType + - ImageId imds_retries: 2 profile: AmazonCloudWatchAgent refresh_interval_seconds: 0s @@ -82,10 +83,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_windows.yaml b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml index 8df619d970..7691c0b53f 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -70,11 +71,11 @@ service: - awsentity/resource - ec2tagger receivers: - - 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/4283769065 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 2914d1bb74..6f2e14a4c5 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml @@ -12,6 +12,7 @@ exporters: shared_credential_file: fake-path extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -32,9 +33,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 2 profile: AmazonCloudWatchAgent refresh_interval_seconds: 0s @@ -77,11 +78,11 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_win_perf_counters/3610923661 + - telegraf_win_perf_counters/3446270237 - 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 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml b/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml index 0034301d02..401a8c27f2 100644 --- a/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,8 +24,8 @@ extensions: processors: awsentity/service/telegraf: entity_type: Service - scrape_datapoint_attribute: true platform: ec2 + scrape_datapoint_attribute: true receivers: telegraf_statsd: collection_interval: 10s diff --git a/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml b/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml index 6aeeae4dd6..35e786e5dc 100644 --- a/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml @@ -10,6 +10,7 @@ exporters: enabled: true extensions: agenthealth/metrics: + is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -23,8 +24,8 @@ extensions: processors: awsentity/service/telegraf: entity_type: Service + platform: ec2 scrape_datapoint_attribute: true - platform: ec2 receivers: telegraf_statsd: collection_interval: 10s diff --git a/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml b/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml index 0e0e2da5a1..0220d83992 100644 --- a/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml @@ -1,50 +1,51 @@ 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_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - PutMetricData + 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 + 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..b0fbeb16d6 100644 --- a/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml @@ -1,61 +1,62 @@ 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_status_code_only: false + is_usage_data_enabled: true + stats: + operations: + - PutMetricData + 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 + - 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..cec74b77ed 100644 --- a/translator/tocwconfig/sampleConfig/trace_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/trace_config_linux.yaml @@ -23,6 +23,7 @@ exporters: transit_spans_in_otlp_format: true extensions: agenthealth/traces: + is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/trace_config_windows.yaml b/translator/tocwconfig/sampleConfig/trace_config_windows.yaml index 4ab7efc002..060e16d3a5 100644 --- a/translator/tocwconfig/sampleConfig/trace_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/trace_config_windows.yaml @@ -23,6 +23,7 @@ exporters: transit_spans_in_otlp_format: true extensions: agenthealth/traces: + is_status_code_only: false is_usage_data_enabled: true stats: operations: 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 c607257a3a..e542a3ef9e 100644 --- a/translator/tocwconfig/tocwconfig_test.go +++ b/translator/tocwconfig/tocwconfig_test.go @@ -774,11 +774,12 @@ func verifyToYamlTranslation(t *testing.T, input interface{}, expectedYamlFilePa require.NoError(t, err) yamlStr := toyamlconfig.ToYamlConfig(yamlConfig) require.NoError(t, yaml.Unmarshal([]byte(yamlStr), &actual)) + assert.NoError(t, os.WriteFile(expectedYamlFilePath, []byte(yamlStr), 0644)) // useful for regenerating YAML opt := cmpopts.SortSlices(func(x, y interface{}) bool { return pretty.Sprint(x) < pretty.Sprint(y) }) - // assert.Equal(t, expected, actual) // this is useful for debugging differences between the YAML + //assert.Equal(t, expected, actual) // this is useful for debugging differences between the YAML require.True(t, cmp.Equal(expected, actual, opt), "D! YAML diff: %s", cmp.Diff(expected, actual)) } From 5dc40f4358f24e5d1915d6bc59f890683f8e62fb Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 16:42:06 -0500 Subject: [PATCH 27/91] running make fmt --- .../agenthealth/handler/stats/provider/statuscode_test.go | 6 +++++- plugins/processors/ec2tagger/ec2tagger.go | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index b5b99c0eaa..8b219477d1 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -1,11 +1,15 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider import ( - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) func TestStatusCodeHandler(t *testing.T) { diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index a6f6e967f7..35631a6ce2 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -11,7 +11,6 @@ import ( "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" From e5bf29595e38ab29d4d45049ce96cf3953685f19 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 17:18:01 -0500 Subject: [PATCH 28/91] fixing unit tests --- .../sampleConfig/advanced_config_darwin.yaml | 2 +- .../sampleConfig/advanced_config_linux.yaml | 4 +- .../sampleConfig/advanced_config_windows.yaml | 6 +- .../sampleConfig/amp_config_linux.yaml | 2 +- .../sampleConfig/basic_config_linux.yaml | 2 +- .../sampleConfig/complete_darwin_config.yaml | 14 +- .../sampleConfig/complete_linux_config.yaml | 12 +- .../sampleConfig/drop_origin_linux.yaml | 4 +- .../emf_and_kubernetes_with_gpu_config.yaml | 268 +++++++++--------- .../ignore_append_dimensions.yaml | 2 +- .../sampleConfig/invalid_input_linux.yaml | 2 +- .../sampleConfig/jmx_config_linux.yaml | 6 +- .../sampleConfig/otlp_metrics_config.yaml | 2 +- .../sampleConfig/standard_config_linux.yaml | 6 +- ...ndard_config_linux_with_common_config.yaml | 2 +- .../sampleConfig/standard_config_windows.yaml | 4 +- ...ard_config_windows_with_common_config.yaml | 6 +- 17 files changed, 172 insertions(+), 172 deletions(-) diff --git a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml index d5fa199e7c..f3dd0acaba 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml @@ -81,11 +81,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_mem - telegraf_netstat - telegraf_swap - telegraf_cpu - telegraf_disk + - telegraf_mem metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml index addecabd25..e9ad7c1b8e 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml @@ -39,9 +39,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: @@ -89,13 +89,13 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_mem - telegraf_netstat - telegraf_swap - telegraf_ethtool - telegraf_nvidia_smi - telegraf_cpu - telegraf_disk - - telegraf_mem metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml index 35ccae8ff9..3bfe0532fa 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml @@ -29,9 +29,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: @@ -82,13 +82,13 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_win_perf_counters/3446270237 + - telegraf_win_perf_counters/3762679655 - 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 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml index f17a3e72cc..ca7756e664 100644 --- a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml @@ -92,9 +92,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 refresh_interval_seconds: 0s rollup: diff --git a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml index 74b74f384f..f140013c65 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml @@ -55,8 +55,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_disk - telegraf_mem + - telegraf_disk telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index 444b4ad32f..8c1f8b9fda 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -129,9 +129,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s transform: @@ -141,11 +141,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: @@ -278,13 +278,13 @@ service: - ec2tagger - transform receivers: + - telegraf_processes - telegraf_swap - telegraf_mem - telegraf_netstat - telegraf_procstat/1917393364 - - telegraf_processes - - telegraf_disk - telegraf_cpu + - telegraf_disk metrics/hostCustomMetrics: exporters: - awscloudwatch @@ -293,8 +293,8 @@ service: - ec2tagger - transform receivers: - - telegraf_statsd - telegraf_socket_listener + - telegraf_statsd metrics/hostDeltaMetrics: exporters: - awscloudwatch @@ -304,8 +304,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 e896c3799b..b93393e96c 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -384,13 +384,13 @@ service: - ec2tagger - transform receivers: - - telegraf_processes - telegraf_disk - - telegraf_swap - - telegraf_cpu - - telegraf_procstat/1917393364 - - telegraf_mem - telegraf_netstat + - telegraf_processes + - telegraf_mem + - telegraf_procstat/1917393364 + - telegraf_cpu + - telegraf_swap metrics/hostCustomMetrics/cloudwatch: exporters: - awscloudwatch @@ -399,8 +399,8 @@ service: - ec2tagger - transform receivers: - - telegraf_statsd - telegraf_socket_listener + - telegraf_statsd metrics/hostDeltaMetrics/cloudwatch: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml index 0bf0648499..9a05163bed 100644 --- a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml +++ b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml @@ -34,9 +34,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s transform: @@ -76,9 +76,9 @@ service: - ec2tagger - transform receivers: + - telegraf_cpu - telegraf_disk - telegraf_nvidia_smi - - telegraf_cpu telemetry: logs: development: false 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 f6d5e43542..4a97034264 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml @@ -686,9 +686,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_TOTAL + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: container_gpu_memory_total + new_name: container_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -697,19 +697,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_TOTAL + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: pod_gpu_memory_total + new_name: pod_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -718,19 +711,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_TOTAL + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: node_gpu_memory_total + new_name: node_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -739,19 +725,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_GPU_TEMP + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: container_gpu_temperature + new_name: container_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -760,12 +739,19 @@ 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_GPU_TEMP + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: pod_gpu_temperature + new_name: pod_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -774,12 +760,19 @@ 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_GPU_TEMP + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: node_gpu_temperature + new_name: node_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -788,12 +781,19 @@ 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_POWER_USAGE + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: container_gpu_power_draw + new_name: container_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -802,12 +802,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_USED match_type: "" - new_name: pod_gpu_power_draw + new_name: pod_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -816,12 +823,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_USED match_type: "" - new_name: node_gpu_power_draw + new_name: node_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -830,12 +844,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_FB_TOTAL match_type: "" - new_name: container_gpu_utilization + new_name: container_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -844,12 +865,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_UTIL + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: pod_gpu_utilization + new_name: pod_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -858,12 +886,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_UTIL + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: node_gpu_utilization + new_name: node_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -872,12 +907,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_FB_USED_PERCENT + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: container_gpu_memory_utilization + new_name: container_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -886,19 +928,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_TEMP match_type: "" - new_name: pod_gpu_memory_utilization + new_name: pod_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -907,19 +942,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_TEMP match_type: "" - new_name: node_gpu_memory_utilization + new_name: node_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -928,19 +956,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_POWER_USAGE match_type: "" - new_name: container_gpu_memory_used + new_name: container_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -949,19 +970,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_POWER_USAGE match_type: "" - new_name: pod_gpu_memory_used + new_name: pod_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -970,19 +984,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_POWER_USAGE match_type: "" - new_name: node_gpu_memory_used + new_name: node_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -991,110 +998,103 @@ 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: update aggregation_type: "" - include: neuroncore_memory_usage_model_code + include: execution_status_total match_type: "" - new_name: neuroncore_memory_usage_model_code + new_name: neuron_execution_status 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_shared_scratchpad 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_shared_scratchpad + operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_status_total + include: neuroncore_memory_usage_tensors match_type: "" - new_name: neuron_execution_status + new_name: neuroncore_memory_usage_tensors operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuron_runtime_memory_used_bytes + include: instance_info match_type: "" - new_name: neurondevice_runtime_memory_used_bytes + new_name: instance_info operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_shared_scratchpad + include: execution_errors_total match_type: "" - new_name: neuroncore_memory_usage_model_shared_scratchpad + new_name: neuron_execution_errors operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_tensors + include: neuroncore_memory_usage_constants match_type: "" - new_name: neuroncore_memory_usage_tensors + new_name: neuroncore_memory_usage_constants operations: [] submatch_case: "" - action: update aggregation_type: "" - include: instance_info + include: neuroncore_memory_usage_model_code match_type: "" - new_name: instance_info + new_name: neuroncore_memory_usage_model_code operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuron_hardware + include: neuroncore_memory_usage_runtime_memory match_type: "" - new_name: neuron_hardware + new_name: neuroncore_memory_usage_runtime_memory operations: [] submatch_case: "" - action: update aggregation_type: "" - include: hardware_ecc_events_total + include: neuroncore_utilization_ratio match_type: "" - new_name: neurondevice_hw_ecc_events - operations: [] + new_name: neuroncore_utilization + operations: + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 100 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: update aggregation_type: "" - include: execution_latency_seconds + include: neuron_hardware match_type: "" - new_name: neuron_execution_latency + new_name: neuron_hardware operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_errors_total + include: hardware_ecc_events_total match_type: "" - new_name: neuron_execution_errors + new_name: neurondevice_hw_ecc_events operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_constants + include: execution_latency_seconds match_type: "" - new_name: neuroncore_memory_usage_constants + new_name: neuron_execution_latency operations: [] submatch_case: "" receivers: diff --git a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml index 16fda231f0..5d4e3b492d 100644 --- a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml +++ b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml @@ -49,8 +49,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 74b74f384f..f140013c65 100644 --- a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml +++ b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml @@ -55,8 +55,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 ca4edcd445..449ed93cd2 100644 --- a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml @@ -129,11 +129,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 @@ -142,9 +142,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/otlp_metrics_config.yaml b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml index df72c339f7..717dc69c8b 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml @@ -33,9 +33,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml index 6b90ed65cf..c78d6dd9c3 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml @@ -39,9 +39,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType refresh_interval_seconds: 0s receivers: telegraf_cpu: @@ -76,10 +76,10 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_disk - - telegraf_mem - telegraf_swap - telegraf_cpu + - telegraf_disk + - telegraf_mem 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 bfe71281d3..7764f9adad 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml @@ -83,10 +83,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 7691c0b53f..05e062c29d 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml @@ -71,11 +71,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_win_perf_counters/1492679118 - - telegraf_win_perf_counters/3610923661 - telegraf_win_perf_counters/3446270237 - telegraf_win_perf_counters/3762679655 - telegraf_win_perf_counters/4283769065 + - telegraf_win_perf_counters/1492679118 + - telegraf_win_perf_counters/3610923661 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 6f2e14a4c5..ca760d1f70 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml @@ -33,9 +33,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - ImageId - InstanceId - InstanceType + - ImageId imds_retries: 2 profile: AmazonCloudWatchAgent refresh_interval_seconds: 0s @@ -78,11 +78,11 @@ service: - awsentity/resource - ec2tagger receivers: + - 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/4283769065 - - telegraf_win_perf_counters/1492679118 telemetry: logs: development: false From e07463a9563ad9c5b1ed7396cfb91dfd62f6d27b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 17:50:46 -0500 Subject: [PATCH 29/91] fixing tests --- extension/agenthealth/config.go | 2 +- extension/agenthealth/extension.go | 13 +- internal/tls/testdata/server.crt | 44 +++--- internal/tls/testdata/server.key | 52 +++---- internal/tls/testdata/tls-ca.crt | 50 +++---- plugins/processors/ec2tagger/ec2tagger.go | 21 +-- .../sampleConfig/advanced_config_darwin.yaml | 6 +- .../sampleConfig/advanced_config_linux.yaml | 6 +- .../sampleConfig/amp_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 | 10 +- .../emf_and_kubernetes_with_gpu_config.yaml | 138 +++++++++--------- .../sampleConfig/jmx_config_linux.yaml | 4 +- .../sampleConfig/otlp_metrics_config.yaml | 2 +- .../sampleConfig/standard_config_linux.yaml | 4 +- ...ndard_config_linux_with_common_config.yaml | 2 +- .../sampleConfig/standard_config_windows.yaml | 4 +- ...ard_config_windows_with_common_config.yaml | 6 +- .../otel/extension/agenthealth/translator.go | 15 +- .../otel/pipeline/host/translator.go | 1 - 22 files changed, 194 insertions(+), 208 deletions(-) diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index ad326129be..696db2ceca 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -12,7 +12,7 @@ import ( type Config struct { IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` Stats agent.StatsConfig `mapstructure:"stats"` - StatusCodeOnly bool `mapstructure:"is_status_code_only"` + StatusCodeOnly *bool `mapstructure:"is_status_code_only,omitempty"` } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index d129fe02c8..669c98a98a 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -22,18 +22,19 @@ type agentHealth struct { var _ awsmiddleware.Extension = (*agentHealth)(nil) func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { - // Initialize handlers 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, ah.cfg.StatusCodeOnly) - requestHandlers = append(requestHandlers, req...) - responseHandlers = append(responseHandlers, res...) - } else { + if !ah.cfg.IsUsageDataEnabled { ah.logger.Debug("Usage data is disabled, skipping stats handlers") + return requestHandlers, responseHandlers } + statusCodeOnly := ah.cfg.StatusCodeOnly != nil + statsRequestHandlers, statsResponseHandlers := stats.NewHandlers(ah.logger, ah.cfg.Stats, statusCodeOnly) + requestHandlers = append(requestHandlers, statsRequestHandlers...) + responseHandlers = append(responseHandlers, statsResponseHandlers...) + return requestHandlers, responseHandlers } diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index ea76fdfd7b..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGTCCAgGgAwIBAgIRALBSsWx0R8pdGw3H9ZNxAEUwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHUm9vdCBDQTAeFw0yNDExMTkyMTMxMjJaFw0yNDExMTkyMjMx -MjJaMBUxEzARBgNVBAoTCkt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDi1fIx0fG6+A4HlKOh9olYknYbOs41+Dgc6FX6hu/5KZ0AvMMU -RNY/UmbqS+Iut1kF1069zRkFmf+NOyYMam//GbhtKA7FyYtC+pMSSU+amHPLo2dO -bOSSy/S4YWS/6O6A36YRwsGqNr9UVHnsaSRKp2yY7sd9b4g5VZmVHodnGTfohMpt -57bzggN0ZMMKJE94p3ZjB5y+pQ1hvbRA7WPWPUaPpPznTwXGO8z6mYPHjjGmEyFd -H4Pe9xA6gfLzRy8Bf0VJhOFH4+Xe0eTcigNimKMKT8ApMpXIlvsJ4Buuf8JXgxu9 -k0YW2r2E0ZYrvPhvzQMHntbovmuH+zHB5A+TAgMBAAGjZzBlMA4GA1UdDwEB/wQE -AwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQY -MBaAFI+B0q4vVDUe4LSe172DYmnfkGIOMA8GA1UdEQQIMAaHBH8AAAEwDQYJKoZI -hvcNAQELBQADggIBAALYTNCcFEJnSIUL81+Fxb0U9KgdNwhJfou5WTgRSFqLwuJf -hYfzSHCZYQbANb93o7jsa0cj2Wqj8jL+UEhGLLXg6jLUGdG93WoVCtO2FchwWoay -6trRPJ0aHzfhKLZzU4cVp649iygbs5RFNbjMz+ehpC2FOizjA+2zysPchJ9xYCU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aNnMGUwDgYDVR0PAQH/BAQD +AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgw +FoAUhscCtqKglSlRCx9YNN1D/Xz5MpMwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG +9w0BAQsFAAOCAgEAcxCGmWNtuM9V2yi0SOSLfxlSK7F1OS5qQuLWkZSDB1f+XG82 +PNDwSrV4J42qZcFfKrEt1HtS/Ws6VRlLrSnYArNSyQvNTeNf0q/rX9yO8wRcCM5K +sb8uv27xdawjN6F3z59rpJOf9ldX4ASrRZHzX/ttvvNcUdbCZsF5+h2EhcwNVVUa +Q6vlAW8u4Ik9HXxJ+W2HEdlSYWcCdTK4hDCtJhwqEBua1VdKwSdrlDZJPswAdCzv +CR3Fj4NsmPRDw8uCPIL4hwk5fbffcn3rZrsOXSMTKxvdyP+XBPKWEoIs6cxvdE3o +sG65EZeGpj0vLN+rLEbumkvgCAHACgVxvyDeJnajoA6lPNxfzby+9CmhLZfgaVbE +nVQTj8hkUW1gtvnAP3v1Zbe3QMhlqWqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 3673072582..f5856375b7 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDi1fIx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MPtvw/OCDsmwlw +Up+F4Ym87BuxYPIgGMzb7r7x -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 1c22e4a6c1..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTExOTIxMzEyNloXDTM0MTExOTIxMzEyNlowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKx/urc3Bbky -5UCctkWDEganaU6qkZVnSGFnOhekzl2fnZDI8hETZo9ApOlaqBVaX+AMZc1JmvEb -qt/pfiyRl9q9wVvXi904nuZQk7Ehb6sLCcRxTaNPQUN+2OESX7mpBWZIvbTXpgVd -IqSXR8GX4H/IFyrdZSX4YS8bCcPQwzJ/xxOIL8xy8qox+EGYwsSg/M9BdhpfMLz6 -hCDxMKMw3obD4KeNC/Dkx2I/u3OzRWO5OTB+D0ihhzGFlee+mslyx2MtHVSpG7dd -hYvZXTLPFevK83lasQGJMTX7vLAER7aWAL5xMmEsZw4241pWqVBVMJEZrmv1812V -odKc+peH7s6olamO+ihN1wiYW9FpE39XcMhNITjcwZ3tQ7DD9igU3dMrQVtSToaS -Cx5ZTUlO+ngzApVuNY+A5VbQFoIzBfpGKACwrGd8qEayhiBUrYMQZ/38k4jaYsa5 -Z2vpMdrb96CDCC98dSvAfQncSn+sner1PcwSBfhr/9CPH2SHvZvzIXHBO2LJc2Pg -3q8T5K0LEbNtW4UNMdKfJLMURr4xO+Obw+vxHC+nyPk1NXnsbyoJrqnatnkc71Mg -T96Vb1dWXSH0Mwd1au7AkeUYah9HUTr9Bbb9+OrHGenPlAHUetrMRe5VMCkKhWxG -xLhfjATY/WxVkdrFaoT6k0xcjRd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URMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- diff --git a/plugins/processors/ec2tagger/ec2tagger.go b/plugins/processors/ec2tagger/ec2tagger.go index 35631a6ce2..52e9423100 100644 --- a/plugins/processors/ec2tagger/ec2tagger.go +++ b/plugins/processors/ec2tagger/ec2tagger.go @@ -10,7 +10,6 @@ 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" @@ -64,6 +63,7 @@ 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,7 +280,7 @@ 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, host component.Host) error { +func (t *Tagger) Start(ctx context.Context, _ component.Host) error { t.shutdownC = make(chan bool) t.ec2TagCache = map[string]string{} @@ -300,8 +300,10 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { } useAllTags := len(t.EC2InstanceTagKeys) == 1 && t.EC2InstanceTagKeys[0] == "*" - if !useAllTags && len(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 @@ -325,20 +327,11 @@ func (t *Tagger) Start(ctx context.Context, host component.Host) error { Region: t.ec2MetadataRespond.region, } t.ec2API = t.ec2Provider(ec2CredentialConfig) - - if ec2Client, ok := t.ec2API.(*ec2.EC2); ok { - if t.Config.MiddlewareID == nil { - TypeStr, _ = component.NewType("agenthealth") - defaultMiddlewareID := component.NewIDWithName(TypeStr, component.DataTypeMetrics.String()) - t.Config.MiddlewareID = &defaultMiddlewareID - } - awsmiddleware.TryConfigure(t.logger, host, *t.Config.MiddlewareID, awsmiddleware.SDKv1(&ec2Client.Handlers)) //Change this so that we confiugure new tegger to have the status code middware id !!!!!!!!!!!?????? - } - - go func() { + go func() { //Async start of initial retrieval to prevent block of agent start t.initialRetrievalOfTagsAndVolumes() t.refreshLoopToUpdateTagsAndVolumes() }() + t.logger.Info("ec2tagger: EC2 tagger has started initialization.") } else { t.setStarted() diff --git a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml index f3dd0acaba..6e0e541e10 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml @@ -39,9 +39,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: @@ -81,11 +81,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_netstat - - telegraf_swap - telegraf_cpu - telegraf_disk - telegraf_mem + - telegraf_netstat + - telegraf_swap metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml index e9ad7c1b8e..e3c3b5746d 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml @@ -89,13 +89,13 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_mem - - telegraf_netstat - - telegraf_swap - telegraf_ethtool - telegraf_nvidia_smi - telegraf_cpu - telegraf_disk + - telegraf_mem + - telegraf_netstat + - telegraf_swap metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml index ca7756e664..a4e2973b1e 100644 --- a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml @@ -92,9 +92,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s rollup: diff --git a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml index 69475eceb3..3233c41868 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml @@ -57,8 +57,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_win_perf_counters/4283769065 - telegraf_win_perf_counters/1492679118 + - telegraf_win_perf_counters/4283769065 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml index 3a4978afae..d8f54142a4 100644 --- a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml @@ -41,9 +41,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index 8c1f8b9fda..2e1f065a84 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -129,9 +129,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s transform: @@ -141,11 +141,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: @@ -278,12 +278,12 @@ service: - ec2tagger - transform receivers: - - telegraf_processes + - telegraf_cpu - telegraf_swap - - telegraf_mem - - telegraf_netstat + - telegraf_processes - telegraf_procstat/1917393364 - - telegraf_cpu + - telegraf_netstat + - telegraf_mem - telegraf_disk metrics/hostCustomMetrics: exporters: @@ -304,8 +304,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 b93393e96c..e079fec603 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -205,9 +205,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: [] transform/jmx/1: error_mode: propagate @@ -384,13 +384,13 @@ service: - ec2tagger - transform receivers: + - telegraf_cpu - telegraf_disk - - telegraf_netstat - telegraf_processes - - telegraf_mem + - telegraf_netstat - telegraf_procstat/1917393364 - - telegraf_cpu - telegraf_swap + - telegraf_mem metrics/hostCustomMetrics/cloudwatch: exporters: - awscloudwatch @@ -399,8 +399,8 @@ service: - ec2tagger - transform receivers: - - telegraf_socket_listener - telegraf_statsd + - telegraf_socket_listener metrics/hostDeltaMetrics/cloudwatch: exporters: - awscloudwatch 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 4a97034264..410baa98a0 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml @@ -684,6 +684,48 @@ processors: match_type: regexp new_name: apiserver_request_total_5xx submatch_case: "" + - action: insert + aggregation_type: "" + include: DCGM_FI_DEV_POWER_USAGE + match_type: "" + new_name: container_gpu_power_draw + operations: + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Type + new_value: ContainerGPU + submatch_case: "" + - action: insert + aggregation_type: "" + include: DCGM_FI_DEV_POWER_USAGE + match_type: "" + new_name: pod_gpu_power_draw + operations: + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Type + new_value: PodGPU + submatch_case: "" + - action: insert + aggregation_type: "" + include: DCGM_FI_DEV_POWER_USAGE + match_type: "" + new_name: node_gpu_power_draw + operations: + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Type + new_value: NodeGPU + submatch_case: "" - action: insert aggregation_type: "" include: DCGM_FI_DEV_GPU_UTIL @@ -957,47 +999,12 @@ processors: new_label: Type new_value: NodeGPU submatch_case: "" - - action: insert - aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE - match_type: "" - new_name: container_gpu_power_draw - operations: - - action: add_label - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - new_label: Type - new_value: ContainerGPU - submatch_case: "" - - action: insert - aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE - match_type: "" - new_name: pod_gpu_power_draw - operations: - - action: add_label - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - new_label: Type - new_value: PodGPU - submatch_case: "" - - action: insert + - action: update aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: execution_errors_total match_type: "" - new_name: node_gpu_power_draw - operations: - - action: add_label - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - new_label: Type - new_value: NodeGPU + new_name: neuron_execution_errors + operations: [] submatch_case: "" - action: update aggregation_type: "" @@ -1008,9 +1015,9 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuron_runtime_memory_used_bytes + include: neuroncore_memory_usage_model_code match_type: "" - new_name: neurondevice_runtime_memory_used_bytes + new_name: neuroncore_memory_usage_model_code operations: [] submatch_case: "" - action: update @@ -1022,23 +1029,30 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_tensors + include: neuroncore_utilization_ratio match_type: "" - new_name: neuroncore_memory_usage_tensors - operations: [] + new_name: neuroncore_utilization + operations: + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 100 + label: "" + label_value: "" + new_label: "" + new_value: "" submatch_case: "" - action: update aggregation_type: "" - include: instance_info + include: execution_latency_seconds match_type: "" - new_name: instance_info + new_name: neuron_execution_latency operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_errors_total + include: neuron_runtime_memory_used_bytes match_type: "" - new_name: neuron_execution_errors + new_name: neurondevice_runtime_memory_used_bytes operations: [] submatch_case: "" - action: update @@ -1050,31 +1064,24 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_code + include: neuroncore_memory_usage_runtime_memory match_type: "" - new_name: neuroncore_memory_usage_model_code + new_name: neuroncore_memory_usage_runtime_memory operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_runtime_memory + include: neuroncore_memory_usage_tensors match_type: "" - new_name: neuroncore_memory_usage_runtime_memory + new_name: neuroncore_memory_usage_tensors operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_utilization_ratio + include: instance_info 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: instance_info + operations: [] submatch_case: "" - action: update aggregation_type: "" @@ -1090,13 +1097,6 @@ processors: new_name: neurondevice_hw_ecc_events operations: [] 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 diff --git a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml index 449ed93cd2..b135ef9ba2 100644 --- a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml @@ -129,11 +129,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 diff --git a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml index 717dc69c8b..cf1f13e5a8 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml @@ -33,9 +33,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml index c78d6dd9c3..64a32fc497 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml @@ -39,9 +39,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType refresh_interval_seconds: 0s receivers: telegraf_cpu: @@ -76,10 +76,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_linux_with_common_config.yaml b/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml index 7764f9adad..3ef254456f 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml @@ -43,9 +43,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 2 profile: AmazonCloudWatchAgent refresh_interval_seconds: 0s diff --git a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml index 05e062c29d..3064358227 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml @@ -71,11 +71,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_win_perf_counters/3446270237 - - 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 ca760d1f70..8a3188bcd1 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml @@ -33,9 +33,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 2 profile: AmazonCloudWatchAgent refresh_interval_seconds: 0s @@ -78,11 +78,11 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_win_perf_counters/3446270237 + - 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/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 1a43a1d0a4..940c3d42b6 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -35,7 +35,7 @@ type translator struct { operations []string isUsageDataEnabled bool factory extension.Factory - statuscodeonly bool + statuscodeonly *bool } var _ common.Translator[component.Config] = (*translator)(nil) @@ -46,7 +46,7 @@ func NewTranslatorWithStatusCode(name component.DataType, operations []string, s operations: operations, factory: agenthealth.NewFactory(), isUsageDataEnabled: envconfig.IsUsageDataEnabled(), - statuscodeonly: statuscodeonly, + statuscodeonly: &statuscodeonly, } } @@ -56,7 +56,7 @@ func NewTranslator(name component.DataType, operations []string) common.Translat operations: operations, factory: agenthealth.NewFactory(), isUsageDataEnabled: envconfig.IsUsageDataEnabled(), - statuscodeonly: false, + statuscodeonly: nil, } } @@ -72,10 +72,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData } cfg.StatusCodeOnly = t.statuscodeonly - if t.statuscodeonly { - //cfg.StatusCode = agent.StatusCodeConfig{ - // Operations: agent.StatusCodeOperations, - //} + if t.statuscodeonly != nil && *t.statuscodeonly { return cfg, nil } cfg.Stats = agent.StatsConfig{ @@ -85,9 +82,5 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { agent.FlagRegionType: translateagent.Global_Config.RegionType, }, } - //cfg.StatusCode = agent.StatusCodeConfig{ - // Operations: agent.StatusCodeOperations, - //} //Do we need to add anything to otel config? - return cfg, nil } diff --git a/translator/translate/otel/pipeline/host/translator.go b/translator/translate/otel/pipeline/host/translator.go index 17793b23da..641ed43e93 100644 --- a/translator/translate/otel/pipeline/host/translator.go +++ b/translator/translate/otel/pipeline/host/translator.go @@ -90,7 +90,6 @@ func (t translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators, if t.Destination() != common.CloudWatchLogsKey { if conf.IsSet(common.ConfigKey(common.MetricsKey, common.AppendDimensionsKey)) { log.Printf("D! ec2tagger processor required because append_dimensions is set") - translators.Extensions.Set(agenthealth.NewTranslator(component.DataTypeMetrics, []string{"*"})) //not sure if we need to change this?????? translators.Processors.Set(ec2taggerprocessor.NewTranslator()) } From a5ba52e257170beb03567b21ef40fd398c3d3712 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 17:58:00 -0500 Subject: [PATCH 30/91] fixing yamls --- internal/tls/testdata/server.key | 52 +++--- .../sampleConfig/advanced_config_darwin.yaml | 1 - .../sampleConfig/advanced_config_linux.yaml | 7 +- .../sampleConfig/advanced_config_windows.yaml | 5 +- .../sampleConfig/amp_config_linux.yaml | 5 +- .../appsignals_and_ecs_config.yaml | 2 - .../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 | 2 - .../base_appsignals_fallback_config.yaml | 2 - .../base_container_insights_config.yaml | 1 - .../sampleConfig/basic_config_linux.yaml | 3 +- .../sampleConfig/basic_config_windows.yaml | 3 +- .../sampleConfig/collectd_config_linux.yaml | 1 - .../sampleConfig/compass_linux_config.yaml | 3 +- .../sampleConfig/complete_darwin_config.yaml | 9 +- .../sampleConfig/complete_linux_config.yaml | 17 +- .../sampleConfig/config_with_env.yaml | 1 - .../sampleConfig/container_insights_jmx.yaml | 1 - .../sampleConfig/delta_config_linux.yaml | 1 - .../sampleConfig/delta_net_config_linux.yaml | 1 - .../sampleConfig/drop_origin_linux.yaml | 3 +- .../emf_and_kubernetes_config.yaml | 1 - .../emf_and_kubernetes_with_gpu_config.yaml | 149 +++++++++--------- .../ignore_append_dimensions.yaml | 1 - .../sampleConfig/invalid_input_linux.yaml | 1 - .../sampleConfig/jmx_config_linux.yaml | 9 +- .../sampleConfig/jmx_eks_config_linux.yaml | 1 - .../kubernetes_on_prem_config.yaml | 1 - .../sampleConfig/log_ecs_metric_only.yaml | 1 - .../logs_and_kubernetes_config.yaml | 1 - .../otlp_metrics_cloudwatchlogs_config.yaml | 1 - .../sampleConfig/otlp_metrics_config.yaml | 3 +- .../procstat_memory_swap_config.yaml | 1 - .../sampleConfig/prometheus_config_linux.yaml | 1 - .../prometheus_config_windows.yaml | 1 - .../sampleConfig/standard_config_linux.yaml | 5 +- ...ndard_config_linux_with_common_config.yaml | 1 - .../sampleConfig/standard_config_windows.yaml | 5 +- ...ard_config_windows_with_common_config.yaml | 3 +- .../sampleConfig/statsd_config_linux.yaml | 1 - .../sampleConfig/statsd_config_windows.yaml | 1 - .../sampleConfig/statsd_ecs_config.yaml | 1 - .../sampleConfig/statsd_eks_config.yaml | 1 - .../sampleConfig/trace_config_linux.yaml | 1 - .../sampleConfig/trace_config_windows.yaml | 1 - translator/tocwconfig/tocwconfig_test.go | 2 +- 49 files changed, 132 insertions(+), 190 deletions(-) diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index f5856375b7..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC63DhKeQNsXJWO -z1BHBSlZ3hX7MZ2li9j/Msxq/5knkiCeNs0C+M+/u5MjCX5Ib0r/L9HlYEQF1kzM -Qgai7xKM5Gae3hI81ggLjri4vmhQN6SBM/ygauOR4lzi2gajk2CE2wSNvF4bFsye -o9FgCGWVjmPEKDdkJcsWrjkRlr7uyqbxtQF3b6D5egsgo2Uo+eoXLlONpMBYN49K -oTL1mTXMS2Men1ZRU9o8JhedadyHJMFo2TrF4/RAEuhkrmbpYGy6ap7ppNqzRz4u -nhRSbOqadc4PEidbFg0Z9si+a1jgzqb4i7sGhsHLiuHXSvlIexEFOPO6XclqFqjO -Vyv4wbsdAgMBAAECggEBALEpD3mUKCm50dYXOf5Lp3vbsq14ygVlhLPXvrWHZfZ9 -dc1rGY5Cxfz7YzHp0z/rvIgbF37IeVWrax6RTud1kPnhpmXjGBlztyb2Bq6pYA8F -4kLZPh/9l4r9uaEeowK9PNpZKIUU3YgDYrbZjC3naCCWYoJcur+JkXYMcnD5okaU -X0pyb+sg/o28I90GzkMc8Ule3N2ipUKN6Xu0e7I0McOujjxsxrVhxwMPV7shss6z -DQSErHpxO2ESVcdAVDU2g/DfQEcm6o9omTyRybggsuNrBbgdFcoQbc4wzfQNsY3T -MKkEAwAsvVjM6/tuEBsWrd2zFHNFZg+/v9dCyqL688UCgYEA1nsNFaOTtxheRjQJ -/KhCWmwYz11BomKlmSyv+Ctc/6nmvPE5jZ90cjtCfG/ArlLt+isPbKbCKYbIVgxb -jlaZo/ZzpfVCRvoS+/pLIUs0Wkf9OtkCYENnkcBpeqKVJcWaR7nb/nASYMCcNB5y -00jQnsx+MUokj3TcHolsjK/OPDsCgY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o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml index 6e0e541e10..7ec8a1544a 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml index e3c3b5746d..08e123680c 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -39,9 +38,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: @@ -89,13 +88,13 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_netstat + - telegraf_swap - telegraf_ethtool - telegraf_nvidia_smi - telegraf_cpu - telegraf_disk - telegraf_mem - - telegraf_netstat - - telegraf_swap metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml index 3bfe0532fa..2db1d4f417 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -82,13 +81,13 @@ service: - awsentity/resource - ec2tagger receivers: + - 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 - telegraf_win_perf_counters/2039663244 - telegraf_win_perf_counters/4283769065 - - telegraf_win_perf_counters/1492679118 - - telegraf_win_perf_counters/3610923661 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml index a4e2973b1e..09d1eb1632 100644 --- a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml @@ -64,11 +64,10 @@ exporters: write_buffer_size: 524288 extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: - - '*' + - PutMetricData usage_flags: mode: EC2 region_type: ACJ @@ -92,9 +91,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s rollup: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml index 8e083a6072..bd2ae3a253 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml @@ -128,7 +128,6 @@ exporters: include_metadata: true extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -137,7 +136,6 @@ extensions: mode: EC2 region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml index 609149736b..f9306ebb3f 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml @@ -267,7 +267,6 @@ exporters: include_metadata: true extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -276,7 +275,6 @@ extensions: mode: EKS region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index e82573525c..7691642f51 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml @@ -268,7 +268,6 @@ exporters: transit_spans_in_otlp_format: true extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -277,7 +276,6 @@ extensions: mode: K8E region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index 609149736b..f9306ebb3f 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -267,7 +267,6 @@ exporters: include_metadata: true extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -276,7 +275,6 @@ extensions: mode: EKS region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index 609149736b..f9306ebb3f 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -267,7 +267,6 @@ exporters: include_metadata: true extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -276,7 +275,6 @@ extensions: mode: EKS region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 23b90150be..0393281fb9 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -136,7 +136,6 @@ exporters: verbosity: Detailed extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -145,7 +144,6 @@ extensions: mode: OP region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index dfe5442a0d..5cffc25e9d 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -132,7 +132,6 @@ exporters: include_metadata: true extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -141,7 +140,6 @@ extensions: mode: OP region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml index 5c333f6a0e..8a910d80ee 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -141,7 +141,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml index f140013c65..a77f558584 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -29,9 +28,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml index 3233c41868..01d9efe369 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -29,9 +28,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - ImageId - InstanceId - InstanceType + - ImageId imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml b/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml index c77a8271c3..f01c8c504e 100644 --- a/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml index d8f54142a4..d8f4365eaf 100644 --- a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml @@ -21,7 +21,6 @@ exporters: - [] extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -41,9 +40,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index 2e1f065a84..ad049493b3 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -68,7 +68,6 @@ exporters: include_metadata: true extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -77,7 +76,6 @@ extensions: mode: EC2 region_type: ACJ agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -86,7 +84,6 @@ extensions: mode: EC2 region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -279,11 +276,11 @@ service: - transform receivers: - telegraf_cpu - - telegraf_swap - telegraf_processes - - telegraf_procstat/1917393364 - - telegraf_netstat + - telegraf_swap - telegraf_mem + - telegraf_netstat + - telegraf_procstat/1917393364 - telegraf_disk metrics/hostCustomMetrics: exporters: diff --git a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml index e079fec603..3ac881c155 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -73,7 +73,6 @@ exporters: include_metadata: true extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -82,7 +81,6 @@ extensions: mode: EC2 region_type: ACJ agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -91,7 +89,6 @@ extensions: mode: EC2 region_type: ACJ agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -141,9 +138,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 refresh_interval_seconds: 0s filter/jmx/0: @@ -192,11 +189,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 @@ -384,13 +381,13 @@ service: - ec2tagger - transform receivers: + - telegraf_processes - telegraf_cpu + - telegraf_swap - telegraf_disk - - telegraf_processes - telegraf_netstat - - telegraf_procstat/1917393364 - - telegraf_swap - telegraf_mem + - telegraf_procstat/1917393364 metrics/hostCustomMetrics/cloudwatch: exporters: - awscloudwatch @@ -410,8 +407,8 @@ service: - ec2tagger - transform receivers: - - telegraf_diskio - telegraf_net + - telegraf_diskio metrics/jmx/cloudwatch/0: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/config_with_env.yaml b/translator/tocwconfig/sampleConfig/config_with_env.yaml index 1dbc4af2a9..c776e99d76 100644 --- a/translator/tocwconfig/sampleConfig/config_with_env.yaml +++ b/translator/tocwconfig/sampleConfig/config_with_env.yaml @@ -32,7 +32,6 @@ exporters: queue_size: 1000 extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml index 68bdd27edb..aa14bdf130 100644 --- a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml +++ b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml @@ -175,7 +175,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/delta_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_config_linux.yaml index 31be834b11..05df69691c 100644 --- a/translator/tocwconfig/sampleConfig/delta_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_config_linux.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml index c832e86571..b0ebe0edb1 100644 --- a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml index 9a05163bed..8c19d0bee1 100644 --- a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml +++ b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml @@ -15,7 +15,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -34,9 +33,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - ImageId - InstanceId - InstanceType + - ImageId imds_retries: 1 refresh_interval_seconds: 0s transform: diff --git a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml index d4b5e54ae3..f2e17099c6 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml @@ -391,7 +391,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: 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 410baa98a0..c236a12b33 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_with_gpu_config.yaml @@ -649,7 +649,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -684,48 +683,6 @@ processors: match_type: regexp new_name: apiserver_request_total_5xx submatch_case: "" - - action: insert - aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE - match_type: "" - new_name: container_gpu_power_draw - operations: - - action: add_label - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - new_label: Type - new_value: ContainerGPU - submatch_case: "" - - action: insert - aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE - match_type: "" - new_name: pod_gpu_power_draw - operations: - - action: add_label - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - new_label: Type - new_value: PodGPU - submatch_case: "" - - action: insert - aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE - match_type: "" - new_name: node_gpu_power_draw - operations: - - action: add_label - aggregation_type: "" - experimental_scale: 0 - label: "" - label_value: "" - new_label: Type - new_value: NodeGPU - submatch_case: "" - action: insert aggregation_type: "" include: DCGM_FI_DEV_GPU_UTIL @@ -999,12 +956,47 @@ processors: new_label: Type new_value: NodeGPU submatch_case: "" - - action: update + - action: insert aggregation_type: "" - include: execution_errors_total + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: neuron_execution_errors - operations: [] + new_name: container_gpu_power_draw + operations: + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Type + new_value: ContainerGPU + submatch_case: "" + - action: insert + aggregation_type: "" + include: DCGM_FI_DEV_POWER_USAGE + match_type: "" + new_name: pod_gpu_power_draw + operations: + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Type + new_value: PodGPU + submatch_case: "" + - action: insert + aggregation_type: "" + include: DCGM_FI_DEV_POWER_USAGE + match_type: "" + new_name: node_gpu_power_draw + operations: + - action: add_label + aggregation_type: "" + experimental_scale: 0 + label: "" + label_value: "" + new_label: Type + new_value: NodeGPU submatch_case: "" - action: update aggregation_type: "" @@ -1015,9 +1007,9 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_code + include: neuron_runtime_memory_used_bytes match_type: "" - new_name: neuroncore_memory_usage_model_code + new_name: neurondevice_runtime_memory_used_bytes operations: [] submatch_case: "" - action: update @@ -1029,72 +1021,79 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_utilization_ratio + include: neuroncore_memory_usage_tensors 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_tensors + operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_latency_seconds + include: instance_info match_type: "" - new_name: neuron_execution_latency + new_name: instance_info operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuron_runtime_memory_used_bytes + include: neuron_hardware match_type: "" - new_name: neurondevice_runtime_memory_used_bytes + new_name: neuron_hardware operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_constants + include: hardware_ecc_events_total match_type: "" - new_name: neuroncore_memory_usage_constants + new_name: neurondevice_hw_ecc_events operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_runtime_memory + include: execution_errors_total match_type: "" - new_name: neuroncore_memory_usage_runtime_memory + new_name: neuron_execution_errors operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_tensors + include: neuroncore_memory_usage_model_code match_type: "" - new_name: neuroncore_memory_usage_tensors + 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: neuron_hardware + include: neuroncore_utilization_ratio match_type: "" - new_name: neuron_hardware + new_name: neuroncore_utilization + operations: + - action: experimental_scale_value + aggregation_type: "" + experimental_scale: 100 + label: "" + label_value: "" + new_label: "" + new_value: "" + 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: hardware_ecc_events_total + include: neuroncore_memory_usage_constants match_type: "" - new_name: neurondevice_hw_ecc_events + new_name: neuroncore_memory_usage_constants operations: [] submatch_case: "" receivers: diff --git a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml index 5d4e3b492d..597ae1ccf7 100644 --- a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml +++ b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml index f140013c65..9a349c682e 100644 --- a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml +++ b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml index b135ef9ba2..fa7fd7e62f 100644 --- a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml @@ -58,7 +58,6 @@ exporters: write_buffer_size: 524288 extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -129,11 +128,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 @@ -176,8 +175,8 @@ service: - transform - batch/host/amp receivers: - - telegraf_cpu - telegraf_disk + - telegraf_cpu metrics/host/cloudwatch: exporters: - awscloudwatch @@ -185,8 +184,8 @@ service: - awsentity/resource - transform receivers: - - telegraf_cpu - telegraf_disk + - telegraf_cpu 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 3b404f215b..c0ec7df581 100644 --- a/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml @@ -55,7 +55,6 @@ exporters: write_buffer_size: 524288 extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml b/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml index e930254814..9eb61610ae 100644 --- a/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml +++ b/translator/tocwconfig/sampleConfig/kubernetes_on_prem_config.yaml @@ -358,7 +358,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml b/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml index db4a93c4ee..3943981aa6 100644 --- a/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml +++ b/translator/tocwconfig/sampleConfig/log_ecs_metric_only.yaml @@ -90,7 +90,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml index 41fec32690..266b1a4959 100644 --- a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml @@ -387,7 +387,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml b/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml index 8325c25842..3b03def357 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml @@ -30,7 +30,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml index cf1f13e5a8..5ee9d0b9a7 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -33,9 +32,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml b/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml index c8fd0f01d4..f811c89411 100644 --- a/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml +++ b/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml @@ -12,7 +12,6 @@ exporters: shared_credential_file: fake-path extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml b/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml index 693c2dc26a..ce4ad17041 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml @@ -70,7 +70,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml b/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml index 70a94910b9..2a47f34ae3 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/prometheus_config_windows.yaml @@ -52,7 +52,6 @@ exporters: version: "0" extensions: agenthealth/logs: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml index 64a32fc497..6160b8d27c 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -76,10 +75,10 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_mem - - 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 3ef254456f..dba28bea71 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml @@ -12,7 +12,6 @@ exporters: shared_credential_file: fake-path extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml index 3064358227..b21170012f 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -29,9 +28,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType refresh_interval_seconds: 0s receivers: telegraf_win_perf_counters/1492679118: @@ -71,11 +70,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 8a3188bcd1..4b47c80f3c 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml @@ -12,7 +12,6 @@ exporters: shared_credential_file: fake-path extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: @@ -78,11 +77,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_win_perf_counters/3446270237 - 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 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml b/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml index 401a8c27f2..9bbfe327b6 100644 --- a/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml b/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml index 35e786e5dc..477bf89526 100644 --- a/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml b/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml index 0220d83992..4190308c25 100644 --- a/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml b/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml index b0fbeb16d6..4539d123c6 100644 --- a/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml @@ -10,7 +10,6 @@ exporters: enabled: true extensions: agenthealth/metrics: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/trace_config_linux.yaml b/translator/tocwconfig/sampleConfig/trace_config_linux.yaml index cec74b77ed..11aceb51c8 100644 --- a/translator/tocwconfig/sampleConfig/trace_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/trace_config_linux.yaml @@ -23,7 +23,6 @@ exporters: transit_spans_in_otlp_format: true extensions: agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/sampleConfig/trace_config_windows.yaml b/translator/tocwconfig/sampleConfig/trace_config_windows.yaml index 060e16d3a5..4ab7efc002 100644 --- a/translator/tocwconfig/sampleConfig/trace_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/trace_config_windows.yaml @@ -23,7 +23,6 @@ exporters: transit_spans_in_otlp_format: true extensions: agenthealth/traces: - is_status_code_only: false is_usage_data_enabled: true stats: operations: diff --git a/translator/tocwconfig/tocwconfig_test.go b/translator/tocwconfig/tocwconfig_test.go index e542a3ef9e..218e2d3c13 100644 --- a/translator/tocwconfig/tocwconfig_test.go +++ b/translator/tocwconfig/tocwconfig_test.go @@ -774,7 +774,7 @@ func verifyToYamlTranslation(t *testing.T, input interface{}, expectedYamlFilePa require.NoError(t, err) yamlStr := toyamlconfig.ToYamlConfig(yamlConfig) require.NoError(t, yaml.Unmarshal([]byte(yamlStr), &actual)) - assert.NoError(t, os.WriteFile(expectedYamlFilePath, []byte(yamlStr), 0644)) // useful for regenerating YAML + //assert.NoError(t, os.WriteFile(expectedYamlFilePath, []byte(yamlStr), 0644)) // useful for regenerating YAML opt := cmpopts.SortSlices(func(x, y interface{}) bool { return pretty.Sprint(x) < pretty.Sprint(y) From f3c8d46cfc467f1d0f45a0ae3b5e9c716eacff98 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 18:01:43 -0500 Subject: [PATCH 31/91] fixing yamls --- internal/tls/testdata/server.crt | 44 +- internal/tls/testdata/server.key | 52 +- internal/tls/testdata/tls-ca.crt | 50 +- .../sampleConfig/advanced_config_darwin.yaml | 6 +- .../sampleConfig/advanced_config_linux.yaml | 8 +- .../sampleConfig/advanced_config_windows.yaml | 4 +- .../sampleConfig/amp_config_linux.yaml | 326 +-- .../appsignals_and_ecs_config.yaml | 1392 ++++----- .../appsignals_and_eks_config.yaml | 1161 ++++---- .../appsignals_and_k8s_config.yaml | 1165 ++++---- .../appsignals_fallback_and_eks_config.yaml | 2589 ++++++++--------- .../appsignals_over_fallback_config.yaml | 2589 ++++++++--------- .../sampleConfig/base_appsignals_config.yaml | 1153 ++++---- .../base_appsignals_fallback_config.yaml | 2175 +++++++------- .../base_container_insights_config.yaml | 4 +- .../sampleConfig/basic_config_linux.yaml | 2 +- .../sampleConfig/basic_config_windows.yaml | 4 +- .../sampleConfig/collectd_config_linux.yaml | 2 +- .../sampleConfig/compass_linux_config.yaml | 4 +- .../sampleConfig/complete_darwin_config.yaml | 22 +- .../sampleConfig/complete_linux_config.yaml | 38 +- .../sampleConfig/container_insights_jmx.yaml | 4 +- .../sampleConfig/delta_config_linux.yaml | 14 +- .../sampleConfig/delta_net_config_linux.yaml | 4 +- .../sampleConfig/drop_origin_linux.yaml | 12 +- .../emf_and_kubernetes_config.yaml | 2 +- .../emf_and_kubernetes_with_gpu_config.yaml | 220 +- .../ignore_append_dimensions.yaml | 4 +- .../sampleConfig/invalid_input_linux.yaml | 2 +- .../sampleConfig/jmx_config_linux.yaml | 10 +- .../sampleConfig/jmx_eks_config_linux.yaml | 6 +- .../kubernetes_on_prem_config.yaml | 4 +- .../tocwconfig/sampleConfig/log_filter.yaml | 64 +- .../sampleConfig/log_only_config_windows.yaml | 64 +- .../logs_and_kubernetes_config.yaml | 5 +- .../sampleConfig/no_skip_log_timestamp.yaml | 64 +- .../no_skip_log_timestamp_windows.yaml | 64 +- .../otlp_metrics_cloudwatchlogs_config.yaml | 242 +- .../sampleConfig/otlp_metrics_config.yaml | 210 +- .../procstat_memory_swap_config.yaml | 114 +- .../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 | 2 +- ...ndard_config_linux_with_common_config.yaml | 4 +- .../sampleConfig/standard_config_windows.yaml | 4 +- ...ard_config_windows_with_common_config.yaml | 2 +- .../sampleConfig/statsd_config_linux.yaml | 2 +- .../sampleConfig/statsd_config_windows.yaml | 2 +- .../sampleConfig/statsd_ecs_config.yaml | 92 +- .../sampleConfig/statsd_eks_config.yaml | 114 +- .../windows_eventlog_only_config.yaml | 18 +- translator/tocwconfig/tocwconfig_test.go | 3 +- 54 files changed, 7160 insertions(+), 7238 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..32180f9832 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtcXSqWmtWEB -LiHPhSU0HN5JWsfQZ2VkB8rFStQ8CwFG0DW9i6GSVsN1zmmzLQdVPAyP4Uzy8844 -/ceZsmlkIe6uk3BiRRNThUcJKlFJJroCBJ8y7AJA8s3teLWskRLik+0xintked6z -fMaQRgzOSPDc062QTODHB2IkShVZAeLh7OcCAwEAAaNnMGUwDgYDVR0PAQH/BAQD -AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgw -FoAUhscCtqKgl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5y2MeBTPyBuMt7ZsMrL5Tan6JqKcg6xG95uOEIWyeO3sN4d9j -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..ec71f82f23 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHnes3zGkEYMzkjw3NOtkEzgxwdiJEoV -WQHi4eznAgMBAAECggEAGv7z1O32jXc+ouG40NewNVmXQRW0NMQ0w4Vn6UYZNXlj -BWjQJaVquCQAhEMUkDBma9jnHM7dZ5obie0+Joa5p/6Mu6M2oSR1IVx7Myq284Jk -1Ys/w7u5ESYf33pWmqiGQlbpSxamXvLoWaM7OT5veilRlkgjqiAmerj9EceRP5mR -aheVE5ctY5oZmdnvA9OcN6B8Oxk59EWEOECs8qAF/ChYfC8pWKOp4U0RILQ/9jXD -lu4p0C2XyadrJReer3whudUADWa/WSxgVCrx85/g/RTKs38KTPy7W4g3bv8KBRhc -bjLzoYTl6esRAi8nMG5Fc/85t07hkVv+j5a1NccxgQKBgQD/y/tdH90C8CrAn9y5 -mgr+1QcqJeJWaBpNf+yBqtLbybl6uLY2OzbZtzllU+TDUVlKZB36t2GnG6EIRUcd -WTHUVq8zEIRtDBa12SZlJ08FrNFyKfBByehEO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00Zfpu1zRAK6UfQW6JrxwmYkXTcu/+jfniQx5oFWZam97JXVygm4QR0GMm5V +PV54DgVn3Dp+257eF8iXY7WTwwMwsD8AxcTgERgVAoGBAMeAIbkzTbKePfpb55es +GHd4xtchqgPUtG2ZusK/YosIPoyKkyuOjdGPcWzZzX7PWFo+qwv3u+Uxy06R2cKs +gUk+KIWFyiUJn9snOgdV3gTWWDYL+eTVk5k18MJPaMpkVBMn2shzvZZ4ZbMSgE4P +kb9yslpf/18DdC8Q0/wzBxlb -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..a68c13893f 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rMPbRsnGvIebh -FZsA60QnhuNiL6MowdJn17/Stl6Rs7cNV5zq3/WmaiipOoTcrKIMgA5ci23A69Pz -0WRfomoFsstRWHhimGrKrT5ewznEitvnWWxfiblmy21LTTJf6nrf7cD1B7Xlrfq+ -BORuHwSxyTapXw0HKSYPwjiSiijywWInS3QR3b5uvpyFy8rGfXI2PSTpn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4o+LeHc8akSql4lP/qPUP3n5fkRNOxr5VTKf6iQ +cYlggky4nxzY2CSgCNYm+WrzgXJKa7c1v3VPU1lwesJT3m2Xyj989DJbTTW30pfi +4CnVTRBCKXZU/p9Ce6W+6CcVb5D91dCXPDwe/CvbuITaGHnLZfB9fjiXKaCfMdjn +RIiR0FUGwj7f/2Wp/j/N4AJVdFaLLeGSFGrcOw/Lv7b8ssDdSFX/AU8f3s0TtabI +mpgqk5L0w9smzm1gwydp0eK4PL9kTZz+jt1ZXYzmDEFHMShTCle6deWyXtHuKpdF +QKeT66FT99DFALP0TPASn0EgBH+zPBWK6Amzyt/C2Z0HY1Yy8PZKCT5tN+KkBWYM +pi625MqtH4lxyZkOFpVHkDBTBOneMMHCGF0xDRuDi/X3iMxLNtRkixSdQ5uSsiYy +IuWfEV7ZzrnRHQenJ8Ghf3/8AXLljPYQ6po0xNa0CWKS/vLLMMrNZxTs86eInUkn +ZoPzbAxVEO/vEZ7F8j6DSdsA9QTju6qpNxI= -----END CERTIFICATE----- diff --git a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml index 7ec8a1544a..64d81aaa17 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_darwin.yaml @@ -38,9 +38,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: @@ -80,11 +80,11 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_cpu - telegraf_disk - - telegraf_mem - telegraf_netstat - telegraf_swap + - telegraf_cpu + - telegraf_mem metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml index 08e123680c..b202e49fd9 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_linux.yaml @@ -23,7 +23,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict @@ -88,13 +88,13 @@ service: - awsentity/resource - ec2tagger receivers: + - telegraf_cpu + - telegraf_disk + - telegraf_mem - telegraf_netstat - telegraf_swap - telegraf_ethtool - telegraf_nvidia_smi - - telegraf_cpu - - telegraf_disk - - telegraf_mem metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml index 2db1d4f417..0b7068462e 100644 --- a/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/advanced_config_windows.yaml @@ -81,13 +81,13 @@ service: - awsentity/resource - ec2tagger receivers: + - 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 - - telegraf_win_perf_counters/2039663244 - - telegraf_win_perf_counters/4283769065 telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml index 09d1eb1632..d32905f7ca 100644 --- a/translator/tocwconfig/sampleConfig/amp_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/amp_config_linux.yaml @@ -1,168 +1,168 @@ 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 - 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 + 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 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 + 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: - - ImageId - - InstanceId - - InstanceType - 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: + - 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: [ ] 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/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: {} + 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: { } diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml index bd2ae3a253..a97027c87f 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_ecs_config.yaml @@ -1,106 +1,106 @@ 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 - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - RemoteOperation - - RemoteService - - Service - - - Environment - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - - RemoteService + - - Environment + - Operation + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - 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: @@ -117,12 +117,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 @@ -144,18 +144,18 @@ extensions: mode: EC2 region_type: ACJ awsproxy/application_signals: - aws_endpoint: "" - certificate_file_path: "" + aws_endpoint: '' dialer: timeout: 0s - endpoint: 0.0.0.0:2000 + certificate_file_path: '' + endpoint: '0.0.0.0:2000' imds_retries: 1 local_mode: false - profile: "" - proxy_address: "" + profile: '' + proxy_address: '' region: us-east-1 - role_arn: "" - service_name: "" + service_name: '' + role_arn: '' processors: awsapplicationsignals: limiter: @@ -165,584 +165,8 @@ 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: @@ -775,11 +199,11 @@ processors: host.name: enabled: true tags: [] - compression: "" + compression: '' consul: - address: "" - datacenter: "" - namespace: "" + address: '' + datacenter: '' + namespace: '' resource_attributes: cloud.region: enabled: true @@ -787,7 +211,7 @@ processors: enabled: true host.name: enabled: true - token_file: "" + token_file: '' detectors: - env - ecs @@ -820,7 +244,7 @@ processors: host.type: enabled: true tags: - - ^aws:autoscaling:groupName + - '^aws:autoscaling:groupName' ecs: resource_attributes: aws.ecs.cluster.arn: @@ -831,10 +255,10 @@ processors: enabled: false aws.ecs.task.family: enabled: false - aws.ecs.task.id: - enabled: false aws.ecs.task.revision: enabled: false + aws.ecs.task.id: + enabled: false aws.log.group.arns: enabled: false aws.log.group.names: @@ -873,7 +297,7 @@ processors: enabled: true service.version: enabled: true - endpoint: "" + endpoint: '' gcp: resource_attributes: cloud.account.id: @@ -933,9 +357,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 @@ -963,7 +387,7 @@ processors: enabled: true max_idle_conns: 100 openshift: - address: "" + address: '' resource_attributes: cloud.platform: enabled: true @@ -974,19 +398,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: @@ -1018,55 +442,631 @@ 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: @@ -1105,6 +1105,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 f9306ebb3f..1d71ffb03b 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_eks_config.yaml @@ -104,15 +104,14 @@ 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 @@ -296,14 +295,14 @@ extensions: role_arn: "" service_name: "" entitystore: - kubernetes_mode: EKS - mode: ec2 - region: us-east-1 + 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 + 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: @@ -325,582 +324,6 @@ 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: @@ -1188,6 +611,570 @@ 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 diff --git a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml index 7691642f51..5b099d0315 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_and_k8s_config.yaml @@ -104,15 +104,14 @@ 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 @@ -297,14 +296,14 @@ extensions: role_arn: "" service_name: "" entitystore: - kubernetes_mode: K8sEC2 - mode: ec2 - region: us-east-1 + mode: ec2 + region: us-east-1 + kubernetes_mode: K8sEC2 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: @@ -314,8 +313,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 @@ -326,582 +325,6 @@ 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: @@ -1189,6 +612,570 @@ 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 diff --git a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml index f9306ebb3f..bfcea74610 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_fallback_and_eks_config.yaml @@ -1,1307 +1,1294 @@ 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 - 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 + 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 - 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 + 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 + dialer: + timeout: "0s" + include_metadata: false + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 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: "" + 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 -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 + 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 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: + - 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: {} diff --git a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml index f9306ebb3f..454a1bfa23 100644 --- a/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/appsignals_over_fallback_config.yaml @@ -1,1307 +1,1294 @@ 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 - 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 + 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 - 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 + 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 + dialer: + timeout: "0s" + include_metadata: false + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 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: "" + 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 -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 + 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: + - 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: {} diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml index 0393281fb9..24afc038e6 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_config.yaml @@ -74,15 +74,14 @@ 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 @@ -176,582 +175,6 @@ 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: @@ -1039,6 +462,570 @@ 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: diff --git a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml index 5cffc25e9d..9791f903dd 100644 --- a/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_appsignals_fallback_config.yaml @@ -1,1099 +1,1086 @@ 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 - - RemoteOperation - - RemoteResourceIdentifier - - RemoteResourceType - - RemoteService - - Service - - - Environment - - Operation - - RemoteOperation - - RemoteService - - Service - - - Environment - - 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 + - RemoteOperation + - RemoteResourceIdentifier + - RemoteResourceType + - RemoteService + - Service + - - Environment + - Operation + - RemoteOperation + - RemoteService + - Service + - - Environment + - 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 - certificate_file_path: "" - dialer: - 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 + 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 - 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 + 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: - 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 + 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/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 8a910d80ee..618e81c072 100644 --- a/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml +++ b/translator/tocwconfig/sampleConfig/base_container_insights_config.yaml @@ -149,8 +149,8 @@ extensions: 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 diff --git a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml index a77f558584..9a349c682e 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_linux.yaml @@ -28,9 +28,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml index 01d9efe369..31c7c5229b 100644 --- a/translator/tocwconfig/sampleConfig/basic_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/basic_config_windows.yaml @@ -23,14 +23,14 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - ImageId - InstanceId - InstanceType - - ImageId imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml b/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml index f01c8c504e..a1ecf22c1e 100644 --- a/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/collectd_config_linux.yaml @@ -23,8 +23,8 @@ extensions: processors: awsentity/service/telegraf: entity_type: Service - platform: ec2 scrape_datapoint_attribute: true + platform: ec2 receivers: telegraf_socket_listener: collection_interval: 1m0s diff --git a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml index d8f4365eaf..ab934cba89 100644 --- a/translator/tocwconfig/sampleConfig/compass_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/compass_linux_config.yaml @@ -34,15 +34,15 @@ extensions: processors: awsentity/service/telegraf: entity_type: Service - platform: ec2 scrape_datapoint_attribute: true + platform: ec2 ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - ImageId - InstanceId - InstanceType + - ImageId imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml index ad049493b3..ec2a2d8994 100644 --- a/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_darwin_config.yaml @@ -100,8 +100,8 @@ processors: platform: ec2 awsentity/service/telegraf: entity_type: Service - platform: ec2 scrape_datapoint_attribute: true + platform: ec2 batch/emf_logs: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -126,9 +126,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s transform: @@ -138,11 +138,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: @@ -275,12 +275,12 @@ service: - ec2tagger - transform receivers: + - telegraf_procstat/1917393364 - telegraf_cpu - - telegraf_processes - - telegraf_swap - telegraf_mem - telegraf_netstat - - telegraf_procstat/1917393364 + - telegraf_processes + - telegraf_swap - telegraf_disk metrics/hostCustomMetrics: exporters: @@ -301,8 +301,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 3ac881c155..e54d859883 100644 --- a/translator/tocwconfig/sampleConfig/complete_linux_config.yaml +++ b/translator/tocwconfig/sampleConfig/complete_linux_config.yaml @@ -102,11 +102,11 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 awsentity/service/telegraf: entity_type: Service - platform: ec2 scrape_datapoint_attribute: true + platform: ec2 batch/emf_logs: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -138,9 +138,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 1 refresh_interval_seconds: 0s filter/jmx/0: @@ -189,11 +189,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 == "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 +202,9 @@ processors: metric_statements: - context: metric statements: - - 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" + - 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" trace_statements: [] transform/jmx/1: error_mode: propagate @@ -213,7 +213,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: @@ -381,13 +381,13 @@ service: - ec2tagger - transform receivers: - - telegraf_processes - - telegraf_cpu - - telegraf_swap - - telegraf_disk - - telegraf_netstat - telegraf_mem + - telegraf_netstat - telegraf_procstat/1917393364 + - telegraf_swap + - telegraf_cpu + - telegraf_disk + - telegraf_processes metrics/hostCustomMetrics/cloudwatch: exporters: - awscloudwatch @@ -396,8 +396,8 @@ service: - ec2tagger - transform receivers: - - telegraf_statsd - telegraf_socket_listener + - telegraf_statsd metrics/hostDeltaMetrics/cloudwatch: exporters: - awscloudwatch @@ -407,8 +407,8 @@ service: - ec2tagger - transform receivers: - - telegraf_net - telegraf_diskio + - telegraf_net metrics/jmx/cloudwatch/0: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml index aa14bdf130..28be63530c 100644 --- a/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml +++ b/translator/tocwconfig/sampleConfig/container_insights_jmx.yaml @@ -183,8 +183,8 @@ extensions: 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 diff --git a/translator/tocwconfig/sampleConfig/delta_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_config_linux.yaml index 05df69691c..6a27ffc90d 100644 --- a/translator/tocwconfig/sampleConfig/delta_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_config_linux.yaml @@ -23,7 +23,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict @@ -50,12 +50,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: diff --git a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml index b0ebe0edb1..f6601c168d 100644 --- a/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/delta_net_config_linux.yaml @@ -23,7 +23,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: "" @@ -35,9 +35,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - ImageId - InstanceId - InstanceType + - ImageId imds_retries: 1 refresh_interval_seconds: 0s receivers: diff --git a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml index 8c19d0bee1..a458852b8e 100644 --- a/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml +++ b/translator/tocwconfig/sampleConfig/drop_origin_linux.yaml @@ -28,14 +28,14 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceId - InstanceType - ImageId + - InstanceId imds_retries: 1 refresh_interval_seconds: 0s transform: @@ -45,9 +45,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: @@ -75,9 +75,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..18e4401d58 100644 --- a/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml @@ -134,9 +134,9 @@ exporters: - pod_memory_request - pod_memory_limit - pod_cpu_limit - - pod_cpu_request - pod_cpu_usage_total - pod_memory_working_set + - pod_cpu_request - pod_container_status_running - pod_container_status_terminated - pod_container_status_waiting 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 c236a12b33..169eb97852 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_limit - node_gpu_usage_total + - node_gpu_limit - node_gpu_reserved_capacity - dimensions: - - ClusterName @@ -685,9 +685,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_UTIL + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: container_gpu_utilization + new_name: container_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -696,12 +696,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_UTIL + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: pod_gpu_utilization + new_name: pod_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -710,12 +717,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_UTIL + include: DCGM_FI_DEV_FB_USED match_type: "" - new_name: node_gpu_utilization + new_name: node_gpu_memory_used operations: - action: add_label aggregation_type: "" @@ -724,12 +738,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_FB_USED_PERCENT + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: container_gpu_memory_utilization + new_name: container_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -740,7 +761,7 @@ processors: new_value: ContainerGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 100 + experimental_scale: 1.048576e+06 label: "" label_value: "" new_label: "" @@ -748,9 +769,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: pod_gpu_memory_utilization + new_name: pod_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -761,7 +782,7 @@ processors: new_value: PodGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 100 + experimental_scale: 1.048576e+06 label: "" label_value: "" new_label: "" @@ -769,9 +790,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED_PERCENT + include: DCGM_FI_DEV_FB_TOTAL match_type: "" - new_name: node_gpu_memory_utilization + new_name: node_gpu_memory_total operations: - action: add_label aggregation_type: "" @@ -782,7 +803,7 @@ processors: new_value: NodeGPU - action: experimental_scale_value aggregation_type: "" - experimental_scale: 100 + experimental_scale: 1.048576e+06 label: "" label_value: "" new_label: "" @@ -790,9 +811,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_FB_USED + include: DCGM_FI_DEV_GPU_TEMP match_type: "" - new_name: container_gpu_memory_used + new_name: container_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -801,19 +822,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_TEMP match_type: "" - new_name: pod_gpu_memory_used + new_name: pod_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -822,19 +836,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_TEMP match_type: "" - new_name: node_gpu_memory_used + new_name: node_gpu_temperature operations: - action: add_label aggregation_type: "" @@ -843,19 +850,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_POWER_USAGE match_type: "" - new_name: container_gpu_memory_total + new_name: container_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -864,19 +864,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_TOTAL + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: pod_gpu_memory_total + new_name: pod_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -885,19 +878,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_TOTAL + include: DCGM_FI_DEV_POWER_USAGE match_type: "" - new_name: node_gpu_memory_total + new_name: node_gpu_power_draw operations: - action: add_label aggregation_type: "" @@ -906,19 +892,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_GPU_TEMP + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: container_gpu_temperature + new_name: container_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -930,9 +909,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: pod_gpu_temperature + new_name: pod_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -944,9 +923,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_GPU_TEMP + include: DCGM_FI_DEV_GPU_UTIL match_type: "" - new_name: node_gpu_temperature + new_name: node_gpu_utilization operations: - action: add_label aggregation_type: "" @@ -958,9 +937,9 @@ processors: submatch_case: "" - action: insert aggregation_type: "" - include: DCGM_FI_DEV_POWER_USAGE + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: container_gpu_power_draw + new_name: container_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -969,12 +948,19 @@ 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_POWER_USAGE + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: pod_gpu_power_draw + new_name: pod_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -983,12 +969,19 @@ 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_POWER_USAGE + include: DCGM_FI_DEV_FB_USED_PERCENT match_type: "" - new_name: node_gpu_power_draw + new_name: node_gpu_memory_utilization operations: - action: add_label aggregation_type: "" @@ -997,68 +990,68 @@ 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: execution_status_total - match_type: "" - new_name: neuron_execution_status - operations: [] - submatch_case: "" - - action: update - aggregation_type: "" - include: neuron_runtime_memory_used_bytes + include: neuron_hardware match_type: "" - new_name: neurondevice_runtime_memory_used_bytes + new_name: neuron_hardware operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_shared_scratchpad + include: execution_errors_total match_type: "" - new_name: neuroncore_memory_usage_model_shared_scratchpad + new_name: neuron_execution_errors operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_tensors + include: neuron_runtime_memory_used_bytes match_type: "" - new_name: neuroncore_memory_usage_tensors + new_name: neurondevice_runtime_memory_used_bytes operations: [] submatch_case: "" - action: update aggregation_type: "" - include: instance_info + include: neuroncore_memory_usage_constants match_type: "" - new_name: instance_info + new_name: neuroncore_memory_usage_constants operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuron_hardware + include: neuroncore_memory_usage_model_code match_type: "" - new_name: neuron_hardware + new_name: neuroncore_memory_usage_model_code operations: [] submatch_case: "" - action: update aggregation_type: "" - include: hardware_ecc_events_total + include: neuroncore_memory_usage_model_shared_scratchpad match_type: "" - new_name: neurondevice_hw_ecc_events + new_name: neuroncore_memory_usage_model_shared_scratchpad operations: [] submatch_case: "" - action: update aggregation_type: "" - include: execution_errors_total + include: neuroncore_memory_usage_tensors match_type: "" - new_name: neuron_execution_errors + new_name: neuroncore_memory_usage_tensors operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_model_code + include: execution_status_total match_type: "" - new_name: neuroncore_memory_usage_model_code + new_name: neuron_execution_status operations: [] submatch_case: "" - action: update @@ -1084,16 +1077,23 @@ processors: submatch_case: "" - action: update aggregation_type: "" - include: execution_latency_seconds + include: instance_info match_type: "" - new_name: neuron_execution_latency + new_name: instance_info operations: [] submatch_case: "" - action: update aggregation_type: "" - include: neuroncore_memory_usage_constants + include: hardware_ecc_events_total match_type: "" - new_name: neuroncore_memory_usage_constants + new_name: neurondevice_hw_ecc_events + operations: [] + submatch_case: "" + - action: update + aggregation_type: "" + include: execution_latency_seconds + match_type: "" + new_name: neuron_execution_latency operations: [] submatch_case: "" receivers: diff --git a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml index 597ae1ccf7..d38f02f2cd 100644 --- a/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml +++ b/translator/tocwconfig/sampleConfig/ignore_append_dimensions.yaml @@ -23,7 +23,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 ec2tagger: imds_retries: 1 refresh_interval_seconds: 0s @@ -48,8 +48,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_mem - telegraf_disk + - telegraf_mem telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml index 9a349c682e..373ba8e154 100644 --- a/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml +++ b/translator/tocwconfig/sampleConfig/invalid_input_linux.yaml @@ -54,8 +54,8 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_mem - telegraf_disk + - telegraf_mem telemetry: logs: development: false diff --git a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml index fa7fd7e62f..2bd2541d3e 100644 --- a/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_config_linux.yaml @@ -66,8 +66,8 @@ extensions: 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 +75,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 batch/host/amp: metadata_cardinality_limit: 1000 send_batch_max_size: 0 @@ -128,11 +128,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 diff --git a/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml b/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml index c0ec7df581..a4edf266d3 100644 --- a/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/jmx_eks_config_linux.yaml @@ -62,13 +62,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 9eb61610ae..68118d53b9 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 diff --git a/translator/tocwconfig/sampleConfig/log_filter.yaml b/translator/tocwconfig/sampleConfig/log_filter.yaml index 6ca631da29..0b694fca94 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: {} + 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 diff --git a/translator/tocwconfig/sampleConfig/log_only_config_windows.yaml b/translator/tocwconfig/sampleConfig/log_only_config_windows.yaml index 391143c01f..a01b2785ed 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: {} + 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 diff --git a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml index 266b1a4959..28594ce0e7 100644 --- a/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml +++ b/translator/tocwconfig/sampleConfig/logs_and_kubernetes_config.yaml @@ -395,8 +395,9 @@ extensions: 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 diff --git a/translator/tocwconfig/sampleConfig/no_skip_log_timestamp.yaml b/translator/tocwconfig/sampleConfig/no_skip_log_timestamp.yaml index 11a14c9ad5..e3327e1d00 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: {} + 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 diff --git a/translator/tocwconfig/sampleConfig/no_skip_log_timestamp_windows.yaml b/translator/tocwconfig/sampleConfig/no_skip_log_timestamp_windows.yaml index 391143c01f..a01b2785ed 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: {} + 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 diff --git a/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml b/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml index 3b03def357..f6233cf355 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_cloudwatchlogs_config.yaml @@ -1,126 +1,126 @@ 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 + 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 - 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 + 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 service: - extensions: - - agenthealth/logs - - 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: {} + 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: { } diff --git a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml index 5ee9d0b9a7..8f47cce671 100644 --- a/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml +++ b/translator/tocwconfig/sampleConfig/otlp_metrics_config.yaml @@ -1,110 +1,110 @@ 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 + 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 + 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 - 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 + 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 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 + - 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 f811c89411..cfce7bfa44 100644 --- a/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml +++ b/translator/tocwconfig/sampleConfig/procstat_memory_swap_config.yaml @@ -1,61 +1,61 @@ 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 + 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 + - 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/skip_log_timestamp.yaml b/translator/tocwconfig/sampleConfig/skip_log_timestamp.yaml index e417a5320a..df1b94808d 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: {} + 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 diff --git a/translator/tocwconfig/sampleConfig/skip_log_timestamp_default.yaml b/translator/tocwconfig/sampleConfig/skip_log_timestamp_default.yaml index 11a14c9ad5..e3327e1d00 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: {} + 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 diff --git a/translator/tocwconfig/sampleConfig/skip_log_timestamp_default_windows.yaml b/translator/tocwconfig/sampleConfig/skip_log_timestamp_default_windows.yaml index 391143c01f..a01b2785ed 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: {} + 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 diff --git a/translator/tocwconfig/sampleConfig/skip_log_timestamp_windows.yaml b/translator/tocwconfig/sampleConfig/skip_log_timestamp_windows.yaml index d29a89a498..e3dd15b6ba 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: {} + 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 diff --git a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml index 6160b8d27c..99724c7d28 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux.yaml @@ -23,7 +23,7 @@ extensions: processors: awsentity/resource: entity_type: Resource - platform: ec2 + platform: ec2 cumulativetodelta/hostDeltaMetrics: exclude: match_type: strict 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 dba28bea71..13bac887c2 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_linux_with_common_config.yaml @@ -82,10 +82,10 @@ service: - awsentity/resource - ec2tagger receivers: - - telegraf_mem - - telegraf_swap - telegraf_cpu - telegraf_disk + - telegraf_mem + - telegraf_swap metrics/hostDeltaMetrics: exporters: - awscloudwatch diff --git a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml index b21170012f..8df619d970 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows.yaml @@ -28,9 +28,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: - - InstanceType - ImageId - InstanceId + - InstanceType refresh_interval_seconds: 0s receivers: telegraf_win_perf_counters/1492679118: @@ -70,11 +70,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 4b47c80f3c..2914d1bb74 100644 --- a/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml +++ b/translator/tocwconfig/sampleConfig/standard_config_windows_with_common_config.yaml @@ -32,9 +32,9 @@ processors: ec2_instance_tag_keys: - AutoScalingGroupName ec2_metadata_tags: + - InstanceType - ImageId - InstanceId - - InstanceType imds_retries: 2 profile: AmazonCloudWatchAgent refresh_interval_seconds: 0s diff --git a/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml b/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml index 9bbfe327b6..0034301d02 100644 --- a/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_config_linux.yaml @@ -23,8 +23,8 @@ extensions: processors: awsentity/service/telegraf: entity_type: Service - platform: ec2 scrape_datapoint_attribute: true + platform: ec2 receivers: telegraf_statsd: collection_interval: 10s diff --git a/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml b/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml index 477bf89526..6aeeae4dd6 100644 --- a/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_config_windows.yaml @@ -23,8 +23,8 @@ extensions: processors: awsentity/service/telegraf: entity_type: Service - platform: ec2 scrape_datapoint_attribute: true + platform: ec2 receivers: telegraf_statsd: collection_interval: 10s diff --git a/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml b/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml index 4190308c25..0e0e2da5a1 100644 --- a/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_ecs_config.yaml @@ -1,50 +1,50 @@ 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 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 + 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 4539d123c6..2ed69a21d4 100644 --- a/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml +++ b/translator/tocwconfig/sampleConfig/statsd_eks_config.yaml @@ -1,61 +1,61 @@ 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: - 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 + 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" 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 + - 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/windows_eventlog_only_config.yaml b/translator/tocwconfig/sampleConfig/windows_eventlog_only_config.yaml index 391143c01f..78c680ddcf 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: {} + traces: { } \ No newline at end of file diff --git a/translator/tocwconfig/tocwconfig_test.go b/translator/tocwconfig/tocwconfig_test.go index 218e2d3c13..c607257a3a 100644 --- a/translator/tocwconfig/tocwconfig_test.go +++ b/translator/tocwconfig/tocwconfig_test.go @@ -774,12 +774,11 @@ func verifyToYamlTranslation(t *testing.T, input interface{}, expectedYamlFilePa require.NoError(t, err) yamlStr := toyamlconfig.ToYamlConfig(yamlConfig) require.NoError(t, yaml.Unmarshal([]byte(yamlStr), &actual)) - //assert.NoError(t, os.WriteFile(expectedYamlFilePath, []byte(yamlStr), 0644)) // useful for regenerating YAML opt := cmpopts.SortSlices(func(x, y interface{}) bool { return pretty.Sprint(x) < pretty.Sprint(y) }) - //assert.Equal(t, expected, actual) // this is useful for debugging differences between the YAML + // assert.Equal(t, expected, actual) // this is useful for debugging differences between the YAML require.True(t, cmp.Equal(expected, actual, opt), "D! YAML diff: %s", cmp.Diff(expected, actual)) } From f64b332d600f88ff5c1ed7659a3f8d9f5add90bd Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 18:02:41 -0500 Subject: [PATCH 32/91] removing internal changes --- internal/tls/testdata/server.crt | 44 +++++++++++++-------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 32180f9832..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGTCCAgGgAwIBAgIRAJod3LqRKFW/22rMh8kx5wYwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHUm9vdCBDQTAeFw0yNDExMTkyMjU4MTJaFw0yNDExMTkyMzU4 -MTJaMBUxEzARBgNVBAoTCkt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDFb68a9n3w6373C2BcfefNqPx3mfV5RVE7QLXanDUkaN/eFPzw -iUfRq6DWoTODD0G/tBuJmXP/6bLTyDRGljtKmpLm57IgAMDgBIwL+YFLxeEkfwoh -rz5E3YAUfZeGZhdQv3yHnhuPRZWBEYxHZ2zXALtV2u/7jhVrr17ylXe1LhQoI4SH -BLXmszSiPfUwamz8lUwptClF2ymjf/k99VEBNxL71n/vASfUJ5mOkxsUNO1xn6b8 -jTZiACAMQ+CAUfPmrOWljr042FXzxOQFzHEEzKo1edvXIOrcBzWrj7PpeIv4YzZw -/xld/zI3oBFWWphfK3uJepq6eqVtoChdNkhbAgMBAAGjZzBlMA4GA1UdDwEB/wQE -AwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQY -MBaAFC3eobfBsK9iPtSsypG2sK1J6aKeMA8GA1UdEQQIMAaHBH8AAAEwDQYJKoZI -hvcNAQELBQADggIBAL41rosLV+MlHKOIGESDYXGTagqzZnYnjeEd4ZsJ5R9R7eek -5nFgOm5ZBSFtKsHZwq5OrUh4nLyJ3DhEshV0w3EJGkdNMhTMWQgLdoc1KKrX+RJi -XLnhRbVcWI8Ln4utl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ked6z +fMaQRgzOSPDc062QTODHB2IkShVZAeLh7OcCAwEAAaNnMGUwDgYDVR0PAQH/BAQD +AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgw +FoAUhscCtqKglSlRCx9YNN1D/Xz5MpMwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG +9w0BAQsFAAOCAgEAcxCGmWNtuM9V2yi0SOSLfxlSK7F1OS5qQuLWkZSDB1f+XG82 +PNDwSrV4J42qZcFfKrEt1HtS/Ws6VRlLrSnYArNSyQvNTeNf0q/rX9yO8wRcCM5K +sb8uv27xdawjN6F3z59rpJOf9ldX4ASrRZHzX/ttvvNcUdbCZsF5+h2EhcwNVVUa +Q6vlAW8u4Ik9HXxJ+W2HEdlSYWcCdTK4hDCtJhwqEBua1VdKwSdrlDZJPswAdCzv +CR3Fj4NsmPRDw8uCPIL4hwk5fbffcn3rZrsOXSMTKxvdyP+XBPKWEoIs6cxvdE3o +sG65EZeGpj0vLN+rLEbumkvgCAHACgVxvyDeJnajoA6lPNxfzby+9CmhLZfgaVbE +nVQTj8hkUW1gtvnAP3v1Zbe3QMhlqWqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index ec71f82f23..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgI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XeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index a68c13893f..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTExOTIyNTgxNFoXDTM0MTExOTIyNTgxNFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMsBV4crk8X6 -/wJceGXm/0qKOskFq8dVTOdCbgEWtWJbLu52QszsCP2i1scpZxrD+q9H2o1OajIe -zmyptU1kajqSRIr+1p/vBNICpUDYAHvhuIjbEboS049RTYkO4EfJN1hl1Ai9ujka -PRqIf18AdFnWlJ8IHvFfQ+kTuQ/ovi+0kbqiLgGiy0Nddazxvgd4sLMYNkZOdYZt -hzVFzXGKI8EWgAT4NvSnZHKOYqbboid8c+CChRn7dcuLAl1z1VrGfkmDAGNWU4D/ -Ukq/cUSBZFF5v1dIpuTwH2yqswbTBY6HkUGijrWla2oJLObgEFxopRk5FZZLTdev -PuOUjnts6wH13vQ7YVRxuGl5PMHXO8XbBblV89Dj65MUFuOR9rFUofy61FlNlWmQ -OFDuSBgVbK7zbW7Y0DxiZk2PL3u1JlIu0ChtevS66gT92NLx9UYvoWPlQevKu5lb -4qqC4gep5Po0TVbsdwJQM7Bk1OuLDuZ7yohzOLsWh0yJd1dhTK5dCOqnsWp5xcN0 -z9qvLFNCwFBh6LOGSqmPrcHgR3sIZbMCG8Jq/m+B67UDqE/xzTDPFy9nZeh0scsf -d33lF9bqwsWr0dPKBJ7mLjfeOxFmIH9/m/6y+qcaRMlO8Z7sLV/o5ei8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E1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From fa4c1633bb2629aa1a185d02910c550bda826508 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 18:07:24 -0500 Subject: [PATCH 33/91] restoring files --- .../handler/stats/agent/agent_test.go | 5 -- .../agenthealth/handler/stats/handler.go | 3 +- .../handler/stats/provider/interval.go | 4 -- .../handler/stats/provider/statuscode_test.go | 8 --- internal/tls/testdata/server.crt | 44 ++++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- plugins/processors/ec2tagger/config.go | 2 - 8 files changed, 74 insertions(+), 94 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent_test.go b/extension/agenthealth/handler/stats/agent/agent_test.go index 9ec8177156..631de211c5 100644 --- a/extension/agenthealth/handler/stats/agent/agent_test.go +++ b/extension/agenthealth/handler/stats/agent/agent_test.go @@ -11,14 +11,12 @@ import ( ) func TestMergeWithStatusCodes(t *testing.T) { - // Initial stats with some status codes stats := &Stats{ StatusCodes: map[string][5]int{ "operation1": {1, 2, 3, 4, 5}, }, } - // Merge with new stats containing additional status codes stats.Merge(Stats{ StatusCodes: map[string][5]int{ "operation1": {2, 3, 4, 5, 6}, // Existing operation with new values @@ -26,16 +24,13 @@ func TestMergeWithStatusCodes(t *testing.T) { }, }) - // Assert merged values 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 - // Merge with empty StatusCodes map stats.Merge(Stats{ StatusCodes: nil, }) - // Assert that StatusCodes remains unchanged 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"]) } diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index e6d00ece83..14f553c3cd 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -87,7 +87,6 @@ func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { } func (sh *statsHandler) Header(operation string) string { - stats := &agent.Stats{} for _, p := range sh.providers { stats.Merge(p.Stats(operation)) @@ -96,7 +95,7 @@ func (sh *statsHandler) Header(operation string) string { header, err := stats.Marshal() if err != nil { - return "" + sh.logger.Warn("Failed to serialize agent stats", zap.Error(err)) } return header diff --git a/extension/agenthealth/handler/stats/provider/interval.go b/extension/agenthealth/handler/stats/provider/interval.go index d2ac2e57ab..9856970a22 100644 --- a/extension/agenthealth/handler/stats/provider/interval.go +++ b/extension/agenthealth/handler/stats/provider/interval.go @@ -41,18 +41,14 @@ func (p *intervalStats) Stats(string) agent.Stats { func (p *intervalStats) getStats() agent.Stats { var stats agent.Stats - // Load the value from the stats field if value := p.stats.Load(); value != nil { - // Perform type assertion safely if s, ok := value.(agent.Stats); ok { stats = s } else { - // Handle the case where the value is not of the expected type log.Println("Error: Loaded value is not of type agent.Stats") } } - // Ensure that the map is not nil if stats.StatusCodes == nil { stats.StatusCodes = make(map[string][5]int) } diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 8b219477d1..0d8a850e17 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -13,22 +13,14 @@ import ( ) func TestStatusCodeHandler(t *testing.T) { - // Create a mock OperationsFilter filter := agent.NewStatusCodeOperationsFilter() - - // Retrieve the handler with the mock filter handler := GetStatusCodeStats(filter) require.NotNil(t, handler) - handler.statsByOperation.Store("pmd", &[5]int{1, 2, 0, 1, 0}) - stats := handler.Stats("pmd") - expected := [5]int{1, 2, 0, 1, 0} - actualStats := stats.StatusCodes["pmd"] assert.Equal(t, expected, actualStats, "Unexpected stats values for operation 'pmd'") - assert.Contains(t, stats.StatusCodes, "pmd", "Status code map should contain 'pmd'") assert.Equal(t, expected, stats.StatusCodes["pmd"], "Stats for 'pmd' do not match") } diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..7418d2e4d6 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtcXSqWmtWEB -LiHPhSU0HN5JWsfQZ2VkB8rFStQ8CwFG0DW9i6GSVsN1zmmzLQdVPAyP4Uzy8844 -/ceZsmlkIe6uk3BiRRNThUcJKlFJJroCBJ8y7AJA8s3teLWskRLik+0xintked6z -fMaQRgzOSPDc062QTODHB2IkShVZAeLh7OcCAwEAAaNn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qAuhGYEMJiOS/r9bxSTrWS9BUKwfL3z8Pvb +prgmnLesA9Mrgyk5hNYkzAKHrEMIlbmmHtNHf9e1vBl30NIG3CcWtU8PbQvLo/a+ +EwB7Ao90Xp/BsYInJyzDKV3c0ndfFFbZVUTQbupc+Ehb2QOVP8NiKIvTq6/r -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..aa112a6e01 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHnes3zGkEYMzkjw3NOtkEzgxwdiJEoV -WQHi4eznAgMBAAECggEAGv7z1O32jXc+ouG40NewNVmXQRW0NMQ0w4Vn6UYZNXlj -BWjQJaVquCQAhEMUkDBma9jnHM7dZ5obie0+Joa5p/6Mu6M2oSR1IVx7Myq284Jk -1Ys/w7u5ESYf33pWmqiGQlbpSxamXvLoWaM7OT5veilRlkgjqiAmerj9EceRP5mR -aheVE5ctY5oZmdnvA9OcN6B8Oxk59EWEOECs8qAF/ChYfC8pWKOp4U0RILQ/9jXD -lu4p0C2XyadrJReer3whudUADWa/WSxgVCrx85/g/RTKs38KTPy7W4g3bv8KBRhc -bjLzoYTl6esRAi8nMG5Fc/85t07hkVv+j5a1NccxgQKBgQD/y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3pProGRKL2XljHSIMcCWpj1zshAoGAAr7j +/t3covViS0UOSNk082ItTlxrN0IZ/yYhcWqa+FT2LLF7WW1XJsvlhZk9IUC0V76f +tIh9a1liEmI7PUWruEJyr3al7XZWS74POZkjF2FfLFKMNy4Uk5z6wmndsoJ6RMy7 +PteOVSHKyglVfqjTBtAeRnjiVbkY55IlH4SA37kCgYBLAcs2UehfNR/zypbj4lkt +iFSPPkY+ffK3mWc2ejidN03IxCSwcyhXIN9A6u21mqQdweOX5c3MOkROHdswIe80 +1nzfj3KHFofp2GEFalVZM3u1g/cROlHo/f36KLVnefl6leFk1uYsO7ZE0xqI8FeD +buGK4cBypsbIUVlAqGpkDg== -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..f77cf4f16c 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rMPbRsnGvIebh -FZsA60QnhuNiL6MowdJn17/Stl6Rs7cNV5zq3/WmaiipOoTcrKIMgA5ci23A69Pz -0WRfomoFsstRWHhimGrKrT5ewznE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d +B0/Uo+il/st1FT8uKsmk3j+GbZdcLgACGiJQf1uG3B4ptyk20JTBmIQ5ENbOasw6 +/c8kg16GEGoeF3aGVJBF6zZlTt+yfE2oquTDfSQ2DT0IjTHQ5XlUb/M9ZZyJrQik +nFQgc8NLXiJOcqxhKxyzPzpCp0oOC+K5CL6lWeIWYV9pP4tqp63c9P2uAmElkZWs +VLXLRrV4s/FNZsYj+Bz59omfzPJap8vXxRhVD/pP1o8gpmnYsi5SXwtHSKWjtitQ +fsL4EkO02CSYS1+5MYe0juvWAgVlG0yR5u8PdtQIgJSSsA7m+s6UNt6PCAttjUKW +XOjsUkV1mDmt1Q6xsyn0WVaanPXgKV3xZqCer52jh3lu+pS3hwO+n+syq/11B7XC +qrst2AW+Hu4Le3S0vezhTb03YYazKiDdT5Rt+ag3VV740306MwdwD5Vkz6iKWMBi +FG89yfQUYz6BAlmKae8z93y7KE33egYnPDV6sYh6CgNhDUMqEimB81RfbMD+5JVH +GJAOKySihIjeO+T/ywx2OW2C+fSK0wC7YJ0Z0viHWDQ7dLYM619Z4WU+PnKPu05/ +U4pEPK5Y8UREuy/Ds8dP9jsnQhTYXL7/xcc= -----END CERTIFICATE----- diff --git a/plugins/processors/ec2tagger/config.go b/plugins/processors/ec2tagger/config.go index 9119139567..1b0549de6e 100644 --- a/plugins/processors/ec2tagger/config.go +++ b/plugins/processors/ec2tagger/config.go @@ -38,8 +38,6 @@ 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. From 457e48c744e58c4f11979d812ddf44c32c0f44a6 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 18:08:42 -0500 Subject: [PATCH 34/91] removing unnecessary file changes and passing unit test --- internal/tls/testdata/server.crt | 44 +++++++++++++-------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 7418d2e4d6..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGTCCAgGgAwIBAgIRAMteT9XiIKUTCXx0IZAFmUwwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHUm9vdCBDQTAeFw0yNDExMTkyMzAzMjhaFw0yNDExMjAwMDAz -MjhaMBUxEzARBgNVBAoTCkt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQCrJbHbyXUkhcRvmsbzQfIOI5sQViXY1l1852G/du7CLFEpmcWG -zXBciAAy96WDqMbs2dkaEIAphGnoOK1ydp6ZLp6erVhIl+TUyZ3z7floH5wfge0E -UAh7I72ZwYyDYhCBy6tA498SvzfX5R+03E+bh7lO7s5bS/ImEuav2NJcGb5tSNHm -UN0zfZJWN/tXB0imo4Ku6nYyUj2KoX6/Q7BaKNidwdwH8G9o+w9F+KY1f/myvd3/ -Djy1+p6vm95nQaFG6dSR+cXz6lH79SWARq1mWOqHo5x/03TjdvMuNG1Pq3COH519 -xt/trlzzcNskMJb6V7AbGPFXGvV9IzxSj66NAgMBAAGjZzBlMA4GA1UdDwEB/wQE -AwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQY -MBaAFIQmJ4BOw9L3WBRada9Ha7bO6selMA8GA1UdEQQIMAaHBH8AAAEwDQYJKoZI -hvcNAQELBQADggIBAJWK54Mry2HDLJIqWWRTlSyWnhq1j7igsJc68keLRoI4c/bP -kat/ycwpQ5Ku5fwN9AfknZhHsNW8ypPjTLNiYnq4fs0FJ8aN7GGBKTlIQpf7wYCD -u3HrVme1YpVkJjGL5Xc0JJ0yW8z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+0xintked6z +fMaQRgzOSPDc062QTODHB2IkShVZAeLh7OcCAwEAAaNnMGUwDgYDVR0PAQH/BAQD +AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgw +FoAUhscCtqKglSlRCx9YNN1D/Xz5MpMwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG +9w0BAQsFAAOCAgEAcxCGmWNtuM9V2yi0SOSLfxlSK7F1OS5qQuLWkZSDB1f+XG82 +PNDwSrV4J42qZcFfKrEt1HtS/Ws6VRlLrSnYArNSyQvNTeNf0q/rX9yO8wRcCM5K +sb8uv27xdawjN6F3z59rpJOf9ldX4ASrRZHzX/ttvvNcUdbCZsF5+h2EhcwNVVUa +Q6vlAW8u4Ik9HXxJ+W2HEdlSYWcCdTK4hDCtJhwqEBua1VdKwSdrlDZJPswAdCzv +CR3Fj4NsmPRDw8uCPIL4hwk5fbffcn3rZrsOXSMTKxvdyP+XBPKWEoIs6cxvdE3o +sG65EZeGpj0vLN+rLEbumkvgCAHACgVxvyDeJnajoA6lPNxfzby+9CmhLZfgaVbE +nVQTj8hkUW1gtvnAP3v1Zbe3QMhlqWqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index aa112a6e01..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MII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vVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index f77cf4f16c..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTExOTIzMDMzM1oXDTM0MTExOTIzMDMzM1owEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJbjg1LmHQFw -4ivYOOIKDn2XVERDjPQScbND/kCpUuuc5XCfgeHjcFLzfrBIWin+TM1UAWQq46jQ -v9kx40nfb7mpiw19ZDhFNnsjcB1PFiBivdirf1BRQuvGRf3NjmhNN/oRf5t2fz2j -fTPN6ILseLkz1QSnplpuzeEzU9EwwG6yfkQlCNODpP0aJLtt1k9JlV+2tBV+6DjG -QSqC0r5Aah/7eY2KCBOAEMyfN9RO7fFuLRBkvY5Iw0SQyr1l/Se+A86rI11I88ex -RFn981Lc+RuNGhg23n6Oao1srSHnB1K2cFOEDZKuicrRnvW383QEGUHIb3cTeAlt -+BbXBjlEq5cRwv0HuGV0+gQxYCgGVT+nLzRsJYKGWDYyk1WAAtHEeWo/OxiDyGsP -jEimcDoO9Ehgs/q9Yf0Yw0jqme/I2GfJ9lUVTbEIBe4trOZ8TBlww+Vsd+YFS+th -sdjxKVcM3gaCM5cinEoT+pNe+QAj8LGXjknXA95LEVwP7b2Q61egSVPVkBANwtZc -F0x9wtL1C7VoM/iPkGNgcrbn9V3IPDVSRZZTBRmrW33UFvZ61MdDg4n7OFde0ZYa -hfbafwnPN3uWZIn3ftgdhRlnOZSbcYNOCHhfq96OQlUFhtDEHQ6g5RT0lrNrP5ZP -1gqulk3dxvb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nxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From 2705e87e9b5119e30ca6629d606a38a65d9a2d7d Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 19 Nov 2024 18:12:03 -0500 Subject: [PATCH 35/91] cleaning up code --- extension/agenthealth/handler/stats/handler.go | 9 --------- extension/agenthealth/handler/stats/provider/interval.go | 1 - 2 files changed, 10 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 14f553c3cd..d7630fbeaa 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -5,7 +5,6 @@ package stats import ( "context" - "log" "net/http" "sync" @@ -72,17 +71,12 @@ func (sh *statsHandler) Position() awsmiddleware.HandlerPosition { func (sh *statsHandler) HandleRequest(ctx context.Context, r *http.Request) { operation := awsmiddleware.GetOperationName(ctx) - if !sh.filter.IsAllowed(operation) { return } - header := sh.Header(operation) - if header != "" { r.Header.Set(headerKeyAgentStats, header) - } else { - log.Println("No header generated for operation:", operation) } } @@ -90,13 +84,10 @@ func (sh *statsHandler) Header(operation string) string { stats := &agent.Stats{} for _, p := range sh.providers { stats.Merge(p.Stats(operation)) - } - header, err := stats.Marshal() if err != nil { sh.logger.Warn("Failed to serialize agent stats", zap.Error(err)) } - return header } diff --git a/extension/agenthealth/handler/stats/provider/interval.go b/extension/agenthealth/handler/stats/provider/interval.go index 9856970a22..00cb857de6 100644 --- a/extension/agenthealth/handler/stats/provider/interval.go +++ b/extension/agenthealth/handler/stats/provider/interval.go @@ -52,7 +52,6 @@ func (p *intervalStats) getStats() agent.Stats { if stats.StatusCodes == nil { stats.StatusCodes = make(map[string][5]int) } - return stats } From 308362692f2514806f87aa91ebe78eb62605b84a Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 20 Nov 2024 15:58:08 -0500 Subject: [PATCH 36/91] fixing up pointer issue and passing in operations --- extension/agenthealth/extension.go | 5 +++- .../agenthealth/handler/stats/agent/agent.go | 24 +++++-------------- .../agenthealth/handler/stats/handler.go | 2 +- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 669c98a98a..ba597f4964 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -30,7 +30,10 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa return requestHandlers, responseHandlers } - statusCodeOnly := ah.cfg.StatusCodeOnly != nil + statusCodeOnly := false + if ah.cfg.StatusCodeOnly != nil { + statusCodeOnly = *ah.cfg.StatusCodeOnly + } statsRequestHandlers, statsResponseHandlers := stats.NewHandlers(ah.logger, ah.cfg.Stats, statusCodeOnly) requestHandlers = append(requestHandlers, statsRequestHandlers...) responseHandlers = append(responseHandlers, statsResponseHandlers...) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 85e4d252aa..ff1c731f7b 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -173,22 +173,6 @@ var StatusCodeOperations = []string{ // all the operations that are allowed "CreateLogStream", } -var StatusCodeAndOtherOperations = []string{ // all the operations that are allowed - "PutMetricData", - "PutLogEvents", - "PutTraceSegments", - "DescribeInstances", - "DescribeTags", - "DescribeVolumes", - "DescribeContainerInstances", - "DescribeServices", - "DescribeTaskDefinition", - "ListServices", - "ListTasks", - "CreateLogGroup", - "CreateLogStream", -} - // NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. func NewStatusCodeOperationsFilter() OperationsFilter { allowed := collections.NewSet[string](StatusCodeOperations...) @@ -199,8 +183,12 @@ func NewStatusCodeOperationsFilter() OperationsFilter { } } -func NewStatusCodeAndOtherOperationsFilter() OperationsFilter { - allowed := collections.NewSet[string](StatusCodeAndOtherOperations...) +func NewStatusCodeAndOtherOperationsFilter(operations []string) OperationsFilter { + allowed := collections.NewSet[string](StatusCodeOperations...) + + for _, operation := range operations { + allowed.Add(operation) + } return OperationsFilter{ operations: allowed, diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index d7630fbeaa..6aea128be6 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -27,7 +27,7 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statuscodeonly bool) statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) return []awsmiddleware.RequestHandler{statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } - filter := agent.NewStatusCodeAndOtherOperationsFilter() + filter := agent.NewStatusCodeAndOtherOperationsFilter(cfg.Operations) clientStats := client.NewHandler(filter) statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) From 9e40bd892112d667eeb14d871d6144d9dc3ce89e Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 20 Nov 2024 16:52:30 -0500 Subject: [PATCH 37/91] adding agent health to prometheus --- .../amazon-cloudwatch-agent.go | 1 - .../containerinstanceprocessor.go | 1 + plugins/inputs/prometheus/prometheus.go | 16 ++++++++++++++++ tool/clean/clean_host/clean_host.go | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go b/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go index da084dedcd..56960e2a3e 100644 --- a/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go +++ b/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go @@ -245,7 +245,6 @@ func runAgent(ctx context.Context, c.OutputFilters = outputFilters c.InputFilters = inputFilters c.AllowUnusedFields = true - err = loadTomlConfigIntoAgent(c) if err != nil { return err diff --git a/internal/ecsservicediscovery/containerinstanceprocessor.go b/internal/ecsservicediscovery/containerinstanceprocessor.go index ffc0c84010..6da7318bc7 100644 --- a/internal/ecsservicediscovery/containerinstanceprocessor.go +++ b/internal/ecsservicediscovery/containerinstanceprocessor.go @@ -64,6 +64,7 @@ func splitMapKeys(a map[string]*EC2MetaData, size int) [][]string { } func (p *ContainerInstanceProcessor) handleContainerInstances(cluster string, batch []string, containerInstanceMap map[string]*EC2MetaData) error { + log.Println("yooooo we in above describe instances for host") ec2Id2containerInstanceIdMap := make(map[string]*string) input := &ecs.DescribeContainerInstancesInput{ Cluster: &cluster, diff --git a/plugins/inputs/prometheus/prometheus.go b/plugins/inputs/prometheus/prometheus.go index 5497421cd2..68e1ae2ca8 100644 --- a/plugins/inputs/prometheus/prometheus.go +++ b/plugins/inputs/prometheus/prometheus.go @@ -5,6 +5,11 @@ package prometheus import ( _ "embed" + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/cfg/envconfig" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "go.uber.org/zap" "sync" "github.com/influxdata/telegraf" @@ -23,6 +28,7 @@ type Prometheus struct { mbCh chan PrometheusMetricBatch shutDownChan chan interface{} wg sync.WaitGroup + middleware awsmiddleware.Middleware } func (p *Prometheus) SampleConfig() string { @@ -74,9 +80,19 @@ func (p *Prometheus) Stop() { func init() { inputs.Add("prometheus", func() telegraf.Input { + boolean := true return &Prometheus{ mbCh: make(chan PrometheusMetricBatch, 10000), shutDownChan: make(chan interface{}), + middleware: agenthealth.NewAgentHealth( + zap.NewNop(), + &agenthealth.Config{ + IsUsageDataEnabled: envconfig.IsUsageDataEnabled(), + Stats: agent.StatsConfig{}, + StatusCodeOnly: &boolean, + }, + ), } + }) } diff --git a/tool/clean/clean_host/clean_host.go b/tool/clean/clean_host/clean_host.go index 31a7d9b5d4..d701fdc40b 100644 --- a/tool/clean/clean_host/clean_host.go +++ b/tool/clean/clean_host/clean_host.go @@ -39,6 +39,7 @@ func cleanHost() error { } func terminateInstances(cxt context.Context, ec2client *ec2.Client) { + log.Println("yooooo we in above describe instances") maxResults := int32(1000) nameFilter := types.Filter{Name: aws.String("tag:Name"), Values: []string{ "buildLinuxPackage", @@ -66,6 +67,7 @@ func terminateInstances(cxt context.Context, ec2client *ec2.Client) { for { instanceIds := make([]string, 0) expirationDateInstance := time.Now().UTC().Add(clean.KeepDurationOneDay) + log.Println("yooooo we in above describe instances for host") describeInstanceOutput, _ := ec2client.DescribeInstances(cxt, &instanceInput) for _, reservation := range describeInstanceOutput.Reservations { for _, instance := range reservation.Instances { From 5745ee636fc9532118958770dc38a03b43cd31fc Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 21 Nov 2024 20:01:18 -0500 Subject: [PATCH 38/91] resolving comments --- .../amazon-cloudwatch-agent.go | 1 + extension/agenthealth/config.go | 6 +- extension/agenthealth/extension.go | 4 +- .../agenthealth/handler/stats/agent/agent.go | 62 ++++------- .../handler/stats/agent/agent_test.go | 103 ++++++++++++++++++ .../agenthealth/handler/stats/handler.go | 6 +- .../agenthealth/handler/stats/handler_test.go | 15 ++- .../handler/stats/provider/interval.go | 10 +- .../handler/stats/provider/process_test.go | 3 +- .../handler/stats/provider/statuscode.go | 26 ++--- .../containerinstanceprocessor.go | 1 - plugins/inputs/prometheus/prometheus.go | 16 --- tool/clean/clean_host/clean_host.go | 1 - .../otel/extension/agenthealth/translator.go | 2 +- 14 files changed, 156 insertions(+), 100 deletions(-) diff --git a/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go b/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go index 56960e2a3e..da084dedcd 100644 --- a/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go +++ b/cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go @@ -245,6 +245,7 @@ func runAgent(ctx context.Context, c.OutputFilters = outputFilters c.InputFilters = inputFilters c.AllowUnusedFields = true + err = loadTomlConfigIntoAgent(c) if err != nil { return err diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index 696db2ceca..23d279a5d3 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -10,9 +10,9 @@ import ( ) type Config struct { - IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` - Stats agent.StatsConfig `mapstructure:"stats"` - StatusCodeOnly *bool `mapstructure:"is_status_code_only,omitempty"` + IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` + Stats agent.StatsConfig `mapstructure:"stats"` + IsOnlyStatusCodeEnabled *bool `mapstructure:"is_status_code_only,omitempty"` } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index ba597f4964..a381bc6bf7 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -31,8 +31,8 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa } statusCodeOnly := false - if ah.cfg.StatusCodeOnly != nil { - statusCodeOnly = *ah.cfg.StatusCodeOnly + if ah.cfg.IsOnlyStatusCodeEnabled != nil { + statusCodeOnly = *ah.cfg.IsOnlyStatusCodeEnabled } statsRequestHandlers, statsResponseHandlers := stats.NewHandlers(ah.logger, ah.cfg.Stats, statusCodeOnly) requestHandlers = append(requestHandlers, statsRequestHandlers...) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index ff1c731f7b..11dc462d26 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -5,7 +5,6 @@ package agent import ( "encoding/json" - "log" "strings" "github.com/aws/amazon-cloudwatch-agent/internal/util/collections" @@ -82,43 +81,26 @@ func (s *Stats) Merge(other Stats) { if other.EntityRejected != nil { s.EntityRejected = other.EntityRejected } - if other.StatusCodes != nil { - log.Println("Merging status codes from another source.") + if other.StatusCodes == nil { + return + } - if s.StatusCodes == nil { - log.Println("Initializing status codes map as it was nil.") - s.StatusCodes = make(map[string][5]int) - } + if s.StatusCodes == nil { + s.StatusCodes = make(map[string][5]int) + } - for key, value := range other.StatusCodes { - log.Printf("Processing key: %s with value: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", key, value[0], value[1], value[2], value[3], value[4]) - - if existing, ok := s.StatusCodes[key]; ok { - log.Printf( - "Key %s already exists. Existing: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d. Merging with: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", - key, existing[0], existing[1], existing[2], existing[3], existing[4], - value[0], value[1], value[2], value[3], value[4], - ) - - //Merge the values for each status code - 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 - } - - log.Printf( - "Updated key %s: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", - key, s.StatusCodes[key][0], s.StatusCodes[key][1], s.StatusCodes[key][2], s.StatusCodes[key][3], s.StatusCodes[key][4], - ) - } else { - log.Printf("Key %s does not exist. Adding it with: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", key, value[0], value[1], value[2], value[3], value[4]) - s.StatusCodes[key] = value + 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 } - log.Println("Merging of status codes completed.") } } @@ -179,19 +161,15 @@ func NewStatusCodeOperationsFilter() OperationsFilter { return OperationsFilter{ operations: allowed, - allowAll: allowed.Contains(AllowAllOperations), + allowAll: false, } } func NewStatusCodeAndOtherOperationsFilter(operations []string) OperationsFilter { - allowed := collections.NewSet[string](StatusCodeOperations...) - + filter := NewStatusCodeOperationsFilter() for _, operation := range operations { - allowed.Add(operation) + filter.operations.Add(operation) } - return OperationsFilter{ - operations: allowed, - allowAll: allowed.Contains(AllowAllOperations), - } + return filter } diff --git a/extension/agenthealth/handler/stats/agent/agent_test.go b/extension/agenthealth/handler/stats/agent/agent_test.go index 631de211c5..f88ba822eb 100644 --- a/extension/agenthealth/handler/stats/agent/agent_test.go +++ b/extension/agenthealth/handler/stats/agent/agent_test.go @@ -10,6 +10,48 @@ import ( "github.com/stretchr/testify/assert" ) +func TestMerge(t *testing.T) { + 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), + MemoryBytes: aws.Uint64(123), + }) + assert.EqualValues(t, 1.3, *stats.CpuPercent) + assert.EqualValues(t, 123, *stats.MemoryBytes) + stats.Merge(Stats{ + CpuPercent: aws.Float64(1.5), + MemoryBytes: aws.Uint64(133), + FileDescriptorCount: aws.Int32(456), + ThreadCount: aws.Int32(789), + LatencyMillis: aws.Int64(1234), + PayloadBytes: aws.Int(5678), + StatusCode: aws.Int(200), + SharedConfigFallback: aws.Int(1), + ImdsFallbackSucceed: aws.Int(1), + AppSignals: aws.Int(1), + EnhancedContainerInsights: aws.Int(1), + RunningInContainer: aws.Int(0), + RegionType: aws.String("RegionType"), + Mode: aws.String("Mode"), + }) + 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) + assert.EqualValues(t, 1234, *stats.LatencyMillis) + assert.EqualValues(t, 5678, *stats.PayloadBytes) + assert.EqualValues(t, 200, *stats.StatusCode) + assert.EqualValues(t, 1, *stats.ImdsFallbackSucceed) + assert.EqualValues(t, 1, *stats.SharedConfigFallback) + assert.EqualValues(t, 1, *stats.AppSignals) + assert.EqualValues(t, 1, *stats.EnhancedContainerInsights) + assert.EqualValues(t, 0, *stats.RunningInContainer) + assert.EqualValues(t, "RegionType", *stats.RegionType) + assert.EqualValues(t, "Mode", *stats.Mode) +} + func TestMergeWithStatusCodes(t *testing.T) { stats := &Stats{ StatusCodes: map[string][5]int{ @@ -79,3 +121,64 @@ func TestMergeFullWithStatusCodes(t *testing.T) { 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 + want string + }{ + "WithEmpty": { + stats: &Stats{}, + want: "", + }, + "WithPartial": { + stats: &Stats{ + CpuPercent: aws.Float64(1.2), + MemoryBytes: aws.Uint64(123), + ThreadCount: aws.Int32(789), + PayloadBytes: aws.Int(5678), + }, + want: `"cpu":1.2,"mem":123,"th":789,"load":5678`, + }, + "WithFull": { + stats: &Stats{ + CpuPercent: aws.Float64(1.2), + MemoryBytes: aws.Uint64(123), + FileDescriptorCount: aws.Int32(456), + ThreadCount: aws.Int32(789), + LatencyMillis: aws.Int64(1234), + PayloadBytes: aws.Int(5678), + StatusCode: aws.Int(200), + ImdsFallbackSucceed: aws.Int(1), + }, + want: `"cpu":1.2,"mem":123,"fd":456,"th":789,"lat":1234,"load":5678,"code":200,"ifs":1`, + }, + } + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + got, err := testCase.stats.Marshal() + assert.NoError(t, err) + assert.Equal(t, testCase.want, got) + }) + } +} + +func TestOperationFilter(t *testing.T) { + testCases := map[string]struct { + allowedOperations []string + testOperations []string + want []bool + }{ + "WithNoneAllowed": {allowedOperations: nil, testOperations: []string{"nothing", "is", "allowed"}, want: []bool{false, false, false}}, + "WithSomeAllowed": {allowedOperations: []string{"are"}, testOperations: []string{"some", "are", "allowed"}, want: []bool{false, true, false}}, + "WithAllAllowed": {allowedOperations: []string{"*"}, testOperations: []string{"all", "are", "allowed"}, want: []bool{true, true, true}}, + } + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + filter := NewOperationsFilter(testCase.allowedOperations...) + for index, testOperation := range testCase.testOperations { + assert.Equal(t, testCase.want[index], filter.IsAllowed(testOperation)) + } + }) + } +} diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 6aea128be6..c879dabe4f 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -23,13 +23,13 @@ const ( func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statuscodeonly bool) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { statusCodeFilter := agent.NewStatusCodeOperationsFilter() + statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) + if statuscodeonly { - statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) return []awsmiddleware.RequestHandler{statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } filter := agent.NewStatusCodeAndOtherOperationsFilter(cfg.Operations) clientStats := client.NewHandler(filter) - statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) stats := newStatsHandler(logger, filter, []agent.StatsProvider{ clientStats, @@ -39,7 +39,7 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statuscodeonly bool) }) agent.UsageFlags().SetValues(cfg.UsageFlags) - return []awsmiddleware.RequestHandler{stats, clientStats, statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} + return []awsmiddleware.RequestHandler{stats, clientStats, statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats, clientStats} } type statsHandler struct { diff --git a/extension/agenthealth/handler/stats/handler_test.go b/extension/agenthealth/handler/stats/handler_test.go index ae0612a10a..54a7f4e1d1 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -37,6 +37,7 @@ func TestStatsHandler(t *testing.T) { ThreadCount: aws.Int32(789), LatencyMillis: aws.Int64(1234), PayloadBytes: aws.Int(5678), + StatusCode: aws.Int(200), ImdsFallbackSucceed: aws.Int(1), SharedConfigFallback: aws.Int(1), StatusCodes: map[string][5]int{ @@ -62,9 +63,21 @@ 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,"scfb":1,"ifs":1,"codes":{"di":[0,1,0,0,0],"pmd":[1,0,0,0,0]}`, 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,"codes":{"di":[0,1,0,0,0],"pmd":[1,0,0,0,0]}`, req.Header.Get(headerKeyAgentStats)) } + +func TestNewHandlersWithStatusCodeOnly(t *testing.T) { + requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true) + assert.Len(t, requestHandlers, 2) + assert.Len(t, responseHandlers, 1) +} + +func TestNewHandlersWithNoStatusCodeOnly(t *testing.T) { + requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, false) + assert.Len(t, requestHandlers, 2) + assert.Len(t, responseHandlers, 1) +} diff --git a/extension/agenthealth/handler/stats/provider/interval.go b/extension/agenthealth/handler/stats/provider/interval.go index 00cb857de6..40d279cfcf 100644 --- a/extension/agenthealth/handler/stats/provider/interval.go +++ b/extension/agenthealth/handler/stats/provider/interval.go @@ -4,7 +4,6 @@ package provider import ( - "log" "sync" "sync/atomic" "time" @@ -42,16 +41,9 @@ func (p *intervalStats) getStats() agent.Stats { var stats agent.Stats if value := p.stats.Load(); value != nil { - if s, ok := value.(agent.Stats); ok { - stats = s - } else { - log.Println("Error: Loaded value is not of type agent.Stats") - } + stats = value.(agent.Stats) } - if stats.StatusCodes == nil { - stats.StatusCodes = make(map[string][5]int) - } return stats } diff --git a/extension/agenthealth/handler/stats/provider/process_test.go b/extension/agenthealth/handler/stats/provider/process_test.go index ee31bbb2f8..931f08e6a0 100644 --- a/extension/agenthealth/handler/stats/provider/process_test.go +++ b/extension/agenthealth/handler/stats/provider/process_test.go @@ -75,7 +75,6 @@ func TestProcessStats(t *testing.T) { mock.mu.Unlock() provider.refresh() assert.Eventually(t, func() bool { - stats := provider.getStats() - return len(stats.StatusCodes) == 0 //map isn't comparable so we can just do this + return len(provider.getStats().StatusCodes) == 0 // map isn't comparable, so we check the length }, 5*time.Millisecond, time.Millisecond) } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 0e49e4bb81..bbbd1addaa 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -28,7 +28,6 @@ var ( // StatusCodeHandler provides monitoring for status codes per operation. type StatusCodeHandler struct { statsByOperation sync.Map - mu sync.Mutex resetTimer *time.Timer filter agent.OperationsFilter } @@ -47,13 +46,7 @@ func GetStatusCodeStats(filter agent.OperationsFilter) *StatusCodeHandler { // startResetTimer initializes a reset timer to clear stats every 5 minutes. func (h *StatusCodeHandler) startResetTimer() { h.resetTimer = time.AfterFunc(statusResetInterval, func() { - h.mu.Lock() - defer h.mu.Unlock() - - h.statsByOperation.Range(func(key, _ interface{}) bool { - h.statsByOperation.Delete(key) - return true - }) + h.statsByOperation.Clear() log.Println("Status code stats reset.") h.startResetTimer() }) @@ -66,10 +59,7 @@ func (h *StatusCodeHandler) HandleRequest(ctx context.Context, _ *http.Request) func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { // Extract the operation name operation := awsmiddleware.GetOperationName(ctx) - if operation == "" { - log.Println("No operation name found in the context") - return - } else if !h.filter.IsAllowed(operation) { + if !h.filter.IsAllowed(operation) { log.Printf("Operation %s is not allowed", operation) return } else { @@ -77,11 +67,11 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response } operation = GetShortOperationName(operation) + if operation == "" { + return + } statusCode := r.StatusCode - h.mu.Lock() - defer h.mu.Unlock() - value, loaded := h.statsByOperation.LoadOrStore(operation, &[5]int{}) if !loaded { log.Printf("Initializing stats for operation: %s", operation) @@ -144,9 +134,9 @@ func GetShortOperationName(operation string) string { case "CreateLogStream": return "cls" case "AssumeRole": - return "sts" + return "ar" default: - return operation + return "" } } @@ -162,8 +152,6 @@ func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { // Stats implements the `Stats` method required by the `agent.StatsProvider` interface. func (h *StatusCodeHandler) Stats(operation string) agent.Stats { - h.mu.Lock() - defer h.mu.Unlock() statusCodeMap := make(map[string][5]int) diff --git a/internal/ecsservicediscovery/containerinstanceprocessor.go b/internal/ecsservicediscovery/containerinstanceprocessor.go index 6da7318bc7..ffc0c84010 100644 --- a/internal/ecsservicediscovery/containerinstanceprocessor.go +++ b/internal/ecsservicediscovery/containerinstanceprocessor.go @@ -64,7 +64,6 @@ func splitMapKeys(a map[string]*EC2MetaData, size int) [][]string { } func (p *ContainerInstanceProcessor) handleContainerInstances(cluster string, batch []string, containerInstanceMap map[string]*EC2MetaData) error { - log.Println("yooooo we in above describe instances for host") ec2Id2containerInstanceIdMap := make(map[string]*string) input := &ecs.DescribeContainerInstancesInput{ Cluster: &cluster, diff --git a/plugins/inputs/prometheus/prometheus.go b/plugins/inputs/prometheus/prometheus.go index 68e1ae2ca8..5497421cd2 100644 --- a/plugins/inputs/prometheus/prometheus.go +++ b/plugins/inputs/prometheus/prometheus.go @@ -5,11 +5,6 @@ package prometheus import ( _ "embed" - "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" - "github.com/aws/amazon-cloudwatch-agent/cfg/envconfig" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" - "go.uber.org/zap" "sync" "github.com/influxdata/telegraf" @@ -28,7 +23,6 @@ type Prometheus struct { mbCh chan PrometheusMetricBatch shutDownChan chan interface{} wg sync.WaitGroup - middleware awsmiddleware.Middleware } func (p *Prometheus) SampleConfig() string { @@ -80,19 +74,9 @@ func (p *Prometheus) Stop() { func init() { inputs.Add("prometheus", func() telegraf.Input { - boolean := true return &Prometheus{ mbCh: make(chan PrometheusMetricBatch, 10000), shutDownChan: make(chan interface{}), - middleware: agenthealth.NewAgentHealth( - zap.NewNop(), - &agenthealth.Config{ - IsUsageDataEnabled: envconfig.IsUsageDataEnabled(), - Stats: agent.StatsConfig{}, - StatusCodeOnly: &boolean, - }, - ), } - }) } diff --git a/tool/clean/clean_host/clean_host.go b/tool/clean/clean_host/clean_host.go index d701fdc40b..6c86394189 100644 --- a/tool/clean/clean_host/clean_host.go +++ b/tool/clean/clean_host/clean_host.go @@ -67,7 +67,6 @@ func terminateInstances(cxt context.Context, ec2client *ec2.Client) { for { instanceIds := make([]string, 0) expirationDateInstance := time.Now().UTC().Add(clean.KeepDurationOneDay) - log.Println("yooooo we in above describe instances for host") describeInstanceOutput, _ := ec2client.DescribeInstances(cxt, &instanceInput) for _, reservation := range describeInstanceOutput.Reservations { for _, instance := range reservation.Instances { diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 940c3d42b6..2823093ad5 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -71,7 +71,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok { cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData } - cfg.StatusCodeOnly = t.statuscodeonly + cfg.IsOnlyStatusCodeEnabled = t.statuscodeonly if t.statuscodeonly != nil && *t.statuscodeonly { return cfg, nil } From 6e0fdd34bca419c41ea1049747f6953903c22d62 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 21 Nov 2024 20:16:43 -0500 Subject: [PATCH 39/91] resolving comments --- extension/agenthealth/extension_test.go | 2 +- .../agenthealth/handler/stats/handler_test.go | 8 +-- .../handler/stats/provider/statuscode.go | 13 +++-- internal/tls/testdata/server.crt | 44 ++++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- 6 files changed, 86 insertions(+), 83 deletions(-) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index fa9e42f605..e72a8c53e9 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -22,7 +22,7 @@ func TestExtension(t *testing.T) { // user agent, client stats, stats assert.Len(t, requestHandlers, 4) // client stats - assert.Len(t, responseHandlers, 1) + assert.Len(t, responseHandlers, 2) cfg.IsUsageDataEnabled = false requestHandlers, responseHandlers = extension.Handlers() // user agent diff --git a/extension/agenthealth/handler/stats/handler_test.go b/extension/agenthealth/handler/stats/handler_test.go index 54a7f4e1d1..23e6530189 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -72,12 +72,12 @@ func TestStatsHandler(t *testing.T) { func TestNewHandlersWithStatusCodeOnly(t *testing.T) { requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true) - assert.Len(t, requestHandlers, 2) + assert.Len(t, requestHandlers, 1) assert.Len(t, responseHandlers, 1) } -func TestNewHandlersWithNoStatusCodeOnly(t *testing.T) { +func TestNewHandlersWithoutStatusCodeOnly(t *testing.T) { requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, false) - assert.Len(t, requestHandlers, 2) - assert.Len(t, responseHandlers, 1) + assert.Len(t, requestHandlers, 3) + assert.Len(t, responseHandlers, 2) } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index bbbd1addaa..241cf8ca58 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -45,11 +45,14 @@ func GetStatusCodeStats(filter agent.OperationsFilter) *StatusCodeHandler { // startResetTimer initializes a reset timer to clear stats every 5 minutes. func (h *StatusCodeHandler) startResetTimer() { - h.resetTimer = time.AfterFunc(statusResetInterval, func() { - h.statsByOperation.Clear() - log.Println("Status code stats reset.") - h.startResetTimer() - }) + ticker := time.NewTicker(statusResetInterval) + + go func() { + for range ticker.C { + h.statsByOperation.Clear() + log.Println("Status code stats reset.") + } + }() } // HandleRequest is a no-op for the StatusCodeHandler. diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..60d0bb3374 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQV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1zjT2vKiGQGKNLIc9G7bPJk6I7v6S00I0SGp02TC+Oak9g37Bo +FiZ0B9PuYipyfYhmFL/5Sg50DEq8V940IvhfS2sd83v0N1Y32EUpbWIxD8Qn05dP +Sps7WwDjlvQWb8Sxi7nAxNXgcDbpBI/3TIougCMVI4glV8LMzPSjG2FHaQgUZCFK +0lx3rRPIdQHN3GfAGx02Or1xSMJzs++3QkG6IOgrdmQdbkIXP3o+zzJLx8xMqUm/ +G/RoFS5P0TPuxTEfVTk1RudSz/fwUNx6W8QNtPzw0zp/nWMZYvptNRw4Prh1v4H5 +Y0050xSVClebpPmypnA1Y1P2Kqj/zyQjBGCAqsKHPKzH5ORnfz4F2eHWFcCK4kkq +FPU7+Gi6oseQU1I8PoaAhTFUwt2ILvmuvkPEb5QEA/Plyw9wRThpXpM6rgEZ -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..cd9b1bc0d0 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHnes3zGkEYMzkjw3NOtkEzgxwdiJEoV -WQHi4eznAgMBAAECggEAGv7z1O32jXc+ouG40NewNVmXQRW0NMQ0w4Vn6UYZNXlj -BWjQJaVquCQAhEMUkDBma9j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b2Qh +NX7RbidLuegIeZ6x70a3OdHPtIlGhJ/pgA/YWAQDCl+AS06f+bDVGZqi9I1l+GPa +VbGBQnYckXTcf46FdAm8y0pdKpDPiDWCoRe9Uck0FJI0zVnBUw3hIYg/DQnyjQVS +XETCuGI72QKBgBnPp4BWeJZYyke21WnCUPNmtxr/JZafq1HaCwEp41RZD1y3hGZs +gRunNQXoTTq90j4qAomOcUXbwRsqc6mAi2EyNGK1E7hAchFsntC2XcJ1GIfo0E5Q +STG/j1qXerMhJOjo7RNs2V3C6TIm6LN5YgYylwq8Sb2Q7tU1rv4/NDtRAoGAHwGR +W4pBswB7HIDvE02mLa66e3+RRO/vphbbNaJxZCJHi3BxsYSG1rIpyYRceRd5J0qS +/LkrWoSTVw99LuPo2bvk0Kn56z/cm/jWnY/BDDqeY1a0V9xnyg4xk1QbnrwndbFU +iJTKKgMLQyyES5h11nnL7cUiOQ6uRTmfaaC5/4ECgYBCgcAgQtzQIX/YzRjNN9AK +a/tUwpqTsCoL3dg1I2HOLIYMMnz/oQvt8mUBjN6BniwtYfDXXQmVVLBuWOQJKtgN +w8KTpzjNOdhmIqUu/RbHLVPrqNn4WAGP5cwLzvGGvFVHTybR8USUvPA7KnmbdjyF +tPLITtZtD2j+/OVJu14hIg== -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..b899058804 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8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P7FXJNakUmrATNdwrWjuto -onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g -XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g -qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= +BBTg0Wn7OH9Ee5Ist0XF5+omJOWZkjANBgkqhkiG9w0BAQsFAAOCAgEATLwZ4GPc +JZVUtbA5Lfr2EeArXHwRJidV1CJXbjTy/UPyeGsYyoUWGOdUxT5NzS2VKf6nuta7 +V8cKuHN3WOrer+f9laIxm+PAxP76CXxjFEE85HEPfVW3QOIkCnMF2mcwsyZ9ri43 +AbF+GuUnI/8igV1oqxw+g75vRJ/qpRf6ZhEyAo0uGlhQ/rNAlCdQSpzyNx9EHSSu +U87NF2ldBzt07jPORxJLIZIO075wvqzANBJXqPAnzTj4Z2RdX9f4IEgu3uuAPlWe +QPBOkYfZcCEVmwStrSHfkRmJuDR5/U4kzcpIm1EnzEEpO4wUb9gdrvj+pPViB8ij +qA6DIJNiN75VQODG12eVy6kBYg7JeKNG1paFsz2lI9P1DJHT7W8LO+gcD/BUXjNS +rtGdSnVOBTaYl+V+3fHv0/fUZNcPJ07knSXZPInA/4I9DKAtuVusLjsRwyDdGg6u +EQZWrhUFcq12AQT2la9CiZbw+pyAo7ce62qn4T86TzVJj9xo+K4Ek2L47pxbr5r7 +PzDgIGIIqzCJJaVUXNlKOkgS3GPE5n6XO1TqvgjhYTaiIhZNrUYz3Ruz7lLh72yJ +o6JZxIxxWU/YzEc55MwxN6oZvkQhQykHjI4y+jOBCrUzCY0IztPxSCUTGLBojasX +i7fgxH3P7cd5hlZ73GAy21oX3+7FDPNUqtQ= -----END CERTIFICATE----- From 8aee0d997a7acc057c0836960a5e58f164238292 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 22 Nov 2024 12:54:22 -0500 Subject: [PATCH 40/91] adding tests --- extension/agenthealth/config.go | 2 +- extension/agenthealth/extension.go | 13 +++-- extension/agenthealth/extension_test.go | 3 +- .../agenthealth/handler/stats/agent/agent.go | 32 ++++++------ .../agenthealth/handler/stats/handler.go | 37 ++++++++----- .../agenthealth/handler/stats/handler_test.go | 16 ++++-- .../handler/stats/provider/interval.go | 2 - internal/tls/testdata/server.crt | 44 ++++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- tool/clean/clean_host/clean_host.go | 1 - 11 files changed, 139 insertions(+), 113 deletions(-) diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index 23d279a5d3..42138bf5d3 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -12,7 +12,7 @@ import ( type Config struct { IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` Stats agent.StatsConfig `mapstructure:"stats"` - IsOnlyStatusCodeEnabled *bool `mapstructure:"is_status_code_only,omitempty"` + IsOnlyStatusCodeEnabled *bool `mapstructure:"is_status_code_enabled,omitempty"` } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index a381bc6bf7..f2cc0e0402 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -7,6 +7,7 @@ import ( "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" "go.opentelemetry.io/collector/component" "go.uber.org/zap" + "golang.org/x/exp/slices" "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats" "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/useragent" @@ -30,11 +31,17 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa return requestHandlers, responseHandlers } - statusCodeOnly := false + statusCodeEnabled := false if ah.cfg.IsOnlyStatusCodeEnabled != nil { - statusCodeOnly = *ah.cfg.IsOnlyStatusCodeEnabled + statusCodeEnabled = *ah.cfg.IsOnlyStatusCodeEnabled } - statsRequestHandlers, statsResponseHandlers := stats.NewHandlers(ah.logger, ah.cfg.Stats, statusCodeOnly) + + agentStatsEnabled := + slices.Contains(ah.cfg.Stats.Operations, "PutMetricData") || + slices.Contains(ah.cfg.Stats.Operations, "PutLogEvents") || + slices.Contains(ah.cfg.Stats.Operations, "PutTraceSegment") + + statsRequestHandlers, statsResponseHandlers := stats.NewHandlers(ah.logger, ah.cfg.Stats, statusCodeEnabled, agentStatsEnabled) requestHandlers = append(requestHandlers, statsRequestHandlers...) responseHandlers = append(responseHandlers, statsResponseHandlers...) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index e72a8c53e9..f0e66b7784 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -5,6 +5,7 @@ package agenthealth import ( "context" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "testing" "github.com/stretchr/testify/assert" @@ -14,7 +15,7 @@ import ( func TestExtension(t *testing.T) { ctx := context.Background() - cfg := &Config{IsUsageDataEnabled: true} + cfg := &Config{IsUsageDataEnabled: true, Stats: agent.StatsConfig{Operations: []string{"PutLogEvents"}}} extension := NewAgentHealth(zap.NewNop(), cfg) assert.NotNil(t, extension) assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost())) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 11dc462d26..5bc84133db 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -127,21 +127,6 @@ func (of OperationsFilter) IsAllowed(operationName string) bool { return of.allowAll || of.operations.Contains(operationName) } -func NewOperationsFilter(operations ...string) OperationsFilter { - allowed := collections.NewSet[string](operations...) - return OperationsFilter{ - operations: allowed, - allowAll: allowed.Contains(AllowAllOperations), - } -} - -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 "DescribeInstances", "DescribeTags", @@ -155,9 +140,24 @@ var StatusCodeOperations = []string{ // all the operations that are allowed "CreateLogStream", } +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"` +} + +func NewOperationsFilter(operations ...string) OperationsFilter { + allowed := collections.NewSet[string](operations...) + return OperationsFilter{ + operations: allowed, + allowAll: allowed.Contains(AllowAllOperations), + } +} + // NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. func NewStatusCodeOperationsFilter() OperationsFilter { - allowed := collections.NewSet[string](StatusCodeOperations...) + allowed := make(map[string]struct{}, len(StatusCodeOperations)) return OperationsFilter{ operations: allowed, diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index c879dabe4f..2f89062bd4 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -21,25 +21,36 @@ const ( headerKeyAgentStats = "X-Amz-Agent-Stats" ) -func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statuscodeonly bool) ([]awsmiddleware.RequestHandler, []awsmiddleware.ResponseHandler) { +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 + } + statusCodeFilter := agent.NewStatusCodeOperationsFilter() statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) + if statusCodeEnabled { + requestHandlers = append(requestHandlers, statusCodeStats) + responseHandlers = append(responseHandlers, statusCodeStats) + statsProviders = append(statsProviders, statusCodeStats) + } + + if agentStatsEnabled { + clientStats := client.NewHandler(agent.NewOperationsFilter()) + statsProviders = append(statsProviders, clientStats, provider.GetProcessStats(), provider.GetFlagsStats()) + responseHandlers = append(responseHandlers, clientStats) + requestHandlers = append(requestHandlers, clientStats) - if statuscodeonly { - return []awsmiddleware.RequestHandler{statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats} } filter := agent.NewStatusCodeAndOtherOperationsFilter(cfg.Operations) - clientStats := client.NewHandler(filter) - - stats := newStatsHandler(logger, filter, []agent.StatsProvider{ - clientStats, - provider.GetProcessStats(), - provider.GetFlagsStats(), - statusCodeStats, - }) - agent.UsageFlags().SetValues(cfg.UsageFlags) + stats := newStatsHandler(logger, filter, statsProviders) + requestHandlers = append(requestHandlers, stats) - return []awsmiddleware.RequestHandler{stats, clientStats, statusCodeStats}, []awsmiddleware.ResponseHandler{statusCodeStats, clientStats} + agent.UsageFlags().SetValues(cfg.UsageFlags) + 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 23e6530189..5352d5176c 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -71,13 +71,23 @@ func TestStatsHandler(t *testing.T) { } func TestNewHandlersWithStatusCodeOnly(t *testing.T) { - requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true) + requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, false) assert.Len(t, requestHandlers, 1) 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 TestNewHandlersWithoutStatusCodeOnly(t *testing.T) { - requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, false) +func TestNewHandlersWithStatusCodeAndAgenthStats(t *testing.T) { + requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, true) assert.Len(t, requestHandlers, 3) 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/interval.go b/extension/agenthealth/handler/stats/provider/interval.go index 40d279cfcf..bc5dc8e24e 100644 --- a/extension/agenthealth/handler/stats/provider/interval.go +++ b/extension/agenthealth/handler/stats/provider/interval.go @@ -39,11 +39,9 @@ func (p *intervalStats) Stats(string) agent.Stats { func (p *intervalStats) getStats() agent.Stats { var stats agent.Stats - if value := p.stats.Load(); value != nil { stats = value.(agent.Stats) } - return stats } diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 60d0bb3374..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGTCCAgGgAwIBAgIRAPg3AYT+HnZNbXi8U/IROjwwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHUm9vdCBDQTAeFw0yNDExMjIwMTEyMjVaFw0yNDExMjIwMjEy -MjVaMBUxEzARBgNVBAoTCkt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQCoWxzOXaSbVPSIVXHM3Cx2KNPLokC2/zmI4AwXObfMN1OaO3e+ -g6jZp4voQIF+WH8/RgnLTp9HYSYuBTq98H8gdsSrnTpiCjrXz/YOEx0cTxBvt4Kr -DM3Y5oEQurljCMXGN+ESwzX6lE8J4s4bhv8wqyHz4SMGVtmYVgUbjuq/63393OOR -I83jd9II6hu5R2PHUG0IKPqH81SzSRTi3QQcUTwZDM2Aw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fwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index cd9b1bc0d0..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCoWxzOXaSbVPSI -VXHM3Cx2KNPLokC2/zmI4AwXObfMN1OaO3e+g6jZp4voQIF+WH8/RgnLTp9HYSYu -BTq98H8gdsSrnTpiCjrXz/YOEx0cTxBvt4KrDM3Y5oEQurljCMXGN+ESwzX6lE8J -4s4bhv8wqyHz4SMGVtmYVgUbjuq/63393OORI83jd9II6hu5R2PHUG0IKPqH81Sz -SRTi3QQcUTwZDM2AwjGV5jBd3sSeMSoyBwEqDIwdUbtd7hin+Gs7XX7UXi+aRssB -cVeJMUilQ45ZevqUNda9qmnTAvs3r9R1fMBvOEE8qwBraJhPcsfcM0D2mzM2E9Vr -v9O6nXgJAgMBAAECggEACEOYsWSVXO6ZpkuTb3vrTs2IP/mx9YmnuFlPHqC9re+V -Uf/TS+3Ijw6TZo4sDRio/mEgv/MXDHjvV9j33jT8+In783SfVgqsgsV5jY1Qo4Aa -DXHTnzPcsuX1te2EhiD7HFTH3pTohGldS93vQhipVClCXGdTwc7nlXu7enPUgCEp -w7IFar6BQeEKwNLNqLC8W3eSML9pW3GRfI3a/pwrdkqwdUkhnEbJuh6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m1VOyk5kML7gMhqcbneL8XYzzx2S7IMuyKpSNt +H++ZGWdXga2Vbq3bDmNQrSvDJLcWgEP6e9ZwwZH6WYgo9KA3036iTiF6fUx1doh5 +WB3M0M6SUTBFZzqzAq3vYYEWhns7A7Se/2w8N1+0HrRQnXu5aHK1RGo+iwKBgEST +hRx7fi/dK/xsl9oDyN4SPdPLlcmjPZ6/cb23RgUMZaAGiThmfu1hLU6pphMpkdKX +yzx6W9Wu2NTYPpT/WK8Ks4olYDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index b899058804..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTEyMjAxMTIzMFoXDTM0MTEyMjAxMTIzMFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKynT8zSLBNR -FoNGLovkmVyn/ZtTCzvR4MdMBGoR+4+FKY/tmmdpEwmPBWdnWPdFYL81nKaR4wcL -Ao7nzkkhP60dsob5rRynJ5HDL8c1YQZ+wAJOd5EKLXc1Fk6zFsL4AYcqxViHEnyM -1Iy8AizXgIVLLwfNiSDw1UknaWYZGzDafyAW4Xqkkiaaq9NtHdHWHAQhJl+n0o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7fgxH3P7cd5hlZ73GAy21oX3+7FDPNUqtQ= +BBSWf0MJGMR6k7iAcZMQBOIFr+DoGjANBgkqhkiG9w0BAQsFAAOCAgEAHQib14b2 +y1b9Xa+lvvpyho887AF5LJMvcAaFA2qrZTgsct9YAUyP4jwHSMa82F34GF5zWm96 +wKGa2V7rykKPLtL2o0ilfnz3bJndL2MUjgVqK7GzkOGIhhXreG6/4WZ+oNReMzjw +uZ6zWKhUrTKfvt5J70Nzk+aPrwEzOOcb078QfrFvxElrkoyBz5LGF6HVdIVYUO94 +1DW1egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- diff --git a/tool/clean/clean_host/clean_host.go b/tool/clean/clean_host/clean_host.go index 6c86394189..31a7d9b5d4 100644 --- a/tool/clean/clean_host/clean_host.go +++ b/tool/clean/clean_host/clean_host.go @@ -39,7 +39,6 @@ func cleanHost() error { } func terminateInstances(cxt context.Context, ec2client *ec2.Client) { - log.Println("yooooo we in above describe instances") maxResults := int32(1000) nameFilter := types.Filter{Name: aws.String("tag:Name"), Values: []string{ "buildLinuxPackage", From f3445182aeca86cb220edd1486434c4997f52d94 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 22 Nov 2024 16:16:31 -0500 Subject: [PATCH 41/91] resolving comments --- extension/agenthealth/config.go | 2 +- extension/agenthealth/extension.go | 4 +- extension/agenthealth/extension_test.go | 4 +- .../agenthealth/handler/stats/handler_test.go | 2 +- internal/tls/testdata/server.crt | 42 +++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- .../otel/extension/agenthealth/translator.go | 7 ++- 8 files changed, 80 insertions(+), 83 deletions(-) diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index 42138bf5d3..3952ef3f81 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -12,7 +12,7 @@ import ( type Config struct { IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` Stats agent.StatsConfig `mapstructure:"stats"` - IsOnlyStatusCodeEnabled *bool `mapstructure:"is_status_code_enabled,omitempty"` + IsOnlyStatusCodeEnabled bool `mapstructure:"is_status_code_enabled,omitempty"` } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index f2cc0e0402..f479d63b6a 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -32,9 +32,7 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa } statusCodeEnabled := false - if ah.cfg.IsOnlyStatusCodeEnabled != nil { - statusCodeEnabled = *ah.cfg.IsOnlyStatusCodeEnabled - } + statusCodeEnabled = ah.cfg.IsOnlyStatusCodeEnabled agentStatsEnabled := slices.Contains(ah.cfg.Stats.Operations, "PutMetricData") || diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index f0e66b7784..779147bf9f 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -21,9 +21,9 @@ func TestExtension(t *testing.T) { assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost())) requestHandlers, responseHandlers := extension.Handlers() // user agent, client stats, stats - assert.Len(t, requestHandlers, 4) + assert.Len(t, requestHandlers, 3) // client stats - assert.Len(t, responseHandlers, 2) + assert.Len(t, responseHandlers, 1) cfg.IsUsageDataEnabled = false requestHandlers, responseHandlers = extension.Handlers() // user agent diff --git a/extension/agenthealth/handler/stats/handler_test.go b/extension/agenthealth/handler/stats/handler_test.go index 5352d5176c..108c6aa120 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -72,7 +72,7 @@ func TestStatsHandler(t *testing.T) { func TestNewHandlersWithStatusCodeOnly(t *testing.T) { requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, false) - assert.Len(t, requestHandlers, 1) + assert.Len(t, requestHandlers, 2) assert.Len(t, responseHandlers, 1) } func TestNewHandlersWithAgentStatsOnly(t *testing.T) { diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..900f44dbbe 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtcXSqWmtWEB -LiHPhSU0HN5JWsfQZ2VkB8rFStQ8CwFG0DW9i6GSVsN1zmmzLQdVPAyP4Uzy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a +F9+Wcu2+thaM2EzdjgVH730PzH1Hm9/vNs7Ntgsknb3ZSKT7uYfMuO0JqiGsQ08H +K0B3azia3xCPqNsQy6p6xlN7LWX4Io6IPluDZgvyIwVIgZmhBhSd1uiCeIY9Bh6s +L7+7dYSltuSLI6ZCnpW2UFtwqZ+qkNzxehwV5Og/9ns2ppv8pwq7wPMOJZ0= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..57fc5d831f 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHnes3zGkEYMzkjw3NOtkEzgxwdiJEoV -WQHi4eznAgMBAAECggEAGv7z1O32jXc+ouG40NewNVmXQRW0NMQ0w4Vn6UYZNXlj -BWjQJaVquCQAhEMUkDBma9jnHM7dZ5obie0+Joa5p/6Mu6M2oSR1IVx7Myq284Jk -1Ys/w7u5ESYf33pWmqiGQlbpSxamXvLoWaM7OT5veilRlkgjqiAmerj9EceRP5mR -aheVE5ctY5oZmdnvA9OcN6B8Oxk59EWEOECs8qAF/ChYfC8pWKOp4U0RILQ/9jXD -lu4p0C2XyadrJReer3whudUADWa/WSxgVCrx85/g/RTKs38KTPy7W4g3bv8KBRhc -bjLzoYTl6esRAi8nM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Nn2k +7kHViM2btkquPocSnp4diBcT8u9C/lYdSLWgOjIy2bOeOKWUVhl/rW01AoGBAJpj +m29dvmHy7csinS1E6voTTsANbOToka0UXmN80fxljRKCXR3mRd0DjOO+XafyCoxV +MheQnWOliJlfAz35iu5KXdN4dgtxvQohlhb5Me8uHoLyIw2If7uwKjqLPLrq3iGP +qdAdOINpMMb0XbE9dOgj3/uk047cn6DF8/ptMo2JAoGBALUVdOoFOyAnSCuOYYrO +nNMQ6F1Qut5pgtab4vJv0QyhbQsSUbsdnySBx8cegVDccLnAi2sjpPyxaebcxELd +yaW6CjDPs0EjozkW1ywdUazpJJZrme7dGJ26uxGH4WJ6abn4U31ItfqqaIAVSEAT +RPLrxJiFVDDcElvkvX7ypNbF -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..ed672ec812 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rMPbRsnGvIebh -FZsA60QnhuNiL6MowdJn17/Stl6Rs7cNV5zq3/WmaiipOoTcrKIMgA5ci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KFGImhb43I2+2Xv3NIWhdLW9LCPe +OgN5QdILMafNvhJsTz6sIjAxsSrYmYA6AZTlvdl2WZglrxU7QL4hkvi69Tbof4xT +T4BieKVgQ9buUxyk3ihj3BICcFrhXVBZIeJ+gmOpzoPviTBYWRzLrHNt7guYNS0y +f/H//TKXOBvPjDOSOMLItDu14Vu4sXQCYckXAcIqJ97CnlWKi45Rma1qD12LigaG +gk8cO879XqZrlMKZwe9Cjf18FKs6lhNLZp95GAqgQ6J7LZPVNWGabsiPluUxzIME +EoL+q5io5ndoTVothhCZJs4CT2fT+wRklHn5xa7k11cVm//rabwLxq+kTmKPZvNY +jkdtpQwF/oauN/ykCESdOZu4RE6dz49yAKQmUe2ZLwrC4i/Hp4031kyXF3vZZF4c +kvA3M1tJxVWJpRc4laJvcKWQIxFMyZirvfWNJt9Nmd2e2Yq0jeu73uVhDDLLf9nB +GmRvzbFetuuiyl/b27Nwnweobcy5fJewhnbo2NuJYxwfQDZv5SlnbrBiJRKzqPFQ +Cj28AriR+kyXhPfjyT0A9kH9A8GQQ51DPjDEbdGjSzatzTOYPPdBLSaHK+nNV3uM +ePw/GTTH5O72x6IyZJIE5OCUZrKlNUlUIXk= -----END CERTIFICATE----- diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 2823093ad5..c4320374bf 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -35,7 +35,7 @@ type translator struct { operations []string isUsageDataEnabled bool factory extension.Factory - statuscodeonly *bool + statuscodeonly bool } var _ common.Translator[component.Config] = (*translator)(nil) @@ -46,7 +46,7 @@ func NewTranslatorWithStatusCode(name component.DataType, operations []string, s operations: operations, factory: agenthealth.NewFactory(), isUsageDataEnabled: envconfig.IsUsageDataEnabled(), - statuscodeonly: &statuscodeonly, + statuscodeonly: statuscodeonly, } } @@ -56,7 +56,6 @@ func NewTranslator(name component.DataType, operations []string) common.Translat operations: operations, factory: agenthealth.NewFactory(), isUsageDataEnabled: envconfig.IsUsageDataEnabled(), - statuscodeonly: nil, } } @@ -72,7 +71,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData } cfg.IsOnlyStatusCodeEnabled = t.statuscodeonly - if t.statuscodeonly != nil && *t.statuscodeonly { + if t.statuscodeonly != false && t.statuscodeonly { return cfg, nil } cfg.Stats = agent.StatsConfig{ From a7e0415a336213e5b4c8501ed07c6fccec6a6c3b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 22 Nov 2024 16:17:22 -0500 Subject: [PATCH 42/91] resolving comments --- extension/agenthealth/extension_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 779147bf9f..531f7009c9 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -5,9 +5,10 @@ package agenthealth import ( "context" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "testing" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/component/componenttest" "go.uber.org/zap" From d91706df0fbe33c4f95414080016126a812e4063 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 22 Nov 2024 16:30:06 -0500 Subject: [PATCH 43/91] adding tests --- extension/agenthealth/extension_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 531f7009c9..5679ef34d3 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -7,11 +7,11 @@ import ( "context" "testing" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" - "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) { From 59f735fc3ad65416e79f6477a3dfdb62b83d2a55 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 25 Nov 2024 12:40:37 -0500 Subject: [PATCH 44/91] fixing race condition --- .../handler/stats/provider/statuscode.go | 72 ++++++++++--------- .../handler/stats/provider/statuscode_test.go | 10 ++- internal/tls/testdata/server.crt | 42 +++++------ internal/tls/testdata/server.key | 52 +++++++------- internal/tls/testdata/tls-ca.crt | 50 ++++++------- 5 files changed, 121 insertions(+), 105 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 241cf8ca58..bb7b3a08ce 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,6 +1,3 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: MIT - package provider import ( @@ -11,7 +8,6 @@ import ( "time" "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) @@ -27,16 +23,26 @@ var ( // StatusCodeHandler provides monitoring for status codes per operation. type StatusCodeHandler struct { - statsByOperation sync.Map + statsByOperation map[string]*[5]int resetTimer *time.Timer filter agent.OperationsFilter + mu sync.Mutex } // GetStatusCodeStats retrieves or initializes the singleton StatusCodeHandler. -func GetStatusCodeStats(filter agent.OperationsFilter) *StatusCodeHandler { +func GetStatusCodeStats(filter interface{}) *StatusCodeHandler { statusCodeStatsOnce.Do(func() { - handler := &StatusCodeHandler{} - handler.filter = filter + handler := &StatusCodeHandler{ + statsByOperation: make(map[string]*[5]int), + } + + if opsFilter, ok := filter.(agent.OperationsFilter); ok { + handler.filter = opsFilter + } else { + // Provide a default or fallback implementation if the filter is not valid + log.Println("Invalid filter provided; using NoOpOperationsFilter.") + } + handler.startResetTimer() statusCodeSingleton = handler }) @@ -45,14 +51,15 @@ func GetStatusCodeStats(filter agent.OperationsFilter) *StatusCodeHandler { // startResetTimer initializes a reset timer to clear stats every 5 minutes. func (h *StatusCodeHandler) startResetTimer() { - ticker := time.NewTicker(statusResetInterval) - - go func() { - for range ticker.C { - h.statsByOperation.Clear() - log.Println("Status code stats reset.") + h.resetTimer = time.AfterFunc(statusResetInterval, func() { + h.mu.Lock() + defer h.mu.Unlock() + for key := range h.statsByOperation { + delete(h.statsByOperation, key) } - }() + log.Println("Status code stats reset.") + h.startResetTimer() + }) } // HandleRequest is a no-op for the StatusCodeHandler. @@ -62,6 +69,7 @@ func (h *StatusCodeHandler) HandleRequest(ctx context.Context, _ *http.Request) func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { // Extract the operation name operation := awsmiddleware.GetOperationName(ctx) + if !h.filter.IsAllowed(operation) { log.Printf("Operation %s is not allowed", operation) return @@ -73,25 +81,25 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response if operation == "" { return } + statusCode := r.StatusCode - value, loaded := h.statsByOperation.LoadOrStore(operation, &[5]int{}) - if !loaded { + h.mu.Lock() + defer h.mu.Unlock() + + stats, exists := h.statsByOperation[operation] + if !exists { + stats = &[5]int{} + h.statsByOperation[operation] = stats log.Printf("Initializing stats for operation: %s", operation) } - stats := value.(*[5]int) h.updateStatusCodeCount(stats, statusCode, operation) - h.statsByOperation.Store(operation, stats) - - h.statsByOperation.Range(func(key, value interface{}) bool { - - operation := key.(string) - stats := value.(*[5]int) + // Optionally, log all stats (protected by the mutex) + for operation, stats := range h.statsByOperation { log.Printf("Operation: %s, 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", operation, stats[0], stats[1], stats[2], stats[3], stats[4]) - return true - }) + } } // Helper function to update the status code counts @@ -155,15 +163,15 @@ func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { // Stats implements the `Stats` method required by the `agent.StatsProvider` interface. func (h *StatusCodeHandler) Stats(operation string) agent.Stats { + // Lock mutex to safely access statsByOperation + h.mu.Lock() + defer h.mu.Unlock() statusCodeMap := make(map[string][5]int) - h.statsByOperation.Range(func(key, value interface{}) bool { - operation := key.(string) - stats := value.(*[5]int) - statusCodeMap[operation] = [5]int{stats[0], stats[1], stats[2], stats[3], stats[4]} - return true - }) + for operation, stats := range h.statsByOperation { + statusCodeMap[operation] = *stats + } return agent.Stats{ StatusCodes: statusCodeMap, diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 0d8a850e17..4a1e9d1d47 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -16,10 +16,18 @@ func TestStatusCodeHandler(t *testing.T) { filter := agent.NewStatusCodeOperationsFilter() handler := GetStatusCodeStats(filter) require.NotNil(t, handler) - handler.statsByOperation.Store("pmd", &[5]int{1, 2, 0, 1, 0}) + + // Locking to ensure thread-safe operations + handler.mu.Lock() + handler.statsByOperation["pmd"] = &[5]int{1, 2, 0, 1, 0} + handler.mu.Unlock() + + // Retrieve stats after modification stats := handler.Stats("pmd") expected := [5]int{1, 2, 0, 1, 0} actualStats := stats.StatusCodes["pmd"] + + // Perform assertions assert.Equal(t, expected, actualStats, "Unexpected stats values for operation 'pmd'") assert.Contains(t, stats.StatusCodes, "pmd", "Status code map should contain 'pmd'") assert.Equal(t, expected, stats.StatusCodes["pmd"], "Stats for 'pmd' do not match") diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 900f44dbbe..4827558116 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQbvO6OvB6Nta0hPA2iV4lZjANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTEyMjIxMTI1NVoXDTI0MTEy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P +sOqXupd6UALMSFx1h9Bbu29hKzDpuT3D0dZAEZmOcziTRTpYWgIQqZ/KG0wjsMB2 +7wkj0gaxTELO6zHyMUULGgK4sUhA+/NZ4k/3OlqwKr4ZBeAgD9NQyuk+Si9+/aBd +U4rSneOehS18ChoDHMDQIAsqmWE2qcyt/YpAYaxsDdxHwAd9ofeIrXOp31Nz6WA9 +ZuUvBBq2IbeSe2AMJ1yfEZEJayAdz7+yj9TBamwl6icOjD1gMmPJ/8vv/v6U8nLz +7CBKdHV/GrrX6sRiST1VEqA/8tnu0eXvYuwBYPp9SuAMQyRsiGKTocr6ZAmyU7aj +znrwZkW63t4vcQ68G/BtCfbX6qcJ77P8zpbiIj+TxzIY5rF44smOkcTRlgy5Rwi6 +yJADOSkBY5BI2wgKIzi7kzrbcaOEDwzG8nskt9FD5IgUMjS2v+4J/esd05M9tKp8 +wPhXGkvsQXYHOsi1p8yXVuKParTO521f6Koc163wEvhNSBonrYxpL9B4ubI= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 57fc5d831f..e6afc8732a 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwhKHYT43zWeBH -XyQuzhD/VHKlbA9A4405noSr2hDEVfnX6J8IumAgq47ceuhuoqwxCVDw9/BJwqRg -6exF/4yVSTSqkrN7bqHxls6joay9f89EJ21ofTJUBX2xf4w5YaS57JdAALsz0PWE -9k666ai+JLMA0UGBzplxJd7fhV+7SqW+LfInJ3DJmq4TWS7QxkoJWEZz/HjBJ3RJ -EZNpc+NYCKzloF318ya9YvKphcO1Q88h5qtJ60zaDtDWudruUZmTsrsmWg4zJgcL -g5AVhWlfYzX3TYBOkdrW0QGYvWw10Q65bY/ttM38FqGA9O+q3irtvWy8/uHl5tDN -l+9uzIP7AgMBAAECggEAZo9J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2Ivk0FL0FnTXj6wKBgQDyAFp3gVPoCGSL0wZeYkK5H0ANcAjyc75M +bHXc5P5zdATJyHK5bVpkH45+nlXp6AGIk45GysI6Jc9txfiIPuyrn9F8zRnbSg9G +LgzpahcWE+rNTsVeMOvTEG01GaNt+1IiV0bwc5v13Dz7lybcMfvdtWOy//XfWLiG +nKzTqtmEfwKBgBdAquEZaXRDjBZDpdR6DSml193G4lN6Bvip+YpVncyATh5OmciK +PBkyoorZNm22JJhzUCMf+nRONckE8sCzvS4oG/r0UosXtO393VEZIVboY5jR8Qju +0M0mDMp2zGZrAtsoYXYQmtO0aHfPmTjbXL+55moG135Z0L5lCh8iCtIDAoGAMhy2 +nxaNzHeocnfhUrwgOvtopR+1CpfDKUowYeydcETvFOXIM/OcCy2psTiSa9xaLPD5 +PlmQPMBFouKi43u8QJHYrHJAT3OXlB3HGLKaUz0OmzMblbSlsNAu/RbxC75GNMxD +6VjXS+MuUZ7sMh67nB6Kpa9xN63EkENzWmV/o3sCgYEAvuvGu6lqtS+nTxOaVJtJ +AyJAr/Dgwcoh/JAwCmhX5q/CydG+URA5sRNKOD7VcR9xl1kpfOC5sfCo42kyomSz +3PnXipBnuFeOzFMpIncoue86lulPdbU3j6hzKhrLtfYNF89qPEzfvVgSpNnIXWxF +lRyfz74PO2EDL62eUTvxa3U= -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index ed672ec812..efa4ac00ca 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTEyMjIxMTMwMFoXDTM0MTEyMjIxMTMwMFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3jm5T0iKR4 -y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cKWQIxFMyZirvfWNJt9Nmd2e2Yq0jeu73uVhDDLLf9nB -GmRvzbFetuuiyl/b27Nwnweobcy5fJewhnbo2NuJYxwfQDZv5SlnbrBiJRKzqPFQ -Cj28AriR+kyXhPfjyT0A9kH9A8GQQ51DPjDEbdGjSzatzTOYPPdBLSaHK+nNV3uM -ePw/GTTH5O72x6IyZJIE5OCUZrKlNUlUIXk= +BBQuYmIh+CV093BltPCw1QZHxIGHJTANBgkqhkiG9w0BAQsFAAOCAgEAIJRJHtZs +C7Ssn6a+MOPP1MR5tKrAI8Eyhgl+vcB8L1F9i8FLBqWoHxm6RKXR3DTiKvOHRFra +0jagYJwiEzmAV0E+wZvqlzqs1u7/YuAnM/Vx/azE4Ux3x5LQLUhBOInhG5VI1UFg +5ZpULVSTar3mZ0NjlXWi4FF4HiRfJtnIQnlzh3EM7PQEUwlNnzQMWRq9ogTadx2f +IIJQfM8DgYBqXX00HJMHVOprEPgCHldvc3RBFg8kym4/upSVancOAXmalePDWpg4 +8qWX54r+j2PlQuoxd5dMwequmG1yaKMHzcN10Vvku+C/DoUKXBwynyTksFfb5LcO +z+VbhzCGtvLEJ7xLYNY/AcJcmY3pR9zFpBlC7oAwGJdw/pYtnDjWSQ+D41mCrirV +K4MLn4YS0qVqXX2W1xrx89+E6WBzV7r53h73TVw9LXPNfn2AWV+bumZrMbwvrC2M +iAruaACheI9YACGaFYHSD8G9xxu1L0fFnnKDa8iGfnuz3RJE7iGPgDEjPaIrn7RP +WzojEQi03p3UNLhH9BQWuK9xF5ffzwKMWnrAQpgNASWh1/5P+U2tRZ4DSqhhya8D +UO9d1dF5gXpjrpz32N3crB2hYOocPQVJM4t0ub8YyEYV0Lzqs4shnHprZqP5kQ5T ++RG/fqOT5gEytJNNj6q//TY8vUAAiYHBO6k= -----END CERTIFICATE----- From ebd92bde6bb6d8c7a067942e3925bb2395d93222 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 25 Nov 2024 13:45:37 -0500 Subject: [PATCH 45/91] fixing formats --- .../handler/stats/provider/statuscode.go | 4 ++ .../handler/stats/provider/statuscode_test.go | 12 ++--- internal/tls/testdata/server.crt | 44 ++++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- 5 files changed, 83 insertions(+), 79 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index bb7b3a08ce..c4db2ce01e 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider import ( @@ -8,6 +11,7 @@ import ( "time" "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 4a1e9d1d47..c7a40033fe 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -19,16 +19,16 @@ func TestStatusCodeHandler(t *testing.T) { // Locking to ensure thread-safe operations handler.mu.Lock() - handler.statsByOperation["pmd"] = &[5]int{1, 2, 0, 1, 0} + handler.statsByOperation["dt"] = &[5]int{1, 2, 0, 1, 0} handler.mu.Unlock() // Retrieve stats after modification - stats := handler.Stats("pmd") + stats := handler.Stats("dt") expected := [5]int{1, 2, 0, 1, 0} - actualStats := stats.StatusCodes["pmd"] + actualStats := stats.StatusCodes["dt"] // Perform assertions - assert.Equal(t, expected, actualStats, "Unexpected stats values for operation 'pmd'") - assert.Contains(t, stats.StatusCodes, "pmd", "Status code map should contain 'pmd'") - assert.Equal(t, expected, stats.StatusCodes["pmd"], "Stats for 'pmd' do not match") + assert.Equal(t, expected, actualStats, "Unexpected stats values for operation 'dt'") + assert.Contains(t, stats.StatusCodes, "dt", "Status code map should contain 'dt'") + assert.Equal(t, expected, stats.StatusCodes["dt"], "Stats for 'dt' do not match") } diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 4827558116..fecbd8237b 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQAYBHVENqvOHA8ZQqQjJDkzANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTEyNTE2NTgyM1oXDTI0MTEyNTE3NTgy -M1owFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAPDb0hiuoFEgmrTdSIlGa9bnQ16QVjkrA++xu00C7Kd562H+EinU -LYhyae6qn6iMhlU0Cid9YnW4SMPFcsJ4zaMymtKA7bijm6icsyp1k2HGgjdP+CEo -1FJ19ykl3ipiKn5BDgSLaLwDW/bekdT3akDPuDc9V8F1/FPR3xhT0+OcGETOlPOq -PMtzVlaFH1s3ytUbofFxNLLueFg3eJ1gSOKSltyd4ooORvSfPMcUtkxs26JQywE6 -ZNAO6e70bE/a1A/pWXeGiSrfFvbW+I8JiNVzE486on48Jt5RvuUzV3qjs/Be4ivU -b4c3ijB1FA5g0FPFxDqdze/iKal1kgd0PZUCAwEAAaNnMGUwDgYDVR0PAQH/BAQD -AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgw -FoAUyAL5mzrz1ukytBmj2Ur9nCLgY44wDwYDVR0RBAgwBocEfwAAATANBgkqhkiG -9w0BAQsFAAOCAgEAdQE6PI37b+iGZOjoRycWE5NVjU6dppSMTnN/2uPDarEO5flz -TgwHkepffb/nvB7W+yXzbdL3FSGjTw6xUXaLnN/18CgrxGQBsnTZiZPFUu8k34YW -oOdJL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c/RgC9fAcaRYYBhei7Xcid6 +0jI6nnKoSfS/+9VJBVqrYFbkqadO0JulXhSPAgMBAAGjZzBlMA4GA1UdDwEB/wQE +AwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQY +MBaAFJi6T24jwFP3R2mB9/BGvFCzu7b1MA8GA1UdEQQIMAaHBH8AAAEwDQYJKoZI +hvcNAQELBQADggIBAB8VerzpkG1p5eq8QqDDAYjxDkn+W7MIZwLYUXQB+Uj7abs6 +t/6MNhCK89ookd3Wyg3MKpp7meKtscvPwZWUxs+tl9zNiFqPLRBa0qx1DKuatS3c +9teJZxSd15BeBLDir5OFp0f67s1mCh283aKf7saU12w/R0/xRCpiYCj2SheEG3Kr +FU3F+KtyrRx/RpX2p/bC9BL0k84oiXM30e49bdYKf/62v8SB8PsQN2nWglZAZ6/0 +q015Zh7K0Pa0NMDHEzZTlyLBPLpyeLyQyiEnBC783DqZOOvgcZOtghS9ZzO312eK +lxAofdLhteSZDOX8khQ4m/JXS5FBT0cGnYqNjdSKYeJdCRh1WTbENTSCwC3fvart +V+T5E35Px1Yot661sqPxrDs3UhN89IMYIk7lNlP5DiLQB0CrwXwRXdMn0jEJWhrv +xtFDaSXFKY12Axm6y1uv3wpVRDwWCXXxnEfoAsALm2onR0nOeg3WG4z5BzrKKfyk +DQXuN3zZzLuQmkmUCNUMxB6qDiI+rTaXgIphwfDZBmRkTgz+Hr1VXvpsg7pk335R +IR5QXYeAkFRc3TrH71OaYPBxIlCp8JcQ/eL1z5nvZZhMk3ivJnf3f22K5i18I/D4 +Aunffja6Z3nE4kuw56NkvDhyGEC9XsS7dbF2FNN/DNDCUxij8MukQuuDMMRy -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index e6afc8732a..543fac6267 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQI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0e2tb6WXcWXnuSBZLmDkjx9RBp0ThWNdXD +qgRZEUfyLb4WaKYdl9cDJA== -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index efa4ac00ca..df4b572b3c 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTEyNTE2NTgyOFoXDTM0MTEyNTE2NTgyOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMehddaZ8DxS -twdYQ4hil51MJDW4l01usSqpooUm+MaFLvMu8sxacKHjcwtgtRGRf9ZHv4cQUIFU -CvTestEyC7hS89Y6LEn9Ovy0iRtRLL6Y83t7/vLQM77PRSKkyuyI3t8q+bPQbgDr -z90H5CW1SMiDmFtnEFbYNMWc7EJrF5GLLKmv6ytAz3hxvHIzopl2xzR6WiXEod5G -IInMammxxweqNGaQuqT1Su2NxOlfGfuEoEpwZZoVfZkibbzwTdT8JeksLF9yo4+P -vMAljuOnabHsKsMVm8gJ0gjYpvMSNPIuXYbv1um6UvvfcCPY8xrrXT2u+EToXsGT -rg2nKS2nPRIT7kgZ6vhfybECwTmUx9C0QQIqWBO3VVd9eCbfuGINR9ZsgB/ApXtG -r0ZvYqSoTvCMbEXwdHdFW+2V1XvBADQGab3XiBfumkNFfztjmdRkgFWbLw5LABA+ -eedJliL7sX3ym/7RnpJxY9XRv4gsVCYJgKS+4u9ssSV0WAKuBDddFu3ib6qDEWqR -2rNza5sOSvrQFxE3GL5GgWadYpMZwSMuixa6PuG7aqMvWP8hFOchOgTuuWvvo2C7 -gw42yZ6/v1+OFRaaohivpsxLuhG01pH0CDA+71U+zzGE6ONXDMZKP72VQzkdgPXL -dJS0PfyyQcG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kdFdiVfvgNhmvWfQheovOVII2wRo/JEjKTU+01yF +Yp5S2cWYdMe8lur+8mlR+nTc6vq2Ql8ArQcwnRvUhpduRHkCr/WiRI6swalpIz4s +X+LfRCepH1bq/2tDXNjffAOaqlEz+QxI6+yUk9c7wyzmm/CIg85O4HrNNKu3CAF3 +/4zpAmIHuwyfGA26PX31LDfxYVtC+S7/7R5TbDDLP0G9Xjr37+5b2qXOL8A75qoM +W6byKk4IcSWTdwBsToGLx09N0BfH33j18ljcLRUNcoPqS2dvpw/Phm7ssGKN+a+N +P4QQhU7C27IdmorPqoj7/nNrA5wB8zLyeiY= -----END CERTIFICATE----- From 44c40066d53fd45d0f039a639a1112a93e8a1e81 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 25 Nov 2024 14:39:37 -0500 Subject: [PATCH 46/91] fixing tests --- internal/tls/testdata/server.crt | 44 +++++++++++++-------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index fecbd8237b..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGTCCAgGgAwIBAgIRAJErVG1A9612vCnbWMxvVPIwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHUm9vdCBDQTAeFw0yNDExMjUxODEyMTdaFw0yNDExMjUxOTEy -MTdaMBUxEzARBgNVBAoTCkt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDt5M2yZc6dQaKbh6azSnZ9TorGLPCeie5iFF3gvJACVPUoBnji -0oL/8PZONJGcLZbqjRKPNvqOLEIBxXRHu8Xy06+c7THaWPxKc4s7YtVjOZYpoZrv -iypksvj2YXnj25WMlXUIObMYZ5zCo8xey1vr4UXpnS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by+9CmhLZfgaVbE +nVQTj8hkUW1gtvnAP3v1Zbe3QMhlqWqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 543fac6267..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDt5M2yZc6dQaKb -h6azSnZ9TorGLPCeie5iFF3gvJACVPUoBnji0oL/8PZONJGcLZbqjRKPNvqOLEIB -xXRHu8Xy06+c7THaWPxKc4s7YtVjOZYpoZrviypksvj2YXnj25WMlXUIObMYZ5zC -o8xey1vr4UXpnSQy1lEAxr7NpicxFIPpiQdT1DclsHI/ahY6eRdzUhAgyPpGJEwx -KsNsF6KUSXglUisCaPbY8mefmpEMWxQt2fXtdguXc++AqNGBjOXbdotJaTFGOnbv -/EQ8smJG4iptkc/RgC9fAcaRYYBhei7Xcid60jI6nnKoSfS/+9VJBVqrYFbkqadO -0JulXhSPAgMBAAECgf8ghieZPFIDLfYNTX59BLEucI6IiZxcEH+G6UHsd9s4dmUO -E9RzLlS6qTcDeixuLc10Q9VFvz6CMYrUsyoypHlruYVI7yThtUjI5QMkG18RMc5V -4sJL/brOCaoABVOk02Ce19AoT7ssmv3TnpFSZHssxJ/KULGiQarRcFqlwxGYo/Hp -x+QvnXdV4b/9//BJGRNlIQv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b701XfhR5UX +RWvWI50gwQKBgQCFa1i9luwJJ0m1VOyk5kML7gMhqcbneL8XYzzx2S7IMuyKpSNt +H++ZGWdXga2Vbq3bDmNQrSvDJLcWgEP6e9ZwwZH6WYgo9KA3036iTiF6fUx1doh5 +WB3M0M6SUTBFZzqzAq3vYYEWhns7A7Se/2w8N1+0HrRQnXu5aHK1RGo+iwKBgEST +hRx7fi/dK/xsl9oDyN4SPdPLlcmjPZ6/cb23RgUMZaAGiThmfu1hLU6pphMpkdKX +yzx6W9Wu2NTYPpT/WK8Ks4olYDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index df4b572b3c..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTEyNTE4MTIyMFoXDTM0MTEyNTE4MTIyMFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJqmkUEzFRKI -OiiqMjvh9EEMkjFQs4D9E0dgpfNUVSeVAP7vYFZKK4+sM1D1reIjkQBfh+khPPts -DxVdjlCvjxKf8Mvm4RZXIe+Vf5sWYNj1phHc8up1fzZLkqEex6wRH4qnIgZyCaWj -FLIuF0+fhYT9m+Q0qiz0jbbQ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33j18ljcLRUNcoPqS2dvpw/Phm7ssGKN+a+N -P4QQhU7C27IdmorPqoj7/nNrA5wB8zLyeiY= +BBSWf0MJGMR6k7iAcZMQBOIFr+DoGjANBgkqhkiG9w0BAQsFAAOCAgEAHQib14b2 +y1b9Xa+lvvpyho887AF5LJMvcAaFA2qrZTgsct9YAUyP4jwHSMa82F34GF5zWm96 +wKGa2V7rykKPLtL2o0ilfnz3bJndL2MUjgVqK7GzkOGIhhXreG6/4WZ+oNReMzjw +uZ6zWKhUrTKfvt5J70Nzk+aPrwEzOOcb078QfrFvxElrkoyBz5LGF6HVdIVYUO94 +1DW1egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From ecb4be5c085ebb4d9697811a14b5466502fe191b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 25 Nov 2024 15:11:10 -0500 Subject: [PATCH 47/91] removing log statements --- .../handler/stats/provider/statuscode.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index c4db2ce01e..28d6303c4c 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -5,7 +5,6 @@ package provider import ( "context" - "log" "net/http" "sync" "time" @@ -42,11 +41,7 @@ func GetStatusCodeStats(filter interface{}) *StatusCodeHandler { if opsFilter, ok := filter.(agent.OperationsFilter); ok { handler.filter = opsFilter - } else { - // Provide a default or fallback implementation if the filter is not valid - log.Println("Invalid filter provided; using NoOpOperationsFilter.") } - handler.startResetTimer() statusCodeSingleton = handler }) @@ -61,7 +56,6 @@ func (h *StatusCodeHandler) startResetTimer() { for key := range h.statsByOperation { delete(h.statsByOperation, key) } - log.Println("Status code stats reset.") h.startResetTimer() }) } @@ -75,10 +69,7 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response operation := awsmiddleware.GetOperationName(ctx) if !h.filter.IsAllowed(operation) { - log.Printf("Operation %s is not allowed", operation) return - } else { - log.Printf("Processing response for operation: %s", operation) } operation = GetShortOperationName(operation) @@ -95,15 +86,9 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response if !exists { stats = &[5]int{} h.statsByOperation[operation] = stats - log.Printf("Initializing stats for operation: %s", operation) } h.updateStatusCodeCount(stats, statusCode, operation) - - // Optionally, log all stats (protected by the mutex) - for operation, stats := range h.statsByOperation { - log.Printf("Operation: %s, 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", operation, stats[0], stats[1], stats[2], stats[3], stats[4]) - } } // Helper function to update the status code counts @@ -120,7 +105,7 @@ func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int, case 429: stats[4]++ default: - log.Printf("Received an untracked status code %d for operation: %s", statusCode, operation) + return } } From dfa3d4b6529ad7824f545929330fc197c2b7db30 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 25 Nov 2024 15:14:48 -0500 Subject: [PATCH 48/91] fixed names --- extension/agenthealth/config.go | 6 +++--- extension/agenthealth/extension.go | 2 +- .../translate/otel/extension/agenthealth/translator.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index 3952ef3f81..78a1b28d92 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -10,9 +10,9 @@ import ( ) type Config struct { - IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` - Stats agent.StatsConfig `mapstructure:"stats"` - IsOnlyStatusCodeEnabled bool `mapstructure:"is_status_code_enabled,omitempty"` + IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` + Stats agent.StatsConfig `mapstructure:"stats"` + IsStatusCodeEnabled bool `mapstructure:"is_status_code_enabled,omitempty"` } var _ component.Config = (*Config)(nil) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index f479d63b6a..6af3269610 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -32,7 +32,7 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa } statusCodeEnabled := false - statusCodeEnabled = ah.cfg.IsOnlyStatusCodeEnabled + statusCodeEnabled = ah.cfg.IsStatusCodeEnabled agentStatsEnabled := slices.Contains(ah.cfg.Stats.Operations, "PutMetricData") || diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index c4320374bf..541a4445d4 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -70,7 +70,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok { cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData } - cfg.IsOnlyStatusCodeEnabled = t.statuscodeonly + cfg.IsStatusCodeEnabled = t.statuscodeonly if t.statuscodeonly != false && t.statuscodeonly { return cfg, nil } From b58999396cf0dedaf1e681be6fd04727f01c7893 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 2 Dec 2024 14:42:50 -0500 Subject: [PATCH 49/91] temp save --- extension/agenthealth/handler/stats/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 2f89062bd4..5f3c3f0048 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -45,7 +45,7 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo requestHandlers = append(requestHandlers, clientStats) } - filter := agent.NewStatusCodeAndOtherOperationsFilter(cfg.Operations) + filter := agent.NewOperationsFilter(cfg.Operations...) stats := newStatsHandler(logger, filter, statsProviders) requestHandlers = append(requestHandlers, stats) From 0e3b86bc4b6e49bdba2a5d1d0c14995c4676d8a7 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 4 Dec 2024 03:06:00 -0500 Subject: [PATCH 50/91] This fixes issues with pr and makes provider singleton instead of handler --- extension/agenthealth/config.go | 6 +- extension/agenthealth/config_test.go | 4 +- extension/agenthealth/extension.go | 21 +- extension/agenthealth/extension_test.go | 4 +- extension/agenthealth/factory.go | 2 +- extension/agenthealth/factory_test.go | 2 +- .../agenthealth/handler/stats/handler.go | 11 +- .../handler/stats/provider/process_test.go | 22 ++- .../handler/stats/provider/statuscode.go | 179 ++++++++++-------- .../handler/stats/provider/statuscode_test.go | 88 ++++++--- internal/tls/testdata/server.crt | 42 ++-- internal/tls/testdata/server.key | 52 ++--- internal/tls/testdata/tls-ca.crt | 50 ++--- .../outputs/cloudwatchlogs/cloudwatchlogs.go | 2 +- .../otel/extension/agenthealth/translator.go | 5 +- .../extension/agenthealth/translator_test.go | 8 +- 16 files changed, 283 insertions(+), 215 deletions(-) diff --git a/extension/agenthealth/config.go b/extension/agenthealth/config.go index 78a1b28d92..53c6901fff 100644 --- a/extension/agenthealth/config.go +++ b/extension/agenthealth/config.go @@ -10,9 +10,9 @@ import ( ) type Config struct { - IsUsageDataEnabled bool `mapstructure:"is_usage_data_enabled"` - Stats agent.StatsConfig `mapstructure:"stats"` - IsStatusCodeEnabled bool `mapstructure:"is_status_code_enabled,omitempty"` + 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..0e97928ae7 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: &agent.StatsConfig{Operations: []string{agent.AllowAllOperations}}}, }, { 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 6af3269610..26b20bc057 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -5,9 +5,9 @@ package agenthealth import ( "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "go.opentelemetry.io/collector/component" "go.uber.org/zap" - "golang.org/x/exp/slices" "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats" "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/useragent" @@ -31,15 +31,20 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa return requestHandlers, responseHandlers } - statusCodeEnabled := false - statusCodeEnabled = ah.cfg.IsStatusCodeEnabled + if ah.cfg == nil { + return nil, nil + } + statusCodeEnabled := ah.cfg.IsStatusCodeEnabled + + var statsResponseHandlers []awsmiddleware.ResponseHandler + var statsRequestHandlers []awsmiddleware.RequestHandler - agentStatsEnabled := - slices.Contains(ah.cfg.Stats.Operations, "PutMetricData") || - slices.Contains(ah.cfg.Stats.Operations, "PutLogEvents") || - slices.Contains(ah.cfg.Stats.Operations, "PutTraceSegment") + if ah.cfg.Stats != nil { + statsRequestHandlers, statsResponseHandlers = stats.NewHandlers(ah.logger, *ah.cfg.Stats, statusCodeEnabled, true) + } else { + statsRequestHandlers, statsResponseHandlers = stats.NewHandlers(ah.logger, agent.StatsConfig{}, statusCodeEnabled, false) + } - statsRequestHandlers, statsResponseHandlers := stats.NewHandlers(ah.logger, ah.cfg.Stats, statusCodeEnabled, agentStatsEnabled) requestHandlers = append(requestHandlers, statsRequestHandlers...) responseHandlers = append(responseHandlers, statsResponseHandlers...) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 5679ef34d3..690f9bf704 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -10,13 +10,11 @@ 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, Stats: agent.StatsConfig{Operations: []string{"PutLogEvents"}}} + cfg := &Config{IsUsageDataEnabled: true, IsStatusCodeEnabled: true} extension := NewAgentHealth(zap.NewNop(), cfg) assert.NotNil(t, extension) assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost())) diff --git a/extension/agenthealth/factory.go b/extension/agenthealth/factory.go index e8e97587a5..0059eb3c67 100644 --- a/extension/agenthealth/factory.go +++ b/extension/agenthealth/factory.go @@ -28,7 +28,7 @@ func NewFactory() extension.Factory { func createDefaultConfig() component.Config { return &Config{ IsUsageDataEnabled: true, - Stats: agent.StatsConfig{ + Stats: &agent.StatsConfig{ Operations: []string{agent.AllowAllOperations}, }, } diff --git a/extension/agenthealth/factory_test.go b/extension/agenthealth/factory_test.go index 4899dfb425..8081a0f06e 100644 --- a/extension/agenthealth/factory_test.go +++ b/extension/agenthealth/factory_test.go @@ -16,7 +16,7 @@ import ( 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: &agent.StatsConfig{Operations: []string{agent.AllowAllOperations}}}, cfg) assert.NoError(t, componenttest.CheckConfigStruct(cfg)) } diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 2f89062bd4..28858ac993 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -31,11 +31,12 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo } statusCodeFilter := agent.NewStatusCodeOperationsFilter() - statusCodeStats := provider.GetStatusCodeStats(statusCodeFilter) + statusCodeHandler := provider.NewStatusCodeHandler(statusCodeFilter) + if statusCodeEnabled { - requestHandlers = append(requestHandlers, statusCodeStats) - responseHandlers = append(responseHandlers, statusCodeStats) - statsProviders = append(statsProviders, statusCodeStats) + requestHandlers = append(requestHandlers, statusCodeHandler) + responseHandlers = append(responseHandlers, statusCodeHandler) + statsProviders = append(statsProviders, provider.GetStatsProvider()) } if agentStatsEnabled { @@ -45,7 +46,7 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo requestHandlers = append(requestHandlers, clientStats) } - filter := agent.NewStatusCodeAndOtherOperationsFilter(cfg.Operations) + filter := agent.NewOperationsFilter(cfg.Operations...) stats := newStatsHandler(logger, filter, statsProviders) requestHandlers = append(requestHandlers, stats) diff --git a/extension/agenthealth/handler/stats/provider/process_test.go b/extension/agenthealth/handler/stats/provider/process_test.go index 931f08e6a0..c265e040f9 100644 --- a/extension/agenthealth/handler/stats/provider/process_test.go +++ b/extension/agenthealth/handler/stats/provider/process_test.go @@ -5,6 +5,7 @@ package provider import ( "errors" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "sync" "testing" "time" @@ -75,6 +76,25 @@ func TestProcessStats(t *testing.T) { mock.mu.Unlock() provider.refresh() assert.Eventually(t, func() bool { - return len(provider.getStats().StatusCodes) == 0 // map isn't comparable, so we check the length + 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 index 28d6303c4c..fb8d1fce4c 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,16 +1,12 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: MIT - package provider import ( "context" + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" "net/http" "sync" "time" - "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) @@ -20,44 +16,33 @@ const ( ) var ( - statusCodeSingleton *StatusCodeHandler - statusCodeStatsOnce sync.Once + statsProviderSingleton agent.StatsProvider + statsProviderOnce sync.Once ) -// StatusCodeHandler provides monitoring for status codes per operation. -type StatusCodeHandler struct { - statsByOperation map[string]*[5]int - resetTimer *time.Timer - filter agent.OperationsFilter - mu sync.Mutex +// SingletonStatsProvider manages a collection of statistics. +type SingletonStatsProvider struct { + mu sync.Mutex + statusCodeStats map[string][5]int } -// GetStatusCodeStats retrieves or initializes the singleton StatusCodeHandler. -func GetStatusCodeStats(filter interface{}) *StatusCodeHandler { - statusCodeStatsOnce.Do(func() { - handler := &StatusCodeHandler{ - statsByOperation: make(map[string]*[5]int), - } - - if opsFilter, ok := filter.(agent.OperationsFilter); ok { - handler.filter = opsFilter - } - handler.startResetTimer() - statusCodeSingleton = handler - }) - return statusCodeSingleton +// StatusCodeHandler provides monitoring for status codes per operation. +type StatusCodeHandler struct { + statsProvider *SingletonStatsProvider + filter agent.OperationsFilter + resetTimer *time.Timer + mu sync.Mutex } -// startResetTimer initializes a reset timer to clear stats every 5 minutes. -func (h *StatusCodeHandler) startResetTimer() { - h.resetTimer = time.AfterFunc(statusResetInterval, func() { - h.mu.Lock() - defer h.mu.Unlock() - for key := range h.statsByOperation { - delete(h.statsByOperation, key) - } - h.startResetTimer() - }) +// NewStatusCodeHandler creates a new instance of StatusCodeHandler. +func NewStatusCodeHandler(filter agent.OperationsFilter) *StatusCodeHandler { + provider := GetStatsProvider().(*SingletonStatsProvider) // Get the singleton provider. + handler := &StatusCodeHandler{ + statsProvider: provider, + filter: filter, + } + handler.startResetTimer() + return handler } // HandleRequest is a no-op for the StatusCodeHandler. @@ -65,34 +50,89 @@ func (h *StatusCodeHandler) HandleRequest(ctx context.Context, _ *http.Request) // HandleResponse processes the HTTP response to update status code stats. func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { - // Extract the operation name operation := awsmiddleware.GetOperationName(ctx) - - if !h.filter.IsAllowed(operation) { - return - } - - operation = GetShortOperationName(operation) if operation == "" { return + } else if !h.filter.IsAllowed(operation) { + return } + operation = GetShortOperationName(operation) statusCode := r.StatusCode h.mu.Lock() defer h.mu.Unlock() - stats, exists := h.statsByOperation[operation] - if !exists { - stats = &[5]int{} - h.statsByOperation[operation] = stats + // Get or initialize stats + h.statsProvider.mu.Lock() + stats := h.statsProvider.statusCodeStats[operation] + h.statsProvider.mu.Unlock() + + h.updateStatusCodeCount(&stats, statusCode) + + // Update the singleton stats provider + h.statsProvider.UpdateStats(operation, stats) +} + +// ID returns the unique identifier for the handler. +func (h *StatusCodeHandler) ID() string { + return statusHandlerID +} + +// Position specifies the handler's position in the middleware chain. +func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { + return awsmiddleware.After +} + +// GetStatsProvider retrieves the singleton instance of the `agent.StatsProvider`. +func GetStatsProvider() agent.StatsProvider { + statsProviderOnce.Do(func() { + statsProviderSingleton = &SingletonStatsProvider{ + statusCodeStats: make(map[string][5]int), + } + }) + return statsProviderSingleton +} + +// Stats returns the current statistics for a given operation. +func (p *SingletonStatsProvider) Stats(operation string) agent.Stats { + p.mu.Lock() + defer p.mu.Unlock() + + statusCodeMap := make(map[string][5]int, len(p.statusCodeStats)) + for op, stats := range p.statusCodeStats { + statusCodeMap[op] = stats } - h.updateStatusCodeCount(stats, statusCode, operation) + return agent.Stats{ + StatusCodes: statusCodeMap, + } +} + +// UpdateStats updates the statistics for a given operation. +func (p *SingletonStatsProvider) UpdateStats(operation string, stats [5]int) { + p.mu.Lock() + defer p.mu.Unlock() + + p.statusCodeStats[operation] = stats +} + +// startResetTimer initializes a reset timer to clear stats every 5 minutes. +func (h *StatusCodeHandler) startResetTimer() { + h.resetTimer = time.AfterFunc(statusResetInterval, func() { + h.mu.Lock() + defer h.mu.Unlock() + + h.statsProvider.mu.Lock() + h.statsProvider.statusCodeStats = make(map[string][5]int) + h.statsProvider.mu.Unlock() + + h.startResetTimer() + }) } -// Helper function to update the status code counts -func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int, operation string) { +// updateStatusCodeCount updates the count for a given status code. +func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int) { switch statusCode { case 200: stats[0]++ @@ -104,17 +144,17 @@ func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int, stats[3]++ case 429: stats[4]++ - default: - return } } func GetShortOperationName(operation string) string { switch operation { - case "PutMetricData": - return "pmd" + case "PutRetentionPolicy": + return "prp" case "DescribeInstances": return "di" + case "DescribeTasks": + return "dt" case "DescribeTags": return "dt" case "DescribeVolumes": @@ -133,36 +173,7 @@ func GetShortOperationName(operation string) string { return "clg" case "CreateLogStream": return "cls" - case "AssumeRole": - return "ar" default: return "" } } - -// ID returns the unique identifier for the handler. -func (h *StatusCodeHandler) ID() string { - return statusHandlerID -} - -// Position specifies the handler's position in the middleware chain. -func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { - return awsmiddleware.After -} - -// Stats implements the `Stats` method required by the `agent.StatsProvider` interface. -func (h *StatusCodeHandler) Stats(operation string) agent.Stats { - // Lock mutex to safely access statsByOperation - h.mu.Lock() - defer h.mu.Unlock() - - statusCodeMap := make(map[string][5]int) - - for operation, stats := range h.statsByOperation { - statusCodeMap[operation] = *stats - } - - return agent.Stats{ - StatusCodes: statusCodeMap, - } -} diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index c7a40033fe..7f9168ae7b 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -1,34 +1,70 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: MIT - package provider import ( + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "reflect" "testing" +) - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" +// MockOperationsFilter is a mock implementation of OperationsFilter. +type MockOperationsFilter struct { + allowedOperations map[string]bool +} - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" -) +func (m *MockOperationsFilter) IsAllowed(operation string) bool { + return m.allowedOperations[operation] +} + +func TestSingletonStatsProvider_Stats(t *testing.T) { + provider := &SingletonStatsProvider{ + statusCodeStats: map[string][5]int{ + "operation1": {1, 2, 3, 4, 5}, + }, + } + + stats := provider.Stats("operation1") + + expected := agent.Stats{ + StatusCodes: map[string][5]int{ + "operation1": {1, 2, 3, 4, 5}, + }, + } + + if !reflect.DeepEqual(stats, expected) { + t.Errorf("Stats() failed. Got %+v, expected %+v", stats, expected) + } +} + +func TestSingletonStatsProvider_UpdateStats(t *testing.T) { + provider := &SingletonStatsProvider{ + statusCodeStats: make(map[string][5]int), + } + + provider.UpdateStats("operation1", [5]int{1, 0, 0, 0, 0}) + + expected := map[string][5]int{ + "operation1": {1, 0, 0, 0, 0}, + } + + if !reflect.DeepEqual(provider.statusCodeStats, expected) { + t.Errorf("UpdateStats() failed. Got %+v, expected %+v", provider.statusCodeStats, expected) + } +} + +func TestGetShortOperationName(t *testing.T) { + tests := []struct { + input string + expected string + }{ + {"PutRetentionPolicy", "prp"}, + {"DescribeInstances", "di"}, + {"UnknownOperation", ""}, + } -func TestStatusCodeHandler(t *testing.T) { - filter := agent.NewStatusCodeOperationsFilter() - handler := GetStatusCodeStats(filter) - require.NotNil(t, handler) - - // Locking to ensure thread-safe operations - handler.mu.Lock() - handler.statsByOperation["dt"] = &[5]int{1, 2, 0, 1, 0} - handler.mu.Unlock() - - // Retrieve stats after modification - stats := handler.Stats("dt") - expected := [5]int{1, 2, 0, 1, 0} - actualStats := stats.StatusCodes["dt"] - - // Perform assertions - assert.Equal(t, expected, actualStats, "Unexpected stats values for operation 'dt'") - assert.Contains(t, stats.StatusCodes, "dt", "Status code map should contain 'dt'") - assert.Equal(t, expected, stats.StatusCodes["dt"], "Stats for 'dt' do not match") + for _, test := range tests { + result := GetShortOperationName(test.input) + if result != test.expected { + t.Errorf("GetShortOperationName(%q) = %q; want %q", test.input, result, test.expected) + } + } } diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..d37902f782 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtcXSqWmtWEB -LiHPhSU0HN5JWsfQZ2VkB8rFStQ8CwFG0DW9i6GSVsN1zmmzLQdVPAyP4Uzy8844 -/ceZsmlkIe6uk3BiRRNThUcJKlFJJroCBJ8y7AJA8s3teLWskRLik+0xintked6z -fMaQRgzOSPDc062QTODHB2IkShVZAeLh7OcCAwEAAaNnMGUwDgYDVR0PAQH/BAQD +MIIEGDCCAgCgAwIBAgIQXfs/Q5GFuLc7NUTyz//9iTANBgkqhkiG9w0BAQsFADAS +MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIwNDA4MDEwM1oXDTI0MTIwNDA5MDEw +M1owFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBALOxmj9qUrnzbNku4gJOe5sBI0UKhhtMXsKL3UlwBHP9MLrwj0vB +qYmNrrBxD5ROApBCGn0nhRu64R0fZfWdyt/fPMRMWAeg/XGg93g2MsiusBte1M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A5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= +FoAUTnL74edc4aTk4B25twKhJJH5eTUwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG +9w0BAQsFAAOCAgEAv59o9jRL3czcK4VtlsyV1B1DmGhbHwDvTUVHVeP2GKQaBqzc +u1gjkhGrYJ4EnObl+GMfkEgFpehOd4oFTmxVHqMSXuUn1uPmYoZkeBF9owjSRh9O +wB2g+WhMT46GunLz8QBVU0tw4By2sSXTxe/0TPbA1ZNIEdP+IQGAzrz8VJoIDC8w +r7vA2iLDEgd1AieK74pbzO1GDBIQeKYCpqdPPsWNZwuHTNqBkSb6PXvQm3lXU4cY +7ni7PcgkOyL1wJAJt8V2j9YE2i6Sg43SYYp7LEeiH1Ni/XMuX7BDoLRaMoreWBtT +SPYNyTobejpupOSRM2+hV0kY2cTr9phJavtPCz3qEWM2Pk9/8u/V9lPR66BcWhZ7 +NhaDRc6zvdb4xlMpHZ4nDjmsG0J/0CCp11hAsspIMr8oW/e2TIJMIdEBLSYRaqZM +k/XdFLbI+Hvgg/EZu64u9UN4eZYb/yn7nCqdN8j6K/IbiEK0LhT9B/JQM412is3D +PwVKzt/MyKQ/p82wgFm9DvH+eHrQdxqRMuBLKRK3qnitxzGVCe69z7P3ChcfORpA +3TUn2OxyX/M5KVWNoV59MEps17129C2HAM3MY1VyFnTa1MWVz/i/9EvHMuo23Zpq +aF7XULQHVBTO6bLF8o4YDpL3SJtLQVLDKwNYOnarjqo7dno9REelArSbXY0= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..04af962903 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxW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L61qUbHl8gdGfbg/FMoNLrwD +XWbL+JCmpRfcMwFlMaWdu4bx6PQlL8M+wH7avN96R1WxqRNP3JhwmgJeuBjIlMPQ +Kj8AasIEaSjicGzoK51jP5FPke+XxUpL50wPJr0JRQKBgQDWXe+MpyEDnkcm/X1/ +hgHOlrmmVSlu1qJD8kNbUl3SmbP3fMUPbW42yVBcEgYw2m1aVstXRA5TzVVioEpV +RxRSwaZln7JGDeg1o8F2fCI6y6cvpwzQeWN33Gd+Aq/GC/51ixi4AMQ+hhJ4XZM+ +v3sE/r9gCRmD01yQgQr0nh2yYwKBgQDWl8IrarCJ0c+3jRzxMaXGhgvVwLIAR65L +qYv36lsmuaasF0H5NAwogu7zJCoj2942vh14OE2l2S2hAoJpR0726CjI7UC5bsVm +DtZRK8Xbv8gZ9Guwak1oNDFs88rdPXFzr66JvXuqtShxpIf1pWZ5gVMABxcXbIb8 +00XiuGqjswKBgAjbkM5rCX4wyBfgWZMvYlu69qjc0/10ePf9xrK7UI0nNLyBN1NP +3kH9R4jGZeMW43XcKELO2Ri1X1XX8bpcWYah4dJJKwCiCnpM7e2La46qY5ogePMU +UPve65fVXJX+YOFSgg74WSOMPq8ijrcFCnxGWnoJZjiAP07pRh6defSpAoGAQQND +KUIub+KnypUu8oe3EJkl1sGFa/5LeNLJ+/b9XJMcQsDdFPHGyTM5z2HifnCrNuyM +IxLzu047u6718Y1QCA+343+1fzhnB49xMLBRRk0pA2wAgDcEcpB1dOu7RyHJUGIm +P8avQ72UnjFZm3tbu24JxlVfkpInp0sevhxe+m8CgYAlvttUv9+T8urlF5ubcTGT +hFDiuRhsFIsxxd6I2gj6SyptTX9v3TTnSh0JUaXre2rHgjM6L5Vt4m5wGYL24tNh +Gljuc3BpxAAaHzLRr79fzMhcO4VzG6zcStCmd/72iT3zt9SLljm3PPOxA6dF+SYP +UU1+vB75/0JpabCYZqXyTA== -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..be9a1d5cdb 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rMPbRsnGvIebh -FZsA60QnhuNiL6MowdJn17/Stl6Rs7cNV5zq3/WmaiipOoTcrKIMgA5ci23A69Pz -0WRfomoFsstRWHhimGrKrT5ewznEitvnWWxfiblmy21LTTJf6nrf7cD1B7Xlrfq+ -BORuHwSxyTapXw0HKSYPwjiSiijywWInS3QR3b5uvpyFy8rGfXI2PSTpnAsK/nws -38jUO7qPsj3AnwHpgLZe0XpGFqmemSmlPif0VT3Pn6CwsCpnEf7vFNYu+rmVjrqT -sBXv7qJMryXL4MDQcTsrX0+XDVWGlKrhVemPI94go86IuqASx7BldMounk9Pra70 -oRUZXsEbzBMGOyF/U3ZmCyJSryV4S+tkUckb/VInpmex1pkx15Q3EGmpRwTQ4/M/ -hGz0foplN1HGRQsVxuPt58Wj7/EW6BDrAgMBAAGjVzBVMA4GA1UdDwEB/wQEAwIC +IENBMB4XDTI0MTIwNDA4MDEwN1oXDTM0MTIwNDA4MDEwN1owEjEQMA4GA1UEChMH +Um9v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ZDi +v8cAAhOc8el7rUJ4BhTIeiSnH1ijSwOpnflECmYdt9UJgSNyvPApD1b7t5B/NYCp +u2BuTOlhRZYJQ91YMdVRCbkoVvMja+WI8VzBZrznhUYOqj8yMTRbICqJrQ5Lq5dT +Z7XfCY7/mo2r7suosYJswAeGxhMn6HMXCXY= -----END CERTIFICATE----- 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 541a4445d4..8d34c751d7 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -71,10 +71,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData } cfg.IsStatusCodeEnabled = t.statuscodeonly - if t.statuscodeonly != false && t.statuscodeonly { - return cfg, nil - } - cfg.Stats = agent.StatsConfig{ + 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 b14a43ca9b8e99b1025a696f63934388e4f4ee32 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 4 Dec 2024 03:12:47 -0500 Subject: [PATCH 51/91] fixing lint --- extension/agenthealth/extension.go | 2 +- .../handler/stats/provider/process_test.go | 3 ++- .../handler/stats/provider/statuscode.go | 6 +++++- .../handler/stats/provider/statuscode_test.go | 15 +++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 26b20bc057..2f1ca916b1 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -5,11 +5,11 @@ package agenthealth import ( "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "go.opentelemetry.io/collector/component" "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" ) diff --git a/extension/agenthealth/handler/stats/provider/process_test.go b/extension/agenthealth/handler/stats/provider/process_test.go index c265e040f9..8ab3382271 100644 --- a/extension/agenthealth/handler/stats/provider/process_test.go +++ b/extension/agenthealth/handler/stats/provider/process_test.go @@ -5,13 +5,14 @@ package provider import ( "errors" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "sync" "testing" "time" "github.com/shirou/gopsutil/v3/process" "github.com/stretchr/testify/assert" + + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) type mockProcessMetrics struct { diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index fb8d1fce4c..deaaaef3c7 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,12 +1,16 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider import ( "context" - "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" "net/http" "sync" "time" + "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 7f9168ae7b..b2672bab40 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -1,19 +1,14 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider import ( - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "reflect" "testing" -) - -// MockOperationsFilter is a mock implementation of OperationsFilter. -type MockOperationsFilter struct { - allowedOperations map[string]bool -} -func (m *MockOperationsFilter) IsAllowed(operation string) bool { - return m.allowedOperations[operation] -} + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" +) func TestSingletonStatsProvider_Stats(t *testing.T) { provider := &SingletonStatsProvider{ From 14528bdfe6c42cc689a6ebf9d6d1da8a2894120b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 4 Dec 2024 03:25:49 -0500 Subject: [PATCH 52/91] fixing lint --- extension/agenthealth/extension_test.go | 2 +- .../agenthealth/handler/stats/agent/agent.go | 2 +- .../agenthealth/handler/stats/handler.go | 1 - .../handler/stats/provider/statuscode.go | 5 +- internal/tls/testdata/server.crt | 44 ++++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- .../otel/extension/agenthealth/translator.go | 22 ++++---- 8 files changed, 87 insertions(+), 91 deletions(-) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 690f9bf704..c264e86440 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -20,7 +20,7 @@ func TestExtension(t *testing.T) { assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost())) requestHandlers, responseHandlers := extension.Handlers() // user agent, client stats, stats - assert.Len(t, requestHandlers, 3) + assert.Len(t, requestHandlers, 2) // client stats assert.Len(t, responseHandlers, 1) cfg.IsUsageDataEnabled = false diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 5bc84133db..9190dd2e03 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -15,7 +15,7 @@ const ( ) type Stats struct { - CpuPercent *float64 `json:"cpu,omitempty"` + CPUPercent *float64 `json:"cpu,omitempty"` MemoryBytes *uint64 `json:"mem,omitempty"` FileDescriptorCount *int32 `json:"fd,omitempty"` ThreadCount *int32 `json:"th,omitempty"` diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 28858ac993..50ff9f3858 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -34,7 +34,6 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo statusCodeHandler := provider.NewStatusCodeHandler(statusCodeFilter) if statusCodeEnabled { - requestHandlers = append(requestHandlers, statusCodeHandler) responseHandlers = append(responseHandlers, statusCodeHandler) statsProviders = append(statsProviders, provider.GetStatsProvider()) } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index deaaaef3c7..bc6223d986 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -49,9 +49,6 @@ func NewStatusCodeHandler(filter agent.OperationsFilter) *StatusCodeHandler { return handler } -// HandleRequest is a no-op for the StatusCodeHandler. -func (h *StatusCodeHandler) HandleRequest(ctx context.Context, _ *http.Request) {} - // HandleResponse processes the HTTP response to update status code stats. func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { operation := awsmiddleware.GetOperationName(ctx) @@ -99,7 +96,7 @@ func GetStatsProvider() agent.StatsProvider { } // Stats returns the current statistics for a given operation. -func (p *SingletonStatsProvider) Stats(operation string) agent.Stats { +func (p *SingletonStatsProvider) Stats(_ string) agent.Stats { p.mu.Lock() defer p.mu.Unlock() diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index d37902f782..9ec52f236c 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQXfs/Q5GFuLc7NUTyz//9iTANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIwNDA4MDEwM1oXDTI0MTIwNDA5MDEw -M1owFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBALOxmj9qUrnzbNku4gJOe5sBI0UKhhtM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4qJ5hc9iRk3rgGhForaFMLR +ful/Bh27EuEXrdhIcUw4fuJva3MklMqLr2/4MicZtTZIDfCHBBdyzCIkv+QAmXLH +8iUh5XukYT8jtiSI5OrYYlks4R2KPVWxKqxZjGPqzX+7Tv1vJEHQjFu3032SjuE7 +bFWadYuCg+ha9mKBXSeuAZlzo3Fk6xhRg6YOsL+nsinvift3O73Yh1nQPBBGIf8u +m+Bh3k+Ev8TvWmzbaM9HcN2nwHKATc9oQ0e/3YsHieYt7+2ZgxNGFY/3YPnOiqh3 +NhXDj+j6u6uvlcWQRPxLcpBk1rP1ZrFqE4/IKhdvKv+0H9b4TJPWAUtF1KB3A/7D +XL3uuycnTaawhibxPBzlA9ZzRU2mKUkMDCaqKMHwZmE+KH9KRn4pFsJLJvLuVTaT +1mNHvDDF/pmZyVP8EWXh+R/Xrfoj08xYxFRu0NSGp1wxLwFj/WdFmMZsX+b5 -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 04af962903..8e96664b42 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCzsZo/alK582zZ -LuICTnubASNFCoYbTF7Ci91JcARz/TC68I9LwamJja6wcQ+UTgKQQhp9J4UbuuEd -H2X1ncrf3zzETFgHoP1xoPd4NjLIrrAbXtTHh2qrcbhy8tqiBhjtBhbJSxllYIOD -H3yMksM6/04bDUooP8aOspfHO51EnXPy59S4W/IWVzvBRi/qcxoSejhvkCRroG6v -Xg9r38hpSwqQm5g5gqqHhwMkr3ojG7fVNgmWasikwTbYff/9XS3B1bOU+x3bqYNN -jP5HeNpD4GJN6EH3dKveDQItKtO812UMWg0ELtwUWBt15T28z5PANp0RNsabgKII -ZKB8VsQ5AgMBAAECggEAaanQwuN5e8CpS9hmq+aMhmwX2jxC+YBh5FIsMEe/Rpkm -c3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pqB4NLf +zpxJLVBWLbPopRHrCF39CKoA6fNsCmLSgD9FcKZ/rKMlXKhxXNWyCESV1m0zpRX9 +muqt3mhBVK7bKHXy9qC96oj75QhZIHrazrh9Hv2o9E1BxQFoaU/qvirCDU4eY79R +Ohxt8nECgYEAp+RjnbA5xMa/NN6aiXRppsvq3rRMrO6h+MuZrvmBs+DnHoCG88cz +6qIVDp9FxJRWbBHIZyOagVe2jy6RBVD+BauYJfOMuItm+98kLhhayo2+XoHqcvP+ +ktSdQaVRLm8B7HBbIZ9mPOlCQV+As042cSRmcsXYPwOjrCeUQcIdKOECgYEAkL1X +FBa4SaUzQuxNEBkoa0bK7bYspE8kabriwsZYM7CJas4MOzLc2E+XAE3mh5N99MU0 +qVQCZ7hj0xJgDU4twHe2g8Ji8Tc6OC2vdyeXjjTDMuHlXk3avqM/sguOYQycB7EE +KT5pDeTiooxYYtOP73A7g7obafeLPimktMk+keECgYBrsh+jOm99B8oMEFftQrrM +IHFmxz3R0yvLiZUfMl9vnysc0IDi6RUKjvV/oZAFyP9l++yGVKMyfXqNLQyyJfMJ +PvVLZb56t51Z0E+XzO0sLactIUg7iJWE1RPn7ryK1aqQqcUpimCE7t1AsNFfy5w6 +WwX9RR4xhXJcL6yO77D58w== -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index be9a1d5cdb..9220263fc0 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTIwNDA4MDEwN1oXDTM0MTIwNDA4MDEwN1owEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALrAg9X/yUUr -rKkjf6tYVJTgrIBJiOjy+CkwyaewzuUrQQxHE2Zn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RnXi9ZDi -v8cAAhOc8el7rUJ4BhTIeiSnH1ijSwOpnflECmYdt9UJgSNyvPApD1b7t5B/NYCp -u2BuTOlhRZYJQ91YMdVRCbkoVvMja+WI8VzBZrznhUYOqj8yMTRbICqJrQ5Lq5dT -Z7XfCY7/mo2r7suosYJswAeGxhMn6HMXCXY= +BBSxGswph9G3ktnDxaJh4RsiPgIPXzANBgkqhkiG9w0BAQsFAAOCAgEAsj4W+eIt +1GZswD8o57MNsouacXSuZk+GafM/KQ6ICvyqjgxZ/X84y088ASLgyRYNW7oRljbN +pXcoJOyEdwpo/fX+USs1eCj8CNVooghYz7YCsStyYASeptJUJBMtwG8HF47BrQa0 +MKOLbfLVATIGhZLmiJqJtxhLU6lbGr1HQhxmVMu077D91hi02cM7wsYkITlOPKKu +K9zw1Yz6C8a/x0OrbOeDKniy48N/zNkAIFtLmQhrdCck7aikjNmsGMzic4jvMIEA +dbyoWqnIM64evpp8rocS1dYvulKZjBkvuQNLlBdJxjWnr6tpXVGUGLABfEPNrwMF +Ik/HpScrvzWdRcQ97Qs2IQH4I1uq0j+FgrY21IB1+0JrZFz0c7AeWPOAYJryai32 +tPI7JE/CpkBYAVIt3BIhgGxBoteyxnIcpsJT2bID0/JdVpUilrPAAS5p/8EFWCNd +ubzXn02Zo1ROwrSZkI9kYH6/KAitkcWS92mwmrhbnBJD8+oxOWqIFjEJIi8JqpHn +qpnLwJVbZlU/TwPChwa3D1+5GxUTUFS8ZNIR1gji2RtxW2YkdsGFqEIhx0OHOFlZ +vNx3JG47MEoCfWqID+T3kl0dU3E77ky6G5iVtAJ9Rg5x4Wfd3o/eus/++Rvk2rA/ +n2OwLW67dIPTfXyxgv+cnMZ/KqhY0Nnd2Pg= -----END CERTIFICATE----- diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 8d34c751d7..6ca755341f 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -31,22 +31,22 @@ var ( ) type translator struct { - name string - operations []string - isUsageDataEnabled bool - factory extension.Factory - statuscodeonly bool + name string + operations []string + isUsageDataEnabled bool + factory extension.Factory + isStatusCodeEnabled bool } var _ common.Translator[component.Config] = (*translator)(nil) func NewTranslatorWithStatusCode(name component.DataType, operations []string, statuscodeonly bool) common.Translator[component.Config] { return &translator{ - name: name.String(), - operations: operations, - factory: agenthealth.NewFactory(), - isUsageDataEnabled: envconfig.IsUsageDataEnabled(), - statuscodeonly: statuscodeonly, + name: name.String(), + operations: operations, + factory: agenthealth.NewFactory(), + isUsageDataEnabled: envconfig.IsUsageDataEnabled(), + isStatusCodeEnabled: statuscodeonly, } } @@ -70,7 +70,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) { if usageData, ok := common.GetBool(conf, common.ConfigKey(common.AgentKey, usageDataKey)); ok { cfg.IsUsageDataEnabled = cfg.IsUsageDataEnabled && usageData } - cfg.IsStatusCodeEnabled = t.statuscodeonly + cfg.IsStatusCodeEnabled = t.isStatusCodeEnabled cfg.Stats = &agent.StatsConfig{ Operations: t.operations, UsageFlags: map[agent.Flag]any{ From cd78e5ec3d6ea584cafe28c70f78d7b8e5eb7df6 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 4 Dec 2024 03:35:11 -0500 Subject: [PATCH 53/91] fixing issue --- .golangci.yml | 2 +- .../agenthealth/handler/stats/agent/agent.go | 2 +- internal/tls/testdata/server.crt | 44 ++++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- 5 files changed, 75 insertions(+), 75 deletions(-) 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/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 9190dd2e03..5bc84133db 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -15,7 +15,7 @@ const ( ) type Stats struct { - CPUPercent *float64 `json:"cpu,omitempty"` + CpuPercent *float64 `json:"cpu,omitempty"` MemoryBytes *uint64 `json:"mem,omitempty"` FileDescriptorCount *int32 `json:"fd,omitempty"` ThreadCount *int32 `json:"th,omitempty"` diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 9ec52f236c..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGTCCAgGgAwIBAgIRALga8S14PvM8VOWrduv9pOcwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHUm9vdCBDQTAeFw0yNDEyMDQwODE1NTJaFw0yNDEyMDQwOTE1 -NTJaMBUxEzARBgNVBAoTCkt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQC8T8FGMSQm82McUNXH+U8NfCeC2weWPk9O+WVswxLzosJSBIld -akSu1jbsi1Q/Pt3g4C7NI2k4B2KnaanezG216oivI4W0XkDNOC0Bcyw+2k+CSsYE -DnRuLiqwS6JgaM7Q3tdxBDQYwiaaqEeH3ceVh3c4liYbG0ykIYEd1fVA/QxEz4sR -JxKoTacNCO3RkRExL1S19o6v4vZdcPuVsXUHFCqP0/bcGxLLx4DeWu9WbtyLPuWZ -0ZAC9dutwhMo/89pGkEcQeg3HzCCIknN7eCOWqKF9BhfFLptAMlrj2/A4+2Pj3Wx -mpj+vROe0FuZfwBSNMdzJxIKUij3l/L+qMKVAgMBAAGjZzBlMA4GA1UdDwEB/wQE -AwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQY -MBaAFGiuvIrLZnXorDTXYmJeMCiNoeSIMA8GA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HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 8e96664b42..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC8T8FGMSQm82Mc -UNXH+U8NfCeC2weWPk9O+WVswxLzosJSBIldakSu1jbsi1Q/Pt3g4C7NI2k4B2Kn -aanezG216oivI4W0XkDNOC0Bcyw+2k+CSsYEDnRuLiqwS6JgaM7Q3tdxBDQYwiaa -qEeH3ceVh3c4liYbG0ykIYEd1fVA/QxEz4sRJxKoTacNCO3RkRExL1S19o6v4vZd -cPuVsXUHFCqP0/bcGxLLx4DeWu9WbtyLPuWZ0ZAC9dutwhMo/89pGkEcQeg3HzCC -IknN7eCOWqKF9BhfFLptAMlrj2/A4+2Pj3Wxmpj+vROe0FuZfwBSNMdzJxIKUij3 -l/L+qMKVAgMBAAECgf9ywCcGnuto0OeUWa3sLf/+N6ncE5yL8Wxis5car8TcslG3 -qQwL4LX51I+jlUPBRo3ueq4KU4nKmrWDTuA05F32fPTNxNe1EbprU9AZEhXkNyQ8 -QVRpJGXOvlNFGtHX7gYZQbIHLIiSjbz4gZMVOBBnDiWYVebincAWRFRp2feZoY34 -i7XPCtA7qsEsMpANNkRVNT287pmIqCJAkUqOB1P5hxLXi9xMdYOCre/eJtevwnhp -jAtrtrHDC1xCTSxoJjMZOhYN+3GDOjqKRmfux1Nd5cO7Tj0LCPv5WYf0ZuehivD7 -EiSJk6JAi04XHG01KTxC6wZ5J7wkpZls6ERriQECgYEA5eIyEq0S+1bAm5Cpp4JO -RrckIIOtK1GtHeVQSKvBFnpC1N4vFvecqARywssuMFGc0eAwkbbXa7WBeGPIT5ik -bT8D0P7x0PoMyims+giw0K3wEBb7cp7WO5PrEUHdn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YDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 9220263fc0..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTIwNDA4MTU1N1oXDTM0MTIwNDA4MTU1N1owEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMg+wco5sO07 -d4hHUCK0J5zIGO7ko7sr3qYOR2HnfF2BRh0kVTkcmIIXaFsjfKWIKGDTi5hYeMWG -A8HMvznqJEeDwEqurgpK/LmR1x7x6VkZFXv7KE3mJTxceBg36xzyi9+AFbdFYmRT -z0hKGsxFQsbtJJZTIw5QZ8mssC6c4Sph8G4G4xthBOK6x3VA9sudlGyLEr3O9QId -Gz2s+izeas8Th6RvgYDM6PwKo5pMBOpMZsa1QDwkSH4090OKJh8gNmVpzekaJfnJ -9AXPMTRb6TWKUbJFR7ZNfndd/yGXshztFwF+ZYUuLCb8LT2FcMeW/Pa1/sZOfVk1 -HUDRABXffctLRLvwjB07JYWHq/ZClBiBLP3fu7QJWY07dgIJkNUEYDah0d7afj4m -RlHdsP7qjQu0jKGd3mCk0BXEBdaVs13GzQ6gLoEJN3pOxZxs9SVrlpBJ9iybSDAc -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FvxElrkoyBz5LGF6HVdIVYUO94 +1DW1egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From aff4bc5de9f2da63d1b17577c1906c990d43af8f Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 4 Dec 2024 03:40:05 -0500 Subject: [PATCH 54/91] fixing lint --- .../agenthealth/handler/stats/agent/agent.go | 6 ++--- .../handler/stats/agent/agent_test.go | 22 +++++++++---------- .../agenthealth/handler/stats/handler_test.go | 2 +- .../handler/stats/provider/process.go | 2 +- .../handler/stats/provider/process_test.go | 6 ++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 5bc84133db..de52ab8ae6 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -15,7 +15,7 @@ const ( ) type Stats struct { - CpuPercent *float64 `json:"cpu,omitempty"` + CPUPercent *float64 `json:"cpu,omitempty"` MemoryBytes *uint64 `json:"mem,omitempty"` FileDescriptorCount *int32 `json:"fd,omitempty"` ThreadCount *int32 `json:"th,omitempty"` @@ -36,8 +36,8 @@ type Stats struct { // 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 diff --git a/extension/agenthealth/handler/stats/agent/agent_test.go b/extension/agenthealth/handler/stats/agent/agent_test.go index f88ba822eb..b53f8787d8 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) @@ -109,15 +109,15 @@ func TestMarshalWithStatusCodes(t *testing.T) { func TestMergeFullWithStatusCodes(t *testing.T) { stats := &Stats{ - CpuPercent: aws.Float64(1.0), + CPUPercent: aws.Float64(1.0), StatusCodes: map[string][5]int{"operation1": {1, 0, 0, 0, 0}}, } stats.Merge(Stats{ - CpuPercent: aws.Float64(2.0), + 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, 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"]) } @@ -133,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), @@ -142,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_test.go b/extension/agenthealth/handler/stats/handler_test.go index 108c6aa120..c677524838 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -49,7 +49,7 @@ func TestStatsHandler(t *testing.T) { 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), }, 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 8ab3382271..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) @@ -82,7 +82,7 @@ func TestProcessStats(t *testing.T) { } func isAgentStatsReset(stats agent.Stats) bool { - return stats.CpuPercent == nil && + return stats.CPUPercent == nil && stats.MemoryBytes == nil && stats.FileDescriptorCount == nil && stats.ThreadCount == nil && From 7d31af3d506cdfe3a3be69676c2d8d42fed9d8e8 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 4 Dec 2024 12:46:02 -0500 Subject: [PATCH 55/91] fixing make test --- .../agenthealth/handler/stats/agent/agent.go | 9 ---- .../agenthealth/handler/stats/handler_test.go | 4 +- internal/tls/testdata/server.crt | 44 ++++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- 5 files changed, 75 insertions(+), 84 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index de52ab8ae6..7abc180810 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -164,12 +164,3 @@ func NewStatusCodeOperationsFilter() OperationsFilter { allowAll: false, } } - -func NewStatusCodeAndOtherOperationsFilter(operations []string) OperationsFilter { - filter := NewStatusCodeOperationsFilter() - for _, operation := range operations { - filter.operations.Add(operation) - } - - return filter -} diff --git a/extension/agenthealth/handler/stats/handler_test.go b/extension/agenthealth/handler/stats/handler_test.go index c677524838..f96604bded 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -72,7 +72,7 @@ func TestStatsHandler(t *testing.T) { func TestNewHandlersWithStatusCodeOnly(t *testing.T) { requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, false) - assert.Len(t, requestHandlers, 2) + assert.Len(t, requestHandlers, 1) assert.Len(t, responseHandlers, 1) } func TestNewHandlersWithAgentStatsOnly(t *testing.T) { @@ -83,7 +83,7 @@ func TestNewHandlersWithAgentStatsOnly(t *testing.T) { func TestNewHandlersWithStatusCodeAndAgenthStats(t *testing.T) { requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, true) - assert.Len(t, requestHandlers, 3) + assert.Len(t, requestHandlers, 2) assert.Len(t, responseHandlers, 2) } func TestNewHandlersWithoutStatusCodeAndAgenthStats(t *testing.T) { diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..4f960e1a7a 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETM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vNZ4i4U+kprch6FC2Tzb3QHnit88eXdC4wneHXlojClj2pS8puL0MJj3blvctGa +KNyKkLJrgZQ88JcovDkHka5/+X0zt8YKs5Cx3F+ZK98FQ317dp6sOEtbbJL3USB3 +jhwY6dp5RWofWO8ynBFEHVVbLR6IXX9vVXGeeeEVsRv0JFP4dh3FGlI+1L8+FWwU +Z4i5R1aVOz8GBpHZRfQ54PngYHFME+wkleEpqoUoSqa4r67ZleqTwfgkrj2ZTi8c +WDuhVzLVkP1IWkhPOiMd/Z0ic/sLpkNivKKbYfaX/X3rrvjvMwo6ZsaLNGjJpr5A +OsE9RkeDoFqDd1nxIBh5JVfReEThwo03PB2YWohtNY7fapy24TK9QcPJ5T17wWGl +m3E1k2cFmS6TEkDblbtAz4wt8gm5ytbO09eB9PJ9sQ2tQj0wp57YHScuOl0vCNu/ +vYgQmmC47aKYr1qE5XPEwpNZFSNgZIfaGkUP9lkd3bfK/bfOKvZoPtnRqdjcciRB +KO9mhE/1ZafE0pV072Qgyyr3AuYK3WnFZqwhb3FV4BCWTMZR6rzZYR92cHr+ -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..dce0e32c83 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7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RaqP/pfjN +JznILqIXmjauyQBJoAMtJEamHmeQL0FHEX67fBtXL8/kVf1/AaoW7uJrpNuHdRq1 +7STW4uCbDob0tBMIUajw0cTDqwKBgQDasIIWpJWJosnyt0SfBUXsMboXz069a4oc +rBEyRbJAVxWvUMOmw2dIVbBJmytcnvAk6zQEc5AH0NpLB4pNSTNZLMYPGBStPCpw +ZkX3iZoPMb9GSqJvwdSex9tiIYSU2FZnJ+GjsMWFZeDOJMFiElDMWWSHHGaHpMew +LjHwvXOGDQKBgDPDcz3JpHvG0x1G53weMyUQc5gdZVyjLwN4Ty5t8hXFhHzbCP5b +rKRpJlFRGz0bluGbFhaadFXCCXMren5Arish4EJCL/9M3XkAu6+m20AZDJtDsOvg +jOTJIkyOoS036DXTHF6yK25Amk21cfnrYwR6seqqp2UwfKwmGTBV4aHvAoGBAIo9 +kb5mg/Dhau93UnWDi9PnC1AJyCiNVl0RmD1DOY7afea5EzTTyPI82Jdu81Y1UnDE +DbnSo3WNXLCZL5/zafYxC3J3Mnrf0aQDwq7b2PtJ4zO38j7bNGC6zb+WmIzOxK+o +0kX7dKEC6bzmFyi7kz/aMmYGWfnc/C4uxXr9B43xAoGBALXEc0rLPpxYkF6hxGW3 +YYBosIaHnXElbGNyb5jB0808uvrVQSQQObS3yiOklTLjJjq0Gng5w+PKnr4G3xLP +GxZiUZ50BkIHgxRMe0rhgkk0ZW0qb5NYl9dZaSsdRmpLMjmvBClQwnCQEpODqOye +M1xHboxqZMMIYscxdDw92cQo -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..aa522cebf2 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAy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From aed19c9511d27ab2531a597718d726eb9c9da286 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 4 Dec 2024 12:47:57 -0500 Subject: [PATCH 56/91] restoring internal folder --- internal/tls/testdata/server.crt | 44 +++++++++++++-------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 4f960e1a7a..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGTCCAgGgAwIBAgIRALFOAKic4NoZZ2tZfBBvUVIwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHUm9vdCBDQTAeFw0yNDEyMDQxNzQyMjZaFw0yNDEyMDQxODQy -MjZaMBUxEzARBgNVBAoTCkt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQCsjRn8VeyaJYSlo/51y5jl0rnQ5Z1mFui54oxWrVKQUNvJKNcY -xe4jhAjvJTdcY2SqJQRXAstvc8oYd+NUHC88QtO8bPmOUZP7vbVf6hfGkgtqg8uy -v9nq7SJYxoqm4pdzUPKJUljPWVfGk1F/8uRRou/7nHJzQzLdQVNdHG5lQexp1ROW -LFp+sW+mO6QjdFyPZpGbW1SgBYAR9wU03GEI0U8b+VvebXrV7pjyipjGwRda2YEV -8S7bD7bMZYuh6azcpwBQ821pqmLSyewqeEn9xryY09iTxCak/CywzMgkIA2f+WWe -KV8wWmz5597o/t+thw6Dqjw5c+RFTTDKOnGvAgMBAAGjZzBlMA4GA1UdDwEB/wQE -AwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQY -MBaAFEWCNiG6a52Y96mE3lvt0v0YvgJ/MA8GA1UdEQQIMAaHBH8AAAEw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OOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index dce0e32c83..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCsjRn8VeyaJYSl -o/51y5jl0rnQ5Z1mFui54oxWrVKQUNvJKNcYxe4jhAjvJTdcY2SqJQRXAstvc8oY -d+NUHC88QtO8bPmOUZP7vbVf6hfGkgtqg8uyv9nq7SJYxoqm4pdzUPKJUljPWVfG -k1F/8uRRou/7nHJzQzLdQVNdHG5lQexp1ROWLFp+sW+mO6QjdFyPZpGbW1SgBYAR -9wU03GEI0U8b+VvebXrV7pjyipjGwRda2YEV8S7bD7bMZYuh6azcpwBQ821pqmLS -yewqeEn9xryY09iTxCak/CywzMgkIA2f+WWeKV8wWmz5597o/t+thw6Dqjw5c+RF -TTDKOnGvAgMBAAECggEAPLzqYb1pLJV6TMgeQR6qsnNrvxGkRxRXVV9eoQAfqPcd -doCuvmSlv9CxSGTkSNwfyhh/n5U3QQMUJ2rEFY5aPi8T0ybU7Xjfy2Rq3NlNBzPP -Wu4LnN8VeTGBvpgcpEPspcXfqeDXrB053Ydrz8sS/X2KVhoq21HTLLja/FKOtYtb -9NCXZpuDkFSsKpyFI/gGCWk0PQZ29ezexve34RTcQq9mfTg/yM8aqOg7F2IJrmm7 -vkDyicbVPHb3BSQWTiIWBSe3eLaWcLbTFzFZhwzgZAF+AnPqnY/XEWvWwctamAEF -/xT5dN7gg9NTTRa4LOqG4SMga9f8/rVMCBOFujK3GQKBgQDJ/XRdqgkjAHSjXu1v -T+fnyd5C7iSVNASNYV1Xhm6/p6COa30eFXoUXGl0pKD+9fxEvmgC0BtRaqP/pfjN -JznILqIXmjauyQBJoAMtJEamHmeQL0FHEX67fBtXL8/kVf1/AaoW7uJrpNuHdRq1 -7STW4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Lej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index aa522cebf2..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTIwNDE3NDIzMFoXDTM0MTIwNDE3NDIzMFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAM1Eod6afYyZ -QOhrsQ8IE4a8ubgysjd/gLQ80NNO2BohGiM8VLa35JscWhOxVivELEleDA3jFXhX -ex+VYAFqsPPO4fvBZ1lbZMKDUvBrWGMQgQxHvQLrLqt1/I9RLzGg1Gs6WWW4jcQK -jSav4GBXp3TrJDO3u5nayzmojzirpZ1AOGwjmV8W8jIwBt/VXSSz3NUDummQqnur -4kZhWoaVCD5/f3FzEL1FpEL6ToZxLiCgZ+fEy4xdWV7zp02rW7H19h9mHcqYLo4B -jOFUvr5kQMgAT0hgMxud2wTz+QvWRJzkyb7RSSnH0f1jQlsE6s7NSYkx9h1iblyK -ytyjAIXSlwLY2h2MlaAGNAy4N6S78rf4+6nYSIKTtSXkQyswQkEXwRaOOBh2jmiU -aXNC8CPuDFG/k0WmoY+M9iZyUAQKR/WD6ktjuMvPAmgMo6Lnh1mtVFToaLg4+l1Y -sKuhxth0a/3b65f9B1F8ip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egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From 6ee61b544ef0dd75d3f41e0ac95d4277a175cdf6 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 4 Dec 2024 12:53:15 -0500 Subject: [PATCH 57/91] adding Describe Tasts --- extension/agenthealth/handler/stats/agent/agent.go | 1 + extension/agenthealth/handler/stats/provider/statuscode.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 7abc180810..e2e9bc50d4 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -130,6 +130,7 @@ func (of OperationsFilter) IsAllowed(operationName string) bool { var StatusCodeOperations = []string{ // all the operations that are allowed "DescribeInstances", "DescribeTags", + "DescribeTasks", "DescribeVolumes", "DescribeContainerInstances", "DescribeServices", diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index bc6223d986..7c45ea4c99 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -155,7 +155,7 @@ func GetShortOperationName(operation string) string { case "DescribeInstances": return "di" case "DescribeTasks": - return "dt" + return "dts" case "DescribeTags": return "dt" case "DescribeVolumes": From a8ee7e3099bd645d4c93a863659af1ee29e80eae Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 00:25:50 -0500 Subject: [PATCH 58/91] adding to api status codes --- extension/agenthealth/factory.go | 6 +- .../agenthealth/handler/stats/agent/agent.go | 8 +- .../agenthealth/handler/stats/handler.go | 21 +- .../handler/stats/provider/statuscode.go | 241 ++++++++++-------- 4 files changed, 154 insertions(+), 122 deletions(-) diff --git a/extension/agenthealth/factory.go b/extension/agenthealth/factory.go index 0059eb3c67..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/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index e2e9bc50d4..337f4fc3ab 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -128,6 +128,7 @@ func (of OperationsFilter) IsAllowed(operationName string) bool { } var StatusCodeOperations = []string{ // all the operations that are allowed + "PutRetentionPolicy", "DescribeInstances", "DescribeTags", "DescribeTasks", @@ -158,10 +159,5 @@ func NewOperationsFilter(operations ...string) OperationsFilter { // NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. func NewStatusCodeOperationsFilter() OperationsFilter { - allowed := make(map[string]struct{}, len(StatusCodeOperations)) - - return OperationsFilter{ - operations: allowed, - allowAll: false, - } + return NewOperationsFilter(StatusCodeOperations...) } diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 50ff9f3858..257f06e2af 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -30,26 +30,31 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo return nil, nil } - statusCodeFilter := agent.NewStatusCodeOperationsFilter() - statusCodeHandler := provider.NewStatusCodeHandler(statusCodeFilter) - + // Create and configure the StatusCodeHandler if enabled if statusCodeEnabled { + statusCodeFilter := agent.NewStatusCodeOperationsFilter() + statusCodeStatsProvider := provider.GetStatsProvider(statusCodeFilter) + statusCodeHandler := provider.NewStatusCodeHandler(statusCodeStatsProvider) + + // Add StatusCodeHandler to handlers + requestHandlers = append(requestHandlers, statusCodeHandler) responseHandlers = append(responseHandlers, statusCodeHandler) - statsProviders = append(statsProviders, provider.GetStatsProvider()) + statsProviders = append(statsProviders, statusCodeStatsProvider) } + // Create and configure the clientStats handler if agentStatsEnabled if agentStatsEnabled { clientStats := client.NewHandler(agent.NewOperationsFilter()) statsProviders = append(statsProviders, clientStats, provider.GetProcessStats(), provider.GetFlagsStats()) responseHandlers = append(responseHandlers, clientStats) - requestHandlers = append(requestHandlers, clientStats) + filter := agent.NewOperationsFilter(cfg.Operations...) + stats := newStatsHandler(logger, filter, statsProviders) + requestHandlers = append(requestHandlers, clientStats, stats) } - filter := agent.NewOperationsFilter(cfg.Operations...) - stats := newStatsHandler(logger, filter, statsProviders) - requestHandlers = append(requestHandlers, stats) agent.UsageFlags().SetValues(cfg.UsageFlags) + return requestHandlers, responseHandlers } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 7c45ea4c99..7573194b6a 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,139 +1,106 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: MIT - package provider import ( "context" + "log" "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" + channelBufferSize = 100 ) var ( - statsProviderSingleton agent.StatsProvider - statsProviderOnce sync.Once + statusCodeProviderSingleton *StatsProvider + statsProviderOnce sync.Once ) -// SingletonStatsProvider manages a collection of statistics. -type SingletonStatsProvider struct { - mu sync.Mutex - statusCodeStats map[string][5]int -} - -// StatusCodeHandler provides monitoring for status codes per operation. -type StatusCodeHandler struct { - statsProvider *SingletonStatsProvider - filter agent.OperationsFilter - resetTimer *time.Timer - mu sync.Mutex -} - -// NewStatusCodeHandler creates a new instance of StatusCodeHandler. -func NewStatusCodeHandler(filter agent.OperationsFilter) *StatusCodeHandler { - provider := GetStatsProvider().(*SingletonStatsProvider) // Get the singleton provider. - handler := &StatusCodeHandler{ - statsProvider: provider, - filter: filter, - } - handler.startResetTimer() - return handler +// StatsProvider handles processing of status codes and maintains stats. +type StatsProvider struct { + statsByOperation map[string]*[5]int + resetTimer *time.Timer + filter agent.OperationsFilter + statusCodeChan chan statusCodeEntry + stopChan chan struct{} + mu sync.Mutex + wg sync.WaitGroup } -// HandleResponse processes the HTTP response to update status code stats. -func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { - operation := awsmiddleware.GetOperationName(ctx) - if operation == "" { - return - } else if !h.filter.IsAllowed(operation) { - return - } - - operation = GetShortOperationName(operation) - statusCode := r.StatusCode - - h.mu.Lock() - defer h.mu.Unlock() - - // Get or initialize stats - h.statsProvider.mu.Lock() - stats := h.statsProvider.statusCodeStats[operation] - h.statsProvider.mu.Unlock() - - h.updateStatusCodeCount(&stats, statusCode) - - // Update the singleton stats provider - h.statsProvider.UpdateStats(operation, stats) +// statusCodeEntry represents a status code and its associated operation. +type statusCodeEntry struct { + operation string + statusCode int } -// ID returns the unique identifier for the handler. -func (h *StatusCodeHandler) ID() string { - return statusHandlerID -} - -// Position specifies the handler's position in the middleware chain. -func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { - return awsmiddleware.After -} - -// GetStatsProvider retrieves the singleton instance of the `agent.StatsProvider`. -func GetStatsProvider() agent.StatsProvider { +// GetStatsProvider initializes and retrieves the singleton StatsProvider. +func GetStatsProvider(filter interface{}) *StatsProvider { statsProviderOnce.Do(func() { - statsProviderSingleton = &SingletonStatsProvider{ - statusCodeStats: make(map[string][5]int), + provider := &StatsProvider{ + statsByOperation: make(map[string]*[5]int), + statusCodeChan: make(chan statusCodeEntry, channelBufferSize), + stopChan: make(chan struct{}), + } + + if opsFilter, ok := filter.(agent.OperationsFilter); ok { + provider.filter = opsFilter } + provider.startResetTimer() + provider.startProcessing() + statusCodeProviderSingleton = provider }) - return statsProviderSingleton + return statusCodeProviderSingleton } -// Stats returns the current statistics for a given operation. -func (p *SingletonStatsProvider) Stats(_ string) agent.Stats { - p.mu.Lock() - defer p.mu.Unlock() - - statusCodeMap := make(map[string][5]int, len(p.statusCodeStats)) - for op, stats := range p.statusCodeStats { - statusCodeMap[op] = stats - } - - return agent.Stats{ - StatusCodes: statusCodeMap, - } +// startProcessing begins processing status codes from the channel. +func (sp *StatsProvider) startProcessing() { + sp.wg.Add(1) + go func() { + defer sp.wg.Done() + for { + select { + case entry := <-sp.statusCodeChan: + sp.processStatusCode(entry) + case <-sp.stopChan: + return + } + } + }() } -// UpdateStats updates the statistics for a given operation. -func (p *SingletonStatsProvider) UpdateStats(operation string, stats [5]int) { - p.mu.Lock() - defer p.mu.Unlock() - - p.statusCodeStats[operation] = stats +// Stop signals the StatsProvider to stop processing and waits for cleanup. +func (sp *StatsProvider) Stop() { + close(sp.stopChan) + sp.wg.Wait() } -// startResetTimer initializes a reset timer to clear stats every 5 minutes. -func (h *StatusCodeHandler) startResetTimer() { - h.resetTimer = time.AfterFunc(statusResetInterval, func() { - h.mu.Lock() - defer h.mu.Unlock() +// EnqueueStatusCode adds a status code entry to the channel. +func (sp *StatsProvider) EnqueueStatusCode(operation string, statusCode int) { + sp.statusCodeChan <- statusCodeEntry{operation: operation, statusCode: statusCode} +} - h.statsProvider.mu.Lock() - h.statsProvider.statusCodeStats = make(map[string][5]int) - h.statsProvider.mu.Unlock() +// processStatusCode updates the stats map for the given status code entry. +func (sp *StatsProvider) processStatusCode(entry statusCodeEntry) { + sp.mu.Lock() + defer sp.mu.Unlock() - h.startResetTimer() - }) + stats, exists := sp.statsByOperation[entry.operation] + if !exists { + stats = &[5]int{} + sp.statsByOperation[entry.operation] = stats + } + sp.updateStatusCodeCount(stats, entry.statusCode) } -// updateStatusCodeCount updates the count for a given status code. -func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int) { +// updateStatusCodeCount updates the count for the specific status code. +func (sp *StatsProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { + log.Printf("Updating stats for status code: %d\n", statusCode) switch statusCode { case 200: stats[0]++ @@ -145,17 +112,69 @@ func (h *StatusCodeHandler) updateStatusCodeCount(stats *[5]int, statusCode int) stats[3]++ case 429: stats[4]++ + default: + log.Printf("Ignored status code: %d\n", statusCode) + } +} + +// startResetTimer initializes a reset timer to clear stats periodically. +func (sp *StatsProvider) startResetTimer() { + log.Println("Starting stats reset timer...") + sp.resetTimer = time.AfterFunc(statusResetInterval, func() { + sp.mu.Lock() + defer sp.mu.Unlock() + log.Println("Resetting stats...") + for key := range sp.statsByOperation { + delete(sp.statsByOperation, key) + } + sp.startResetTimer() + }) +} + +// StatusCodeHandler is the handler that uses the StatsProvider for processing. +type StatusCodeHandler struct { + statsProvider *StatsProvider +} + +func (h *StatusCodeHandler) ID() string { + return statusHandlerID +} + +func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { + return awsmiddleware.After +} + +// NewStatusCodeHandler creates a new handler with the given StatsProvider. +func NewStatusCodeHandler(provider *StatsProvider) *StatusCodeHandler { + log.Println("Creating new StatusCodeHandler...") + return &StatusCodeHandler{statsProvider: provider} +} + +// HandleRequest is a no-op for the StatusCodeHandler. +func (h *StatusCodeHandler) HandleRequest(ctx context.Context, _ *http.Request) {} + +// HandleResponse enqueues the status code into the StatsProvider's channel. +func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { + operation := awsmiddleware.GetOperationName(ctx) + if !h.statsProvider.filter.IsAllowed(operation) { + return } + + operation = GetShortOperationName(operation) + if operation == "" { + return + } + + h.statsProvider.EnqueueStatusCode(operation, r.StatusCode) } +// GetShortOperationName maps long operation names to short ones. func GetShortOperationName(operation string) string { switch operation { - case "PutRetentionPolicy": - return "prp" + case "PutMetricData": + return "pmd" case "DescribeInstances": return "di" - case "DescribeTasks": - return "dts" case "DescribeTags": return "dt" case "DescribeVolumes": @@ -174,7 +193,23 @@ func GetShortOperationName(operation string) string { return "clg" case "CreateLogStream": return "cls" + case "AssumeRole": + return "ar" default: return "" } } + +// Stats returns the aggregated stats for operations. +func (sp *StatsProvider) Stats(operation string) agent.Stats { + sp.mu.Lock() + defer sp.mu.Unlock() + + statusCodeMap := make(map[string][5]int) + for op, stats := range sp.statsByOperation { + statusCodeMap[op] = *stats + } + return agent.Stats{ + StatusCodes: statusCodeMap, + } +} From 18872303d31345b0f060c79fd835e37e5baf6e43 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 00:52:22 -0500 Subject: [PATCH 59/91] fixing unit tests --- extension/agenthealth/config_test.go | 2 +- extension/agenthealth/factory_test.go | 4 +- .../agenthealth/handler/stats/handler.go | 6 +- .../agenthealth/handler/stats/handler_test.go | 2 +- .../handler/stats/provider/statuscode_test.go | 86 ++++++++----------- internal/tls/testdata/server.crt | 40 ++++----- internal/tls/testdata/server.key | 52 +++++------ internal/tls/testdata/tls-ca.crt | 50 +++++------ 8 files changed, 113 insertions(+), 129 deletions(-) diff --git a/extension/agenthealth/config_test.go b/extension/agenthealth/config_test.go index 0e97928ae7..967c681619 100644 --- a/extension/agenthealth/config_test.go +++ b/extension/agenthealth/config_test.go @@ -26,7 +26,7 @@ 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"), diff --git a/extension/agenthealth/factory_test.go b/extension/agenthealth/factory_test.go index 8081a0f06e..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/handler.go b/extension/agenthealth/handler/stats/handler.go index 257f06e2af..3a973278e2 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -30,21 +30,18 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo return nil, nil } - // Create and configure the StatusCodeHandler if enabled if statusCodeEnabled { statusCodeFilter := agent.NewStatusCodeOperationsFilter() statusCodeStatsProvider := provider.GetStatsProvider(statusCodeFilter) statusCodeHandler := provider.NewStatusCodeHandler(statusCodeStatsProvider) - // Add StatusCodeHandler to handlers requestHandlers = append(requestHandlers, statusCodeHandler) responseHandlers = append(responseHandlers, statusCodeHandler) statsProviders = append(statsProviders, statusCodeStatsProvider) } - // Create and configure the clientStats handler if agentStatsEnabled if agentStatsEnabled { - clientStats := client.NewHandler(agent.NewOperationsFilter()) + clientStats := client.NewHandler(agent.NewOperationsFilter(cfg.Operations...)) statsProviders = append(statsProviders, clientStats, provider.GetProcessStats(), provider.GetFlagsStats()) responseHandlers = append(responseHandlers, clientStats) filter := agent.NewOperationsFilter(cfg.Operations...) @@ -54,7 +51,6 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo } agent.UsageFlags().SetValues(cfg.UsageFlags) - return requestHandlers, responseHandlers } diff --git a/extension/agenthealth/handler/stats/handler_test.go b/extension/agenthealth/handler/stats/handler_test.go index f96604bded..b1e9d175d0 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -83,7 +83,7 @@ func TestNewHandlersWithAgentStatsOnly(t *testing.T) { func TestNewHandlersWithStatusCodeAndAgenthStats(t *testing.T) { requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, true) - assert.Len(t, requestHandlers, 2) + assert.Len(t, requestHandlers, 3) assert.Len(t, responseHandlers, 2) } func TestNewHandlersWithoutStatusCodeAndAgenthStats(t *testing.T) { diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index b2672bab40..3eeec108c9 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -1,65 +1,55 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: MIT - -package provider +package provider_test import ( - "reflect" + "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" "testing" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" + "github.com/stretchr/testify/assert" + "go.uber.org/zap" ) -func TestSingletonStatsProvider_Stats(t *testing.T) { - provider := &SingletonStatsProvider{ - statusCodeStats: map[string][5]int{ - "operation1": {1, 2, 3, 4, 5}, - }, +func TestNewHandlers(t *testing.T) { + logger := zap.NewNop() // Use a no-op logger for testing + cfg := agent.StatsConfig{ + Operations: []string{"TestOperation"}, } - stats := provider.Stats("operation1") + t.Run("Only StatusCodeEnabled", func(t *testing.T) { + requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, true, false) - expected := agent.Stats{ - StatusCodes: map[string][5]int{ - "operation1": {1, 2, 3, 4, 5}, - }, - } + assert.NotNil(t, requestHandlers, "Request handlers should not be nil") + assert.NotNil(t, responseHandlers, "Response handlers should not be nil") + assert.Len(t, requestHandlers, 1, "There should be 2 request handlers") + assert.Len(t, responseHandlers, 1, "There should be 1 response handler") - if !reflect.DeepEqual(stats, expected) { - t.Errorf("Stats() failed. Got %+v, expected %+v", stats, expected) - } -} + assert.IsType(t, &provider.StatusCodeHandler{}, requestHandlers[0], "First handler should be StatusCodeHandler") + assert.IsType(t, &provider.StatusCodeHandler{}, responseHandlers[0], "First response handler should be StatusCodeHandler") + }) -func TestSingletonStatsProvider_UpdateStats(t *testing.T) { - provider := &SingletonStatsProvider{ - statusCodeStats: make(map[string][5]int), - } + t.Run("Only AgentStatsEnabled", func(t *testing.T) { + requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, false, true) - provider.UpdateStats("operation1", [5]int{1, 0, 0, 0, 0}) + 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") + }) - expected := map[string][5]int{ - "operation1": {1, 0, 0, 0, 0}, - } + t.Run("Both Enabled", func(t *testing.T) { + requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, true, true) - if !reflect.DeepEqual(provider.statusCodeStats, expected) { - t.Errorf("UpdateStats() failed. Got %+v, expected %+v", provider.statusCodeStats, expected) - } -} + 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), 3, "There should be at least 3 request handlers") + assert.GreaterOrEqual(t, len(responseHandlers), 2, "There should be at least 2 response handlers") + }) -func TestGetShortOperationName(t *testing.T) { - tests := []struct { - input string - expected string - }{ - {"PutRetentionPolicy", "prp"}, - {"DescribeInstances", "di"}, - {"UnknownOperation", ""}, - } + t.Run("Neither Enabled", func(t *testing.T) { + requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, false, false) - for _, test := range tests { - result := GetShortOperationName(test.input) - if result != test.expected { - t.Errorf("GetShortOperationName(%q) = %q; want %q", test.input, result, test.expected) - } - } + assert.Nil(t, requestHandlers, "Request handlers should be nil") + assert.Nil(t, responseHandlers, "Response handlers should be nil") + }) } diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..40c7b27697 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz +MIIEGDCCAgCgAwIBAgIQdfJOpHZSt+MsUZNXVHJ2YzANBgkqhkiG9w0BAQsFADAS +MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIwNTA1NDgwNloXDTI0MTIwNTA2NDgw NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOo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ZXKn39guR5LrJrlZsZJHtotizhkLAgKbA9EA96BrLGQNHK +Ksck0nUOIvKyjbrNX0f5+sR64SKJPjarDCw3zuVtMTq0W3m5FxJVhVTsacZQtrjn +k39mpKCiIYVVHaP4uNxg4OK6fZcEijzs/AMhSTSRITmYRgNrDrIuE2mHrodSEK4g +sdMgVruAfluMzVYlSTzHSUt+OWPieSD/6+zOLdcKpboCjKSQdkjUqyWWVRs= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..0f8ca44127 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHnes3zGkEYMzkjw3NOtkEzgxwdiJEoV -WQHi4eznAgMBAAECggEAGv7z1O32jXc+ouG40NewNVmXQRW0NMQ0w4Vn6UYZNXlj -BWjQJaVquCQAhEMUkDBma9jnHM7dZ5obie0+Joa5p/6Mu6M2oSR1IVx7Myq284Jk -1Ys/w7u5ESYf33pWmqiGQlbpSxamXvLoWaM7OT5veilRlkgjqiAmerj9EceRP5mR -aheVE5ctY5oZmdnvA9OcN6B8Oxk59EWEOECs8qAF/ChYfC8pWKOp4U0RILQ/9jXD -lu4p0C2XyadrJReer3whudUADWa/WSxgVCrx85/g/RTKs38KTPy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ZcNDUsLE5WeVhL2XdhyrGuCouXafNg7S7HXcnsED57v8Mfw1Vv +QXxbP6kL9u1Fn1hxXr9A653DjD25zJXvB3TW1m7uACU0Dik2o55gDY8OoQKBgGKr +5HOuyfsuyg6ZogES/RJw0oNEu7eMXyrohXh+1A81HkZthEGCfAVhPMRpA6VZpBiF +nHP5DVhGWhaxKTcN6pnEj55wjdNtt+1ZG7Chov0TgFAW820NQmhBZhqK4iFD6Gjd +qEH/MChKIIC7kKwNrkd5PlV8PZyzsZJIWgb1hKCRAoGAdyhDCA7GKtNJAPFhE79p +lxWY6age/ICqhjvq6ij1e9BVE6N0pWZOUZQJYTseJCkq8hVoQCZ2116n8EmbEm4S +PaWzFCCkfxIP3xoNG/YrgkbdAq2bOSjy3C6u7I3r9xVGYp2+bF7eg3e6CcHWiQtC +vee/A/uMi9Be4PF6N3j5d4Q= -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..55818f1de9 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rMPbR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ph/WFqXEyoSIBKTANBgkqhkiG9w0BAQsFAAOCAgEAqkINErHB +bGV6Ct/wbOVhN8rf2FBJ1WoJ+YXXwKEDmEm1r1P4GMMUTLTjCXmVNj8HW7VcyY6v +3Lv7qkrNWRotBrRxvO5cA35/j78H/bLWdqH5wiDPGxSZS5HjrMiztNlyLbB+hJWS +sp0hGv3AHkQ+kje5RDhyDV9o2s+4niyMILIcxZs4QAQqjPV5NV2mNxGMsMzn4YZM +YlPRg9cH7eOc/NmKVukzsJYa5NcLy04xwqLzPJDrZA7r1NUsyxPQCHJWYbUi+oTZ +cmY6XYPVQfNMMHXT23LFpl5bH3LBwk8gmhKAs3Mj/FK7Bi5dn8syusWBJOdU2aR3 +rDiX2GvqPYyNabnYIIFlag1TImeDPFa9w2Kojovn5VhZOF/7foGqlbXkNEBNtGtw +LGd7t1+/g1bVzElS8uOJUYXonTxGs1OIeLbnhAi18gW5lYJbvf4edLdoaH50LpQq +in6el1VVELasudJ4hbYs0DU9Bnisxbw306GdTL0+A8SAZvSfiWV7fvbPX3+l7F7E +quuVNGqhVrjB/RC6F48SkXYizWAhhAutVcthPk9rXl2UyM+mtvb3XIIlQMET96HU +6p6UWyJN5QXc8g1ssCLLomH15Hnmx21jPUdBwz35l/QJWxNwF+laCSMhftU52KD6 +Dd8vSMqTu3jdUsvMb+/v0CFu2pwYziYGaZw= -----END CERTIFICATE----- From 1e31fb5cd6e90acaf8c502a14849460216236ebe Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 10:54:43 -0500 Subject: [PATCH 60/91] restring files and fixing lint --- .../agenthealth/handler/stats/handler.go | 1 - .../handler/stats/provider/statuscode.go | 9 ++-- .../handler/stats/provider/statuscode_test.go | 10 ++-- internal/tls/testdata/server.crt | 40 +++++++------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- 6 files changed, 83 insertions(+), 79 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 3a973278e2..b1bd4740e3 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -35,7 +35,6 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo statusCodeStatsProvider := provider.GetStatsProvider(statusCodeFilter) statusCodeHandler := provider.NewStatusCodeHandler(statusCodeStatsProvider) - requestHandlers = append(requestHandlers, statusCodeHandler) responseHandlers = append(responseHandlers, statusCodeHandler) statsProviders = append(statsProviders, statusCodeStatsProvider) } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 7573194b6a..38f96ebd89 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider import ( @@ -8,6 +11,7 @@ import ( "time" "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) @@ -150,9 +154,6 @@ func NewStatusCodeHandler(provider *StatsProvider) *StatusCodeHandler { return &StatusCodeHandler{statsProvider: provider} } -// HandleRequest is a no-op for the StatusCodeHandler. -func (h *StatusCodeHandler) HandleRequest(ctx context.Context, _ *http.Request) {} - // HandleResponse enqueues the status code into the StatsProvider's channel. func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { operation := awsmiddleware.GetOperationName(ctx) @@ -201,7 +202,7 @@ func GetShortOperationName(operation string) string { } // Stats returns the aggregated stats for operations. -func (sp *StatsProvider) Stats(operation string) agent.Stats { +func (sp *StatsProvider) Stats(_ string) agent.Stats { sp.mu.Lock() defer sp.mu.Unlock() diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 3eeec108c9..5907e82ac4 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -1,13 +1,17 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider_test import ( - "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" "testing" "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) { diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 40c7b27697..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQdfJOpHZSt+MsUZNXVHJ2YzANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIwNTA1NDgwNloXDTI0MTIwNTA2NDgw +MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS +MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAKSLNeEcP9W0nBHlYnZGQlgBf7SXIgNZDOe99R1N2dl+LXP4iEO4 -T2ze5uHMkeRdQnjMs2CivJtOFTN8cVeTK+JPwQmAjcvlVQIlRs23AWuW3+Fss/// -jrdrrdeTzrs3SqwHFJ1n7CrkNKb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lPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0f8ca44127..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCkizXhHD/VtJwR -5WJ2RkJYAX+0lyIDWQznvfUdTdnZfi1z+IhDuE9s3ubhzJHkXUJ4zLNgorybThUz -fHFXkyviT8EJgI3L5VUCJUbNtwFrlt/hbLP//463a63Xk867N0qsBxSdZ+wq5DSm -6alVx3mZ6ywg9hm49DZ4CjXeWab7HUaLESwhHXfRRLtFRhRZU9uQFPT2Sgth/OF3 -zGKA6R+M9sVkOC4Vk+Fhb/qJmrfZkcXJk9rM0i5XjVBeIrOB3xpcbqN14gxrW3Vm -uki/mbQ48wkB/hTgsWw7L5B2dd2rmyIaAI5XYNswuBeS0bRisnXFIn9brwC8U82g -PR1EKbHbAgMBAAECggEAWvw7c9naFoLDVkYAFySspNtXUXXMsgs4zqBEfMrCrrhN -y/Xe64tsJ+htxOgIuD01d3TBr6rtHfekU475YZKYzpCJTobOYbPTONeB+li6qVKJ -Q66HLgSTVytsumsaAn4FhXB43r1LY0BDORS1tSATRqA7C5LqEFLCF8iVlvj+E5Zu -fOLJsgusGYE81S1bZWbc0tpJu1YCUVOKCpD552ckbZQudcwZvumSUrmEy9c3FhRo -Z6kUu+fZFk2t3DxL2Cv39d9xH1ypH2Mszi9CmBcGIiTOf5alZ+6y03d8oYf0Jq+1 -Fuq2ZifpgdcVfvrRVYv84dmOPD4jlSIXH7zEbn7eIQKBgQDF3gVaO/KTnuwYtZl1 -MpL1efd4KDnGSf0WkXz0hyeEVHpilTkOkTdKms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/dK/xsl9oDyN4SPdPLlcmjPZ6/cb23RgUMZaAGiThmfu1hLU6pphMpkdKX +yzx6W9Wu2NTYPpT/WK8Ks4olYDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 55818f1de9..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTIwNTA1NDgwOVoXDTM0MTIwNTA1NDgwOVowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMzPqFxeQHQr -bLsuQvVX24pkBU3GEsyuKDkS0IbMAMMnw06nd5ZMH75tvWlZ1RhrCf+lTeCt0uoc -p7F3XKubGKNi52ctYqDqtGHbic8sOJJiNM0g5L7T8jnoiq+bKELK1dtLUUXNTTTg -nLDkEuImxkyg9gn5IYywsgptsTKVtqDvvQbd7zmZYuttWlDYUjMvrExrHoLT4REv -64FDcRTPOVs9X7EZ2jCO1fY5IaGN4wOQ9ms8sJnghniSRmjVyqcYP0JJO6YkoYoj -foL+F4ZC9Vdt5oTUDVYpMmLcSMAIw4OgvH5DnIRyzMrnFqdzorVJbV8+fvPcpxmy -tjXgTvUIyZCaQnkCS1Fl+d/6l4S8ZIbZ1ypwWE1w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ykKPLtL2o0ilfnz3bJndL2MUjgVqK7GzkOGIhhXreG6/4WZ+oNReMzjw +uZ6zWKhUrTKfvt5J70Nzk+aPrwEzOOcb078QfrFvxElrkoyBz5LGF6HVdIVYUO94 +1DW1egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From 188955e52d27cbe2d5dac6b235f6980084c32948 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 11:32:43 -0500 Subject: [PATCH 61/91] fixing unit tests and lint --- extension/agenthealth/extension_test.go | 2 +- .../agenthealth/handler/stats/handler.go | 2 - .../agenthealth/handler/stats/handler_test.go | 4 +- .../handler/stats/provider/statuscode.go | 6 +-- .../handler/stats/provider/statuscode_test.go | 7 ++- internal/tls/testdata/server.crt | 42 +++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- 8 files changed, 81 insertions(+), 84 deletions(-) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index c264e86440..7760fdfd72 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -20,7 +20,7 @@ func TestExtension(t *testing.T) { assert.NoError(t, extension.Start(ctx, componenttest.NewNopHost())) requestHandlers, responseHandlers := extension.Handlers() // user agent, client stats, stats - assert.Len(t, requestHandlers, 2) + assert.Len(t, requestHandlers, 1) // client stats assert.Len(t, responseHandlers, 1) cfg.IsUsageDataEnabled = false diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index b1bd4740e3..ad63584f28 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -34,7 +34,6 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo statusCodeFilter := agent.NewStatusCodeOperationsFilter() statusCodeStatsProvider := provider.GetStatsProvider(statusCodeFilter) statusCodeHandler := provider.NewStatusCodeHandler(statusCodeStatsProvider) - responseHandlers = append(responseHandlers, statusCodeHandler) statsProviders = append(statsProviders, statusCodeStatsProvider) } @@ -46,7 +45,6 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo filter := agent.NewOperationsFilter(cfg.Operations...) stats := newStatsHandler(logger, filter, statsProviders) requestHandlers = append(requestHandlers, clientStats, stats) - } agent.UsageFlags().SetValues(cfg.UsageFlags) diff --git a/extension/agenthealth/handler/stats/handler_test.go b/extension/agenthealth/handler/stats/handler_test.go index b1e9d175d0..30e603c02a 100644 --- a/extension/agenthealth/handler/stats/handler_test.go +++ b/extension/agenthealth/handler/stats/handler_test.go @@ -72,7 +72,7 @@ func TestStatsHandler(t *testing.T) { func TestNewHandlersWithStatusCodeOnly(t *testing.T) { requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, false) - assert.Len(t, requestHandlers, 1) + assert.Len(t, requestHandlers, 0) assert.Len(t, responseHandlers, 1) } func TestNewHandlersWithAgentStatsOnly(t *testing.T) { @@ -83,7 +83,7 @@ func TestNewHandlersWithAgentStatsOnly(t *testing.T) { func TestNewHandlersWithStatusCodeAndAgenthStats(t *testing.T) { requestHandlers, responseHandlers := NewHandlers(zap.NewNop(), agent.StatsConfig{}, true, true) - assert.Len(t, requestHandlers, 3) + assert.Len(t, requestHandlers, 2) assert.Len(t, responseHandlers, 2) } func TestNewHandlersWithoutStatusCodeAndAgenthStats(t *testing.T) { diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 38f96ebd89..996f95bb36 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -172,12 +172,14 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response // GetShortOperationName maps long operation names to short ones. func GetShortOperationName(operation string) string { switch operation { - case "PutMetricData": + case "PutRetentionPolicy": return "pmd" case "DescribeInstances": return "di" case "DescribeTags": return "dt" + case "DescribeTasks": + return "dts" case "DescribeVolumes": return "dv" case "DescribeContainerInstances": @@ -194,8 +196,6 @@ func GetShortOperationName(operation string) string { return "clg" case "CreateLogStream": return "cls" - case "AssumeRole": - return "ar" default: return "" } diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 5907e82ac4..8decaf1bec 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -23,12 +23,11 @@ func TestNewHandlers(t *testing.T) { t.Run("Only StatusCodeEnabled", func(t *testing.T) { requestHandlers, responseHandlers := stats.NewHandlers(logger, cfg, true, false) - assert.NotNil(t, requestHandlers, "Request handlers should not be nil") + assert.Nil(t, requestHandlers, "Request handlers should not be nil") assert.NotNil(t, responseHandlers, "Response handlers should not be nil") - assert.Len(t, requestHandlers, 1, "There should be 2 request handlers") + 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{}, requestHandlers[0], "First handler should be StatusCodeHandler") assert.IsType(t, &provider.StatusCodeHandler{}, responseHandlers[0], "First response handler should be StatusCodeHandler") }) @@ -46,7 +45,7 @@ func TestNewHandlers(t *testing.T) { 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), 3, "There should be at least 3 request handlers") + 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") }) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..9658e27d43 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtcXSqWmtWEB -LiHPhSU0HN5JWsfQZ2VkB8rFStQ8CwFG0DW9i6GSVsN1zmmzLQdVPAyP4Uzy8844 -/ceZsmlkIe6uk3BiRRNThUcJKlFJJroCBJ8y7AJA8s3teLWskRLik+0xintked6z -fMaQRgzOSPDc062QTODHB2IkShVZAeLh7OcCAwEAAaNnMGUwDgYDVR0PAQH/BAQD +MIIEGDCCAgCgAwIBAgIQOKPpln7inrlzR2bYtau5KTANBgkqhkiG9w0BAQsFADAS +MRAwDgY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ERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..2d959c7265 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHnes3zGkEYMzkjw3NOtkEzgxwdiJEoV -WQHi4eznAgMBAAECggEAGv7z1O32jXc+ouG40NewNVmXQRW0NMQ0w4Vn6UYZNXlj -BWjQJaVquCQAhEMUkDBma9jnHM7dZ5obie0+Joa5p/6Mu6M2oSR1IVx7Myq284Jk -1Ys/w7u5ESYf33pWmqiGQlbpSxamXvLoWaM7OT5veilRlkgjqiAmerj9EceRP5mR -aheVE5ctY5oZmdnvA9OcN6B8Oxk59EWEOECs8qAF/ChYfC8pWKOp4U0RILQ/9jXD -lu4p0C2XyadrJReer3whudUADWa/WSxgVCrx85/g/RTKs38KTPy7W4g3bv8KBRhc -bjLzoYTl6esRAi8nMG5Fc/85t07hkVv+j5a1NccxgQKBgQD/y/tdH90C8CrAn9y5 -mgr+1QcqJeJWaBpNf+yBqtLbybl6uLY2OzbZtzllU+TDUVlKZB36t2GnG6EIRUcd -WTHUVq8zEIRtDBa12SZlJ08FrNFyKfBByehEOvMazTxb7rdGbiv5+XztCrcPUn1f -cu30v5nBRjqDxtiAbKccFcZPpwKBgQ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d3w15MFDqXvQx6q1qt4ToDqd6jRwKBgCx4jCWrQ3XhY3H/MFST +2d53ZVwnv0K+Xo57vfR2gKujFWoVnylOXm3wlFDdpXiMWKj79K4b/VFx+emGSr+v +EO9NZ5Hndhs0kQ1gsHlHD4oqMNy3UAS/cnSU6YUL+pFCWg7mDZb9P00K1ef5L9vA +eqnOtzGSzJ4qAmxsdw9FBWTW -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..df1189c21e 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rMPbRsnGvIebh -FZsA60QnhuNiL6MowdJn17/Stl6Rs7cNV5zq3/WmaiipOoTcrKIMgA5ci23A69Pz -0WRfomoFsstRWHhimGrKrT5ewznEitvnWWxfiblmy21LTTJf6nrf7cD1B7Xlrfq+ -BORuHwSxyTapXw0HKSYPwjiSiijywWInS3QR3b5uvpyFy8rGfXI2PSTpnAsK/nws -38jUO7qPsj3AnwHpgLZe0XpGFqmemSmlPif0VT3Pn6CwsCpnEf7vFNYu+rm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B03cZohd0Pm3pca60h+osAppm +r6L5LPjdTZDZj6yLdhft2og2Wklo083RQnbSUm2FJ7Z6wHKa7tJnzYHAqZ7TXo5b +9yDugVw2KF18PDQNLB9xcwQMbUgU7hEat/LB1jU9S5solf4ACaGKMa3ArXLXWXzu +rBjJGrQQhv/ZD4Bfc8gQzZVXAC7GSl/J9cvaeUjEpJqsU6g4Fik38iG077N66XSd +ReclG62E0xPMXwXsf+E6ZMxBpmCQoxuXlFJz2mtQJv7mmYGcwz5wtdjmCAF4LwD3 +UYICGLo04gG3bbsfdRUWQMc3596ZWWsiiCA9ZadvTWNq3qEgaU5XIHbqE4LtNnNs +pAYhyYeyPubT0P4Zny/d9OeI54qfDryhL+loa260cotskbudVBbeYjznk10ybVKh +tSeWbdXaPfSWzQJexa5C5sxqoTZb9VuVZmk= -----END CERTIFICATE----- From 424b762da3928f2587c0e6cae9bf728300037b14 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 11:33:31 -0500 Subject: [PATCH 62/91] restoring test data --- internal/tls/testdata/server.crt | 42 +++++++++++++------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 9658e27d43..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQOKPpln7inrlzR2bYtau5KTANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIwNTE2MjgxMloXDTI0MTIwNTE3Mjgx -MlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAOsVf0hj2t1tccz7YtZWTKAGKZAD9WCFKSd7jVSCt2S8yyH40cA2 -yh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E3o +sG65EZeGpj0vLN+rLEbumkvgCAHACgVxvyDeJnajoA6lPNxfzby+9CmhLZfgaVbE +nVQTj8hkUW1gtvnAP3v1Zbe3QMhlqWqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 2d959c7265..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDrFX9IY9rdbXHM -+2LWVkygBimQA/VghSkne41UgrdkvMsh+NHANsoQs49NxRqSGmLrRNGDKRzeU3em -i5MpJFVp8uUkm5Q3cNibL89EBVtOXNEEmfzgvmWwova8sCOUBRD71zxX8lx3d1c2 -NL0wWtRZJfklia2R7UfcPdBazHHb4mE2GNYrPZQI4GM4tVVi1vWKWlv9YtW+s404 -GBIIRNPQOODle5mc17JIhUDEeCndTa3lT28Y8k2xU23WJJHqpHthGl7+zRxxQNRF -pBIcxQx5asOI233rUhCVBoi27GVkuqr84dVVuYxWNwVo/2ufK5R1Q/SMKssGRppI -cfgNguCnAgMBAAECggEBAMZgtbBY03DX0piv6pAE81R23svxCzgQJtJyqKkQRcJ0 -rtZUKmyRz6KYY+20zt9L9P2kbUjJgNr8hJO+ZMjrKEjn+AYUY9cFG0SZ68Xy30IZ -gSjo6USeZyHP43cHDH70Z4id8QYmN3F4+9d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hjRu0uLxDWLc+AombMavFtkZ1tffKxv6mG7Ud163ulBIt24b701XfhR5UX +RWvWI50gwQKBgQCFa1i9luwJJ0m1VOyk5kML7gMhqcbneL8XYzzx2S7IMuyKpSNt +H++ZGWdXga2Vbq3bDmNQrSvDJLcWgEP6e9ZwwZH6WYgo9KA3036iTiF6fUx1doh5 +WB3M0M6SUTBFZzqzAq3vYYEWhns7A7Se/2w8N1+0HrRQnXu5aHK1RGo+iwKBgEST +hRx7fi/dK/xsl9oDyN4SPdPLlcmjPZ6/cb23RgUMZaAGiThmfu1hLU6pphMpkdKX +yzx6W9Wu2NTYPpT/WK8Ks4olYDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index df1189c21e..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTIwNTE2MjgxN1oXDTM0MTIwNTE2MjgxN1owEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK4umyPntoOl -ULI6LGSwN/BIJ04P8fokAY+KPyBP4yS1sr97iRzJVrG2O+K1rMBUup2dGyBeee+T -xIf/bWjVRI9Jcuvv5IZDoiSdXhLV+8mvASUQl1urxQE+Kw5FaOo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yPubT0P4Zny/d9OeI54qfDryhL+loa260cotskbudVBbeYjznk10ybVKh -tSeWbdXaPfSWzQJexa5C5sxqoTZb9VuVZmk= +BBSWf0MJGMR6k7iAcZMQBOIFr+DoGjANBgkqhkiG9w0BAQsFAAOCAgEAHQib14b2 +y1b9Xa+lvvpyho887AF5LJMvcAaFA2qrZTgsct9YAUyP4jwHSMa82F34GF5zWm96 +wKGa2V7rykKPLtL2o0ilfnz3bJndL2MUjgVqK7GzkOGIhhXreG6/4WZ+oNReMzjw +uZ6zWKhUrTKfvt5J70Nzk+aPrwEzOOcb078QfrFvxElrkoyBz5LGF6HVdIVYUO94 +1DW1egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From 25e5ffd89463564c1fe35dd0013a4f326b915c80 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 11:35:49 -0500 Subject: [PATCH 63/91] fixing issue --- extension/agenthealth/handler/stats/handler.go | 2 +- extension/agenthealth/handler/stats/provider/statuscode.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index ad63584f28..4abab747a4 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -32,7 +32,7 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo if statusCodeEnabled { statusCodeFilter := agent.NewStatusCodeOperationsFilter() - statusCodeStatsProvider := provider.GetStatsProvider(statusCodeFilter) + statusCodeStatsProvider := provider.GetStatusCodeStatsProvider(statusCodeFilter) statusCodeHandler := provider.NewStatusCodeHandler(statusCodeStatsProvider) responseHandlers = append(responseHandlers, statusCodeHandler) statsProviders = append(statsProviders, statusCodeStatsProvider) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 996f95bb36..8ff9f3da8f 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -43,8 +43,8 @@ type statusCodeEntry struct { statusCode int } -// GetStatsProvider initializes and retrieves the singleton StatsProvider. -func GetStatsProvider(filter interface{}) *StatsProvider { +// GetStatusCodeStatsProvider initializes and retrieves the singleton StatsProvider. +func GetStatusCodeStatsProvider(filter interface{}) *StatsProvider { statsProviderOnce.Do(func() { provider := &StatsProvider{ statsByOperation: make(map[string]*[5]int), From 6a482680b53728670fd0fa4aa17b682cb18ff06f Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 11:53:26 -0500 Subject: [PATCH 64/91] adding singleton unit test --- .../handler/stats/provider/statuscode_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 8decaf1bec..7aa428f039 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -56,3 +56,20 @@ func TestNewHandlers(t *testing.T) { assert.Nil(t, responseHandlers, "Response handlers should be nil") }) } + +func TestSingleton(t *testing.T) { + instance1 := provider.GetStatusCodeStatsProvider(nil) + instance2 := provider.GetStatusCodeStatsProvider(nil) + + 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") + } +} From af57c059597e3c0541f948769a35636de7f1bdb3 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 12:22:12 -0500 Subject: [PATCH 65/91] moving map --- .../agenthealth/handler/stats/agent/agent.go | 32 +++++++++++++++ .../handler/stats/provider/statuscode.go | 39 +------------------ 2 files changed, 34 insertions(+), 37 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 337f4fc3ab..5cc975ad95 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -142,6 +142,38 @@ var StatusCodeOperations = []string{ // all the operations that are allowed "CreateLogStream", } +// GetShortOperationName maps long operation names to short ones. +func GetShortOperationName(operation string) string { + switch operation { + case "PutRetentionPolicy": + return "pmd" + 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" + default: + return "" + } +} + type StatsConfig struct { // Operations are the allowed operation names to gather stats for. Operations []string `mapstructure:"operations,omitempty"` diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 8ff9f3da8f..55befd29ed 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -104,7 +104,6 @@ func (sp *StatsProvider) processStatusCode(entry statusCodeEntry) { // updateStatusCodeCount updates the count for the specific status code. func (sp *StatsProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { - log.Printf("Updating stats for status code: %d\n", statusCode) switch statusCode { case 200: stats[0]++ @@ -117,17 +116,15 @@ func (sp *StatsProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { case 429: stats[4]++ default: - log.Printf("Ignored status code: %d\n", statusCode) + } } // startResetTimer initializes a reset timer to clear stats periodically. func (sp *StatsProvider) startResetTimer() { - log.Println("Starting stats reset timer...") sp.resetTimer = time.AfterFunc(statusResetInterval, func() { sp.mu.Lock() defer sp.mu.Unlock() - log.Println("Resetting stats...") for key := range sp.statsByOperation { delete(sp.statsByOperation, key) } @@ -161,7 +158,7 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response return } - operation = GetShortOperationName(operation) + operation = agent.GetShortOperationName(operation) if operation == "" { return } @@ -169,38 +166,6 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response h.statsProvider.EnqueueStatusCode(operation, r.StatusCode) } -// GetShortOperationName maps long operation names to short ones. -func GetShortOperationName(operation string) string { - switch operation { - case "PutRetentionPolicy": - return "pmd" - 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" - default: - return "" - } -} - // Stats returns the aggregated stats for operations. func (sp *StatsProvider) Stats(_ string) agent.Stats { sp.mu.Lock() From 5d3b20db86a7568e059fec289902a4c2c8626970 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 15:39:18 -0500 Subject: [PATCH 66/91] fixing channels --- .../agenthealth/handler/stats/agent/agent.go | 99 ++++++++++++------- .../handler/stats/provider/statuscode.go | 77 +++++++-------- internal/tls/testdata/server.crt | 42 ++++---- internal/tls/testdata/server.key | 52 +++++----- internal/tls/testdata/tls-ca.crt | 50 +++++----- 5 files changed, 170 insertions(+), 150 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 5cc975ad95..4a359b6ae8 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -5,6 +5,7 @@ package agent import ( "encoding/json" + "log" "strings" "github.com/aws/amazon-cloudwatch-agent/internal/util/collections" @@ -81,26 +82,43 @@ func (s *Stats) Merge(other Stats) { if other.EntityRejected != nil { s.EntityRejected = other.EntityRejected } - if other.StatusCodes == nil { - return - } + if other.StatusCodes != nil { + log.Println("Merging status codes from another source.") - if s.StatusCodes == nil { - s.StatusCodes = make(map[string][5]int) - } + if s.StatusCodes == nil { + log.Println("Initializing status codes map as it was 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 + for key, value := range other.StatusCodes { + log.Printf("Processing key: %s with value: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", key, value[0], value[1], value[2], value[3], value[4]) + + if existing, ok := s.StatusCodes[key]; ok { + log.Printf( + "Key %s already exists. Existing: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d. Merging with: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", + key, existing[0], existing[1], existing[2], existing[3], existing[4], + value[0], value[1], value[2], value[3], value[4], + ) + + //Merge the values for each status code + 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 + } + + log.Printf( + "Updated key %s: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", + key, s.StatusCodes[key][0], s.StatusCodes[key][1], s.StatusCodes[key][2], s.StatusCodes[key][3], s.StatusCodes[key][4], + ) + } else { + log.Printf("Key %s does not exist. Adding it with: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", key, value[0], value[1], value[2], value[3], value[4]) + s.StatusCodes[key] = value } - } else { - s.StatusCodes[key] = value } + log.Println("Merging of status codes completed.") } } @@ -127,26 +145,51 @@ 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", - "DescribeTasks", "DescribeVolumes", "DescribeContainerInstances", "DescribeServices", "DescribeTaskDefinition", "ListServices", "ListTasks", + "DescribeTasks", "CreateLogGroup", "CreateLogStream", } +func NewOperationsFilter(operations ...string) OperationsFilter { + allowed := collections.NewSet[string](operations...) + return OperationsFilter{ + operations: allowed, + allowAll: allowed.Contains(AllowAllOperations), + } +} + +// NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. +func NewStatusCodeOperationsFilter() OperationsFilter { + allowed := collections.NewSet[string](StatusCodeOperations...) + + return OperationsFilter{ + operations: allowed, + allowAll: allowed.Contains(AllowAllOperations), + } +} + // GetShortOperationName maps long operation names to short ones. func GetShortOperationName(operation string) string { switch operation { case "PutRetentionPolicy": - return "pmd" + return "prp" case "DescribeInstances": return "di" case "DescribeTags": @@ -173,23 +216,3 @@ func GetShortOperationName(operation string) string { return "" } } - -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"` -} - -func NewOperationsFilter(operations ...string) OperationsFilter { - allowed := collections.NewSet[string](operations...) - return OperationsFilter{ - operations: allowed, - allowAll: allowed.Contains(AllowAllOperations), - } -} - -// NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. -func NewStatusCodeOperationsFilter() OperationsFilter { - return NewOperationsFilter(StatusCodeOperations...) -} diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 55befd29ed..72dd3ee017 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -18,21 +18,21 @@ import ( const ( statusResetInterval = 5 * time.Minute statusHandlerID = "cloudwatchagent.StatusCodeHandler" - channelBufferSize = 100 ) var ( - statusCodeProviderSingleton *StatsProvider - statsProviderOnce sync.Once + statusCodeProviderSingleton *StatusCodeProvider + StatusCodeProviderOnce sync.Once ) -// StatsProvider handles processing of status codes and maintains stats. -type StatsProvider struct { +// StatusCodeProvider handles processing of status codes and maintains stats. +type StatusCodeProvider struct { statsByOperation map[string]*[5]int resetTimer *time.Timer filter agent.OperationsFilter statusCodeChan chan statusCodeEntry stopChan chan struct{} + shouldResetStats bool mu sync.Mutex wg sync.WaitGroup } @@ -43,12 +43,12 @@ type statusCodeEntry struct { statusCode int } -// GetStatusCodeStatsProvider initializes and retrieves the singleton StatsProvider. -func GetStatusCodeStatsProvider(filter interface{}) *StatsProvider { - statsProviderOnce.Do(func() { - provider := &StatsProvider{ +// GetStatusCodeStatusCodeProvider initializes and retrieves the singleton StatusCodeProvider. +func GetStatusCodeStatsProvider(filter interface{}) *StatusCodeProvider { + StatusCodeProviderOnce.Do(func() { + provider := &StatusCodeProvider{ statsByOperation: make(map[string]*[5]int), - statusCodeChan: make(chan statusCodeEntry, channelBufferSize), + statusCodeChan: make(chan statusCodeEntry), stopChan: make(chan struct{}), } @@ -63,7 +63,7 @@ func GetStatusCodeStatsProvider(filter interface{}) *StatsProvider { } // startProcessing begins processing status codes from the channel. -func (sp *StatsProvider) startProcessing() { +func (sp *StatusCodeProvider) startProcessing() { sp.wg.Add(1) go func() { defer sp.wg.Done() @@ -78,19 +78,13 @@ func (sp *StatsProvider) startProcessing() { }() } -// Stop signals the StatsProvider to stop processing and waits for cleanup. -func (sp *StatsProvider) Stop() { - close(sp.stopChan) - sp.wg.Wait() -} - // EnqueueStatusCode adds a status code entry to the channel. -func (sp *StatsProvider) EnqueueStatusCode(operation string, statusCode int) { +func (sp *StatusCodeProvider) EnqueueStatusCode(operation string, statusCode int) { sp.statusCodeChan <- statusCodeEntry{operation: operation, statusCode: statusCode} } // processStatusCode updates the stats map for the given status code entry. -func (sp *StatsProvider) processStatusCode(entry statusCodeEntry) { +func (sp *StatusCodeProvider) processStatusCode(entry statusCodeEntry) { sp.mu.Lock() defer sp.mu.Unlock() @@ -99,11 +93,12 @@ func (sp *StatsProvider) processStatusCode(entry statusCodeEntry) { stats = &[5]int{} sp.statsByOperation[entry.operation] = stats } + log.Println(entry.operation) sp.updateStatusCodeCount(stats, entry.statusCode) } // updateStatusCodeCount updates the count for the specific status code. -func (sp *StatsProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { +func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { switch statusCode { case 200: stats[0]++ @@ -116,25 +111,21 @@ func (sp *StatsProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { case 429: stats[4]++ default: - + return } } // startResetTimer initializes a reset timer to clear stats periodically. -func (sp *StatsProvider) startResetTimer() { +func (sp *StatusCodeProvider) startResetTimer() { sp.resetTimer = time.AfterFunc(statusResetInterval, func() { - sp.mu.Lock() - defer sp.mu.Unlock() - for key := range sp.statsByOperation { - delete(sp.statsByOperation, key) - } + sp.shouldResetStats = true sp.startResetTimer() }) } -// StatusCodeHandler is the handler that uses the StatsProvider for processing. +// StatusCodeHandler is the handler that uses the StatusCodeProvider for processing. type StatusCodeHandler struct { - statsProvider *StatsProvider + StatusCodeProvider *StatusCodeProvider } func (h *StatusCodeHandler) ID() string { @@ -145,16 +136,15 @@ func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { return awsmiddleware.After } -// NewStatusCodeHandler creates a new handler with the given StatsProvider. -func NewStatusCodeHandler(provider *StatsProvider) *StatusCodeHandler { - log.Println("Creating new StatusCodeHandler...") - return &StatusCodeHandler{statsProvider: provider} +// NewStatusCodeHandler creates a new handler with the given StatusCodeProvider. +func NewStatusCodeHandler(provider *StatusCodeProvider) *StatusCodeHandler { + return &StatusCodeHandler{StatusCodeProvider: provider} } -// HandleResponse enqueues the status code into the StatsProvider's channel. +// HandleResponse enqueues the status code into the StatusCodeProvider's channel. func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { operation := awsmiddleware.GetOperationName(ctx) - if !h.statsProvider.filter.IsAllowed(operation) { + if !h.StatusCodeProvider.filter.IsAllowed(operation) { return } @@ -163,18 +153,25 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response return } - h.statsProvider.EnqueueStatusCode(operation, r.StatusCode) + h.StatusCodeProvider.EnqueueStatusCode(operation, r.StatusCode) } // Stats returns the aggregated stats for operations. -func (sp *StatsProvider) Stats(_ string) agent.Stats { +func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { sp.mu.Lock() defer sp.mu.Unlock() - statusCodeMap := make(map[string][5]int) - for op, stats := range sp.statsByOperation { - statusCodeMap[op] = *stats + if sp.shouldResetStats { + for op, stats := range sp.statsByOperation { + statusCodeMap[op] = *stats + } + //Reset Stats + for key := range sp.statsByOperation { + delete(sp.statsByOperation, key) + } + sp.shouldResetStats = false } + return agent.Stats{ StatusCodes: statusCodeMap, } diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..3628d41f9d 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -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ElfDuyW8eU90FZXTYzD3J ++XZWIH8uOK5qUVJzHYe9+R5ZSEnUIlQCpCGgHwwNqYfv0eM62zKN6EJL0x0JKN/3 +Zer1Ea9gYsUSLpdWGyVTpyUey/nMZ5/3/fKXMt0wxhtQHumn/h8UYe22TPZFiF0q +bYJpKq/2zZcdGVxjw4w8Oi7qAwLtC7JmaeEnxGrbs3pJRqtQlC0lyk4y+He9MNcf +NOkdu8yjX5OQs9NmrHEWhgOLwCXBnLEKD7kAnazWqM5dui9XNR9dM9juSjdxvnrs +CQzlQxlDPR9U1yxjLgGdFiIdFbGA3Q+RZ7Uabjbwa9ZjDip5uxooxVhZsoWrI/X/ +EBXz/v58icl/rAJIrFQ1yPZZddXPXo9GRq8gtwZatwMYv8M/bBdZK9IDCtJiPP+q +ws330kMOX9DrPZHvA5ca30GaeApbeQkmM/8U0JCJ38uwhGPleHw/1HUh4wGzls8J +HKse82LfXDlwBLXUFOVcUx2rbtcidYyTjfbyxht73pBT6es28yITeejIWe+SFPXT +fSOzCyOTjwkvjSuarGBEtFcxSlIGt/XVAnzkgxX8Xany+T9CMt/6hchz1FKMIXMp +j/zTIbOG/KejVNab3tNYWPqjkJp9JSiLva2I5lawOaTdWEtluL1sJY/hPE8= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..7746a7fe85 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUr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BvE5WEQKBgQD+j3X3N7U9QNu+MO3H +QKpHwF7NWmT6JGhT4dlEFI007CyeRrlKtDj3aRVF5UkrVJzwE4SgIveooCihpryf +EVWW2aDl/A8T7kDTKrxk2QRkAFVGXwb4eMQ33R6vXEiA5QvGaExHIUTc00BKiW3m +6ADK5tJ3TdKWwEtwmlTjQ78KnwKBgQDTUa0HTbBOjCLlWZZS5NODTA/Pc199zo3T +VuVCr47EQGmTqKnGWp7d+Sfiw5XZ8udXtwMXp5FAOTGpqvpyFxCh3zUZKBpkFJQY +tzUxKWzeycrvv1tylouMMfqYJiJQJLHwo4GTFOADEadJQssgiCaCjZrEk6Kbi2oP +haYNRmqbTQKBgDLsE9cOZ80HCm4zb31qbCXKT6yYppZ7bftJtKKv0ceCbzKCR1Kw +Vqz3cm/2+/oVBQfpf6BhHlW3JCmiJx1S5GI2yr72+zUrdgBIDkPGPeCbSHO5UrWl +wurB6v99YGuYZhCckJWyDAp4n+XJNBj61B3Cqtt+z9+kO/McjFqiFLdVAoGANarU +irpMQGaOpjiuWLcMkJfMnB7s7YJ7umSjLOBxHZ5OMdXv6BQzrKQOYSTS9dsercQo +4OUJmonr9u8ZU8hPzQxm69CngytGwVAmDio7IAmXpHOwwdVB84Tt454rsLbhCgA8 +dCIlEiJ1ncF83PI29YkI+UuVTHOHqBGFLnHnuTECgYEAjULXn3q3ZR3FdOatkiEn +1uHSbVsXm4hl3NeQOBuiONr6bp3uJjx3a5/dwrEgDARa/4B32Ymy20vRbwcWdIPZ +smRwjPVIGI1dev96ajYVspLZeAKGxWU3weaUKyvyeQox0xgntVMtpielAUIAUzeH +tu7qpgEc+JomrXp8sDiC8SE= -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..0a61652db4 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gA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y1Sd7bqVXM/DHvaKF6dRvhFSMQ+SqUW7vMWam+q +1aqvY1OGZ2GAhmbgGAyl6O1rANht/cYMKmg= -----END CERTIFICATE----- From 471842cd435894ca12d0ca54e9a23b828a2c3223 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 15:39:49 -0500 Subject: [PATCH 67/91] removing random files --- internal/tls/testdata/server.crt | 42 +++++++++++++------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 3628d41f9d..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQOOpyKi7vuOzuSUxoWSndVzANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIwNTIwMzI1NVoXDTI0MTIwNTIxMzI1 -NVowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANIhda1MB8N0W82ODgQ7XjeNaSnUmG93NAYMllVi9QKTBScuyYIx -YCf+wC/2e/XMHk+o7QrxIk3IjFKv8CICzV4SmqRZsXZv6jgM+17yQCBUZ2H3LX7d -iPpUYX+k0AgUG4I32ZQiO30iViBJbvVLb9CpK4aRdiIIi5m0PQB2oiduaSedy6iz -ne4l5diKGgoUB2C0Gg+rg71sfA0Zew72N9kzktgShlb5P3h4KNtKMr5j37z2OI9G -3aSb+Hm3vkVUlAtHY88e3lRPrBAhdLz+ULfpq9nzf+JrfrfEPBpLTPGcYX6nWQDa -vtocv2N5BawdERJt8H3n3CMpwaMQdOu6dtMCAwEAAaNnMGUwDgYDVR0PAQH/BAQD +MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q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SiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 7746a7fe85..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDSIXWtTAfDdFvN -jg4EO143jWkp1JhvdzQGDJZVYvUCkwUnLsmCMWAn/sAv9nv1zB5PqO0K8SJNyIxS -r/AiAs1eEpqkWbF2b+o4DPte8kAgVGdh9y1+3Yj6VGF/pNAIFBuCN9mUIjt9IlYg -SW71S2/QqSuGkXYiCIuZtD0AdqInbmknncuos53uJeXYihoKFAdgtBoPq4O9bHwN -GXsO9jfZM5LYEoZW+T94eCjbSjK+Y9+89jiPRt2km/h5t75FVJQLR2PPHt5UT6wQ -IXS8/lC36avZ83/ia363xDwaS0zxnGF+p1kA2r7aHL9jeQWsHRESbfB959wjKcGj -EHTrunbTAgMBAAECggEAcWgRhKfmALzJ1xR1yB7qaHzvZt4QLwhckW81q3uu0+bY -/x6nLpbLWIqK2tfiavPw3/lBhYhChUxZPz8pEJIGmGDeCRlHR6568ClBeSqxJUGo -Uhz+9ttFVCU6QZOHmvSPLCZMTUB0bsKbTO2U7tn5zNmgXg4ffZqzDQ9TZO6h8TkQ -I7+e+xDlg/MWO9nNE2dpw+mFAo5ZtLlMaxdzhPponOyLIsmfOICgKsNJBe0GKoPe -E79Dy+rhNNmLRG2pAFY7/zCnrgSnZg4jrkmzoWcDP3RdEA/q90yd3u30+Ar1lFx+ -DWIIpgql/BzoG8czxNSM8Ldcwpq3w0pBGSgBvE5WEQKBgQD+j3X3N7U9QNu+MO3H -QKpHwF7NWmT6JGhT4dlEFI007CyeRrlKtDj3aRVF5UkrVJzwE4SgIveooCihpryf -EVWW2aDl/A8T7kDTKrxk2QRkAFVGXwb4eMQ33R6vXEiA5QvGaExHIUTc00BKi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Kz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 0a61652db4..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTIwNTIwMzI1OVoXDTM0MTIwNTIwMzI1OVowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAODR5vPd5RiD -/edCipc05uKbh+hP+ljrHGEKoeRmRg8OjVNGSx0rQgYB+BH1/zEystyGqRzMvCZS -woC/gi8cG9a2eZ98w6Ui5AC7wztHJrA6QDpy686iwIxpkQxSnv60zVRg+Za108MK -a5LShMipk5zI79x9wZu1CuhhR2xMfSeRnVBUZRgXbgs6dp9d7oQ9Z2o8pbPqfOll -o4gIA/v/bVxmXsOEsDYKhg+fAtTSv0sdABM834OTJoCgK4QMRFagR3c2rIhhu/3z -+E1jQrgUHz6NlTNfXKSSVKHs6ItyF8lVxrAMLPyDXPXDbXjM3CxmPxbzNv9UqWdi -SO5B1Gbt2PbhO2XC5zGUMT8mym5W1aIsV0HrrOjGK2OeEyh9LF8/G0RVJJS/39SE -AMAbCyB1IEO0QcwS8lLZwHWPYI9RkJJBd3yEM94Tx+Xn8NYJodhwDYLeZThUQ/Q9 -WO7sHzlwjEZDG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F6HVdIVYUO94 +1DW1egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From c27527175f3bbd06a1bee7f9f2175a6fe43d715c Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 15:56:55 -0500 Subject: [PATCH 68/91] moving filter to handler --- .../agenthealth/handler/stats/handler.go | 4 +- .../handler/stats/provider/statuscode.go | 13 ++--- .../handler/stats/provider/statuscode_test.go | 4 +- internal/tls/testdata/server.crt | 42 +++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- 6 files changed, 81 insertions(+), 84 deletions(-) diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 4abab747a4..5d0c10e4db 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -32,8 +32,8 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo if statusCodeEnabled { statusCodeFilter := agent.NewStatusCodeOperationsFilter() - statusCodeStatsProvider := provider.GetStatusCodeStatsProvider(statusCodeFilter) - statusCodeHandler := provider.NewStatusCodeHandler(statusCodeStatsProvider) + statusCodeStatsProvider := provider.GetStatusCodeStatsProvider() + statusCodeHandler := provider.NewStatusCodeHandler(statusCodeStatsProvider, statusCodeFilter) responseHandlers = append(responseHandlers, statusCodeHandler) statsProviders = append(statsProviders, statusCodeStatsProvider) } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 72dd3ee017..92768486a9 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -29,7 +29,6 @@ var ( type StatusCodeProvider struct { statsByOperation map[string]*[5]int resetTimer *time.Timer - filter agent.OperationsFilter statusCodeChan chan statusCodeEntry stopChan chan struct{} shouldResetStats bool @@ -44,7 +43,7 @@ type statusCodeEntry struct { } // GetStatusCodeStatusCodeProvider initializes and retrieves the singleton StatusCodeProvider. -func GetStatusCodeStatsProvider(filter interface{}) *StatusCodeProvider { +func GetStatusCodeStatsProvider() *StatusCodeProvider { StatusCodeProviderOnce.Do(func() { provider := &StatusCodeProvider{ statsByOperation: make(map[string]*[5]int), @@ -52,9 +51,6 @@ func GetStatusCodeStatsProvider(filter interface{}) *StatusCodeProvider { stopChan: make(chan struct{}), } - if opsFilter, ok := filter.(agent.OperationsFilter); ok { - provider.filter = opsFilter - } provider.startResetTimer() provider.startProcessing() statusCodeProviderSingleton = provider @@ -126,6 +122,7 @@ func (sp *StatusCodeProvider) startResetTimer() { // StatusCodeHandler is the handler that uses the StatusCodeProvider for processing. type StatusCodeHandler struct { StatusCodeProvider *StatusCodeProvider + filter agent.OperationsFilter } func (h *StatusCodeHandler) ID() string { @@ -137,14 +134,14 @@ func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { } // NewStatusCodeHandler creates a new handler with the given StatusCodeProvider. -func NewStatusCodeHandler(provider *StatusCodeProvider) *StatusCodeHandler { - return &StatusCodeHandler{StatusCodeProvider: provider} +func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsFilter) *StatusCodeHandler { + return &StatusCodeHandler{StatusCodeProvider: provider, filter: filter} } // HandleResponse enqueues the status code into the StatusCodeProvider's channel. func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { operation := awsmiddleware.GetOperationName(ctx) - if !h.StatusCodeProvider.filter.IsAllowed(operation) { + if !h.filter.IsAllowed(operation) { return } diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 7aa428f039..32b5c44535 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -58,8 +58,8 @@ func TestNewHandlers(t *testing.T) { } func TestSingleton(t *testing.T) { - instance1 := provider.GetStatusCodeStatsProvider(nil) - instance2 := provider.GetStatusCodeStatsProvider(nil) + instance1 := provider.GetStatusCodeStatsProvider() + instance2 := provider.GetStatusCodeStatsProvider() if instance1 != instance2 { t.Errorf("Expected both instances to be the same, but they are different") diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..a2e5915f46 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtc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1qPx9tToK66RgDaqUb+zmTg3ccj2OQQCig7HkgbeglRFMl6hLpz65lR8jOHKiN/ +lBEdzMxyWJuqNRa0HQzAceG5XacIQlSJXJrQAfWTTqZTllLWYRmW1mQES5kC0b+r +rX9n1PBDvwLfRhi0dNeD35/bb0FKXXSuau0mq8S41+AC5IlufOEosX7FtkLSqs1+ +ATESza8X3nm7zOTe9axijxyy4lWKFfSM7OlbNTWnUDAtrMP6oH4uyxN0/1A= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..9f1bdffa2d 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHnes3zGkEYMzkjw3NOtkEzgxwdiJEoV -WQHi4eznAgMBAAECggEAGv7z1O32jXc+ouG40NewNVmXQRW0NMQ0w4Vn6UYZNXlj -BWjQJaVquCQAhEMUkDBma9jnHM7dZ5obie0+Joa5p/6Mu6M2oSR1IVx7Myq284Jk -1Ys/w7u5ESYf33pWmqiGQlbpSxamXvLoWaM7OT5veilRlkgjqiAmerj9EceRP5mR -aheVE5ctY5oZmdnvA9OcN6B8Oxk59EWEOECs8qAF/ChYfC8pWKOp4U0RILQ/9jXD -lu4p0C2XyadrJReer3whudUADWa/WS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NXtA35xHMqc/h0h/exUWvge3LFukUPNfUGbgVrteV219ZMjmIg +ZuGVeQPPLQBg9hV01hcPOmxz3sVEX6lEVLOXKMPLovzib0/91SfJ2cP/AoGBAKKv +OsgA3mQEJSiZVAoiaGjvRTiK2zDt5IDp9ZXHxkSwht56sICyqlKSmhns7/YJ/aqE +xqYfoe+yz6oyoTvrCKxx2+N5QiP2LQ6Lhh97B2Z/bIu5NwtUWFWkDbLWSoUL3ufU +R21KQnxwC+8LL7sxGB381CGM0VRAL3/6eJO/u42nAoGAODOI+Q/rTOaUBEAb85B/ +tQhgRSZo2nxTbZwLMiDmdiHjI7Gu71mdam5nnWm0ODXp1ssTInxMEBOD34Sei9aH +qxOVpgkgE/qR4Hvk2qVUA2G1Oi1hjEbaBczFpeLJS2VqAQq5+MYY27L9povJF31H +t2jxYbMiDR4H8Agv2e4L4P4= -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..08f4fcdbf4 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rM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sFAAOCAgEAvWoem8xt +7Yjme3GmPWjLYkexLHH+GIz63394zj3hH4mkPPujsJwrD/l4Iy7Q56kAgNPe9TgY +ib7EIQrRK+kj5Z3HfiRt3k2syRLqnTTk1Ta62aLidypuD8KHIutC2ib5964Liw/d +Nk0jOJ0o6Lt2qDwdflTmX+861ceio4LBFqV8ZszNoSXdHKQSWvk76/8iQOMWan5V +58gsp5W0lAlGBD9gZ8keogVGnTP7dWH6U9Co/8UhuHVjSkRGiFBouwothh66FKdp +dUf5DNmxdlrxED9nrJSDvfltqqRZZKZFDlCNZXqewXaXJ0pT2SnyKPUQNhSBkR7C +4IqrnkNDrKWVN2xegYwkbN8CqigwbrCpUrqD7bFc4QYDDytaKt50MNjYrc8U0lIE +KHEwyGxQNBe5DiHCKWggoRoBSQk9YmUFDBdPRzhcEpUCFoDgkdhmBrcGiVjMm7yU +H12Le0LTe5/oG8f2rdNQ6lIBbovvidPzglnL6suwTSfcSb3hFzWMg5tacxmQQa6L +S7WEXyOdJ6QGNlevzmYYrLSo5kUE83xEXB+qNIcwrFWxEOP0AE5ASIyffDsSoHAd +/af3l3VYPzsDNsEob/28Txn9FiltKxbi+OEF1g7X6P/RGn/EWxsH++0mfMtSjFvV +RkuchrglwgQckeOaposAUULvZIM6HQJuna8= -----END CERTIFICATE----- From c31465fe10d46dc182f0a7b8c32c6ffaedb6cffd Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 16:06:08 -0500 Subject: [PATCH 69/91] restoring files --- internal/tls/testdata/server.crt | 42 +++++++++++++------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index a2e5915f46..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEG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rSnYArNSyQvNTeNf0q/rX9yO8wRcCM5K +sb8uv27xdawjN6F3z59rpJOf9ldX4ASrRZHzX/ttvvNcUdbCZsF5+h2EhcwNVVUa +Q6vlAW8u4Ik9HXxJ+W2HEdlSYWcCdTK4hDCtJhwqEBua1VdKwSdrlDZJPswAdCzv +CR3Fj4NsmPRDw8uCPIL4hwk5fbffcn3rZrsOXSMTKxvdyP+XBPKWEoIs6cxvdE3o +sG65EZeGpj0vLN+rLEbumkvgCAHACgVxvyDeJnajoA6lPNxfzby+9CmhLZfgaVbE +nVQTj8hkUW1gtvnAP3v1Zbe3QMhlqWqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 9f1bdffa2d..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC6eCe+AJSblutc -qrR2XC+NLU9znB2UZJlI+ol1LaYe3xP2nGCCyeNAEGC1u0fcV9woeD6grVOAcNNE -qqXQuW/s7BrIcbtj0EMjTaAP3J4A9vS8TvfUkVrGL4RIAFMq6Xy0hnZTQ2BvHUFl -b5tK7U3J9MapkUH/LiI45lo4fN6C1022NASs1tlSrooGFOj+debrcvCiX3Mik6JF -uGlwjwnUoaYLVdjE95Kxj4A/X5HsxqVL4PaP+FDThxUI8BK12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ZtzllU+TDUVlKZB36t2GnG6EIRUcd +WTHUVq8zEIRtDBa12SZlJ08FrNFyKfBByehEOvMazTxb7rdGbiv5+XztCrcPUn1f +cu30v5nBRjqDxtiAbKccFcZPpwKBgQD+ABUQ0h3aX5qDqzhvSLNuqy+hOZPLsqva +VxsDsIlzzzGwmdf+m2Dn9JR/xJNMPf717LJs8IYIqW4KX/HW0pC3Y8fu/6h4fFM9 +ZpJkM2hjRu0uLxDWLc+AombMavFtkZ1tffKxv6mG7Ud163ulBIt24b701XfhR5UX +RWvWI50gwQKBgQCFa1i9luwJJ0m1VOyk5kML7gMhqcbneL8XYzzx2S7IMuyKpSNt +H++ZGWdXga2Vbq3bDmNQrSvDJLcWgEP6e9ZwwZH6WYgo9KA3036iTiF6fUx1doh5 +WB3M0M6SUTBFZzqzAq3vYYEWhns7A7Se/2w8N1+0HrRQnXu5aHK1RGo+iwKBgEST +hRx7fi/dK/xsl9oDyN4SPdPLlcmjPZ6/cb23RgUMZaAGiThmfu1hLU6pphMpkdKX +yzx6W9Wu2NTYPpT/WK8Ks4olYDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 08f4fcdbf4..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB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----- From ed0313da2183cfee08b942c2b11c6b523e72c25e Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 16:29:02 -0500 Subject: [PATCH 70/91] removing logs --- .../agenthealth/handler/stats/agent/agent.go | 20 ------------------- .../handler/stats/provider/statuscode.go | 2 -- 2 files changed, 22 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 4a359b6ae8..1567b81512 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -5,7 +5,6 @@ package agent import ( "encoding/json" - "log" "strings" "github.com/aws/amazon-cloudwatch-agent/internal/util/collections" @@ -83,24 +82,12 @@ func (s *Stats) Merge(other Stats) { s.EntityRejected = other.EntityRejected } if other.StatusCodes != nil { - log.Println("Merging status codes from another source.") - if s.StatusCodes == nil { - log.Println("Initializing status codes map as it was nil.") s.StatusCodes = make(map[string][5]int) } for key, value := range other.StatusCodes { - log.Printf("Processing key: %s with value: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", key, value[0], value[1], value[2], value[3], value[4]) - if existing, ok := s.StatusCodes[key]; ok { - log.Printf( - "Key %s already exists. Existing: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d. Merging with: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", - key, existing[0], existing[1], existing[2], existing[3], existing[4], - value[0], value[1], value[2], value[3], value[4], - ) - - //Merge the values for each status code s.StatusCodes[key] = [5]int{ existing[0] + value[0], // 200 existing[1] + value[1], // 400 @@ -108,17 +95,10 @@ func (s *Stats) Merge(other Stats) { existing[3] + value[3], // 413 existing[4] + value[4], // 429 } - - log.Printf( - "Updated key %s: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", - key, s.StatusCodes[key][0], s.StatusCodes[key][1], s.StatusCodes[key][2], s.StatusCodes[key][3], s.StatusCodes[key][4], - ) } else { - log.Printf("Key %s does not exist. Adding it with: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", key, value[0], value[1], value[2], value[3], value[4]) s.StatusCodes[key] = value } } - log.Println("Merging of status codes completed.") } } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 92768486a9..41a0768e63 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -5,7 +5,6 @@ package provider import ( "context" - "log" "net/http" "sync" "time" @@ -89,7 +88,6 @@ func (sp *StatusCodeProvider) processStatusCode(entry statusCodeEntry) { stats = &[5]int{} sp.statsByOperation[entry.operation] = stats } - log.Println(entry.operation) sp.updateStatusCodeCount(stats, entry.statusCode) } From 7fb22efdf9bc8fe9f8db20802cf0a1a1e78d7519 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 16:30:43 -0500 Subject: [PATCH 71/91] fixing op filter --- extension/agenthealth/handler/stats/agent/agent.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 1567b81512..10b82c8fd5 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -157,12 +157,7 @@ func NewOperationsFilter(operations ...string) OperationsFilter { // NewStatusCodeOperationsFilter creates a new filter for allowed operations and status codes. func NewStatusCodeOperationsFilter() OperationsFilter { - allowed := collections.NewSet[string](StatusCodeOperations...) - - return OperationsFilter{ - operations: allowed, - allowAll: allowed.Contains(AllowAllOperations), - } + return NewOperationsFilter(StatusCodeOperations...) } // GetShortOperationName maps long operation names to short ones. From 106a329c82a6ebbf1dd108b3552b5c781482bde1 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Thu, 5 Dec 2024 16:49:20 -0500 Subject: [PATCH 72/91] changing parameter name --- translator/translate/otel/extension/agenthealth/translator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translator/translate/otel/extension/agenthealth/translator.go b/translator/translate/otel/extension/agenthealth/translator.go index 6ca755341f..5e1d4c0b9b 100644 --- a/translator/translate/otel/extension/agenthealth/translator.go +++ b/translator/translate/otel/extension/agenthealth/translator.go @@ -40,13 +40,13 @@ type translator struct { var _ common.Translator[component.Config] = (*translator)(nil) -func NewTranslatorWithStatusCode(name component.DataType, operations []string, statuscodeonly bool) common.Translator[component.Config] { +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: statuscodeonly, + isStatusCodeEnabled: isStatusCodeEnabled, } } From aff8062f82e6fd45049a898496fd494090cad38b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 6 Dec 2024 09:52:51 -0500 Subject: [PATCH 73/91] adding assume role --- extension/agenthealth/handler/stats/agent/agent.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extension/agenthealth/handler/stats/agent/agent.go b/extension/agenthealth/handler/stats/agent/agent.go index 10b82c8fd5..d80303510d 100644 --- a/extension/agenthealth/handler/stats/agent/agent.go +++ b/extension/agenthealth/handler/stats/agent/agent.go @@ -145,6 +145,7 @@ var StatusCodeOperations = []string{ // all the operations that are allowed "DescribeTasks", "CreateLogGroup", "CreateLogStream", + "AssumeRole", } func NewOperationsFilter(operations ...string) OperationsFilter { @@ -187,6 +188,8 @@ func GetShortOperationName(operation string) string { return "clg" case "CreateLogStream": return "cls" + case "AssumeRole": + return "ar" default: return "" } From 3017b84737d6ae548ae704c38cf9e4c20c5477d9 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 6 Dec 2024 10:15:15 -0500 Subject: [PATCH 74/91] resolving comments --- extension/agenthealth/extension.go | 7 ++++--- extension/agenthealth/handler/stats/agent/agent_test.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 2f1ca916b1..6618a18955 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -26,14 +26,15 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa var responseHandlers []awsmiddleware.ResponseHandler requestHandlers := []awsmiddleware.RequestHandler{useragent.NewHandler(ah.cfg.IsUsageDataEnabled)} + if ah.cfg == nil { + return nil, nil + } + if !ah.cfg.IsUsageDataEnabled { ah.logger.Debug("Usage data is disabled, skipping stats handlers") return requestHandlers, responseHandlers } - if ah.cfg == nil { - return nil, nil - } statusCodeEnabled := ah.cfg.IsStatusCodeEnabled var statsResponseHandlers []awsmiddleware.ResponseHandler diff --git a/extension/agenthealth/handler/stats/agent/agent_test.go b/extension/agenthealth/handler/stats/agent/agent_test.go index b53f8787d8..7a82904fa4 100644 --- a/extension/agenthealth/handler/stats/agent/agent_test.go +++ b/extension/agenthealth/handler/stats/agent/agent_test.go @@ -102,7 +102,7 @@ func TestMarshalWithStatusCodes(t *testing.T) { t.Run(name, func(t *testing.T) { got, err := testCase.stats.Marshal() assert.NoError(t, err) - assert.Contains(t, got, testCase.want) + assert.Contains(t, testCase.want, got) }) } } From 93ef8673bb2c47a2f3246000b80f57cc0c52e86e Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 10 Dec 2024 12:08:08 -0500 Subject: [PATCH 75/91] fixing race --- extension/agenthealth/extension.go | 7 -- extension/agenthealth/extension_test.go | 7 +- .../agenthealth/handler/stats/handler.go | 4 +- .../handler/stats/provider/statuscode.go | 114 +++++++++--------- .../handler/stats/provider/statuscode_test.go | 41 ++++++- internal/tls/testdata/server.crt | 42 +++---- internal/tls/testdata/server.key | 52 ++++---- internal/tls/testdata/tls-ca.crt | 50 ++++---- 8 files changed, 170 insertions(+), 147 deletions(-) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 6618a18955..4d4b9d3336 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -9,7 +9,6 @@ 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" ) @@ -26,10 +25,6 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa var responseHandlers []awsmiddleware.ResponseHandler requestHandlers := []awsmiddleware.RequestHandler{useragent.NewHandler(ah.cfg.IsUsageDataEnabled)} - if ah.cfg == nil { - return nil, nil - } - if !ah.cfg.IsUsageDataEnabled { ah.logger.Debug("Usage data is disabled, skipping stats handlers") return requestHandlers, responseHandlers @@ -42,8 +37,6 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa if ah.cfg.Stats != nil { statsRequestHandlers, statsResponseHandlers = stats.NewHandlers(ah.logger, *ah.cfg.Stats, statusCodeEnabled, true) - } else { - statsRequestHandlers, statsResponseHandlers = stats.NewHandlers(ah.logger, agent.StatsConfig{}, statusCodeEnabled, false) } requestHandlers = append(requestHandlers, statsRequestHandlers...) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 7760fdfd72..69fbf43a55 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -5,6 +5,7 @@ package agenthealth import ( "context" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "testing" "github.com/stretchr/testify/assert" @@ -14,15 +15,15 @@ import ( func TestExtension(t *testing.T) { ctx := context.Background() - cfg := &Config{IsUsageDataEnabled: true, IsStatusCodeEnabled: 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())) requestHandlers, responseHandlers := extension.Handlers() // user agent, client stats, stats - assert.Len(t, requestHandlers, 1) + assert.Len(t, requestHandlers, 3) // client stats - assert.Len(t, responseHandlers, 1) + assert.Len(t, responseHandlers, 2) cfg.IsUsageDataEnabled = false requestHandlers, responseHandlers = extension.Handlers() // user agent diff --git a/extension/agenthealth/handler/stats/handler.go b/extension/agenthealth/handler/stats/handler.go index 5d0c10e4db..a755f6f140 100644 --- a/extension/agenthealth/handler/stats/handler.go +++ b/extension/agenthealth/handler/stats/handler.go @@ -39,10 +39,10 @@ func NewHandlers(logger *zap.Logger, cfg agent.StatsConfig, statusCodeEnabled bo } if agentStatsEnabled { - clientStats := client.NewHandler(agent.NewOperationsFilter(cfg.Operations...)) + filter := agent.NewOperationsFilter(cfg.Operations...) + clientStats := client.NewHandler(filter) statsProviders = append(statsProviders, clientStats, provider.GetProcessStats(), provider.GetFlagsStats()) responseHandlers = append(responseHandlers, clientStats) - filter := agent.NewOperationsFilter(cfg.Operations...) stats := newStatsHandler(logger, filter, statsProviders) requestHandlers = append(requestHandlers, clientStats, stats) } diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 41a0768e63..41a4c0f86b 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -5,12 +5,12 @@ package provider import ( "context" + "log" "net/http" "sync" "time" "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) @@ -26,13 +26,12 @@ var ( // StatusCodeProvider handles processing of status codes and maintains stats. type StatusCodeProvider struct { - statsByOperation map[string]*[5]int - resetTimer *time.Timer + StatsByOperation map[string]*[5]int + ResetTimer *time.Timer statusCodeChan chan statusCodeEntry stopChan chan struct{} - shouldResetStats bool - mu sync.Mutex - wg sync.WaitGroup + ShouldResetStats bool + Mu sync.RWMutex } // statusCodeEntry represents a status code and its associated operation. @@ -41,12 +40,19 @@ type statusCodeEntry struct { statusCode int } -// GetStatusCodeStatusCodeProvider initializes and retrieves the singleton StatusCodeProvider. +// StatusCodeHandler is the handler that uses the StatusCodeProvider for processing. +type StatusCodeHandler struct { + StatusCodeProvider *StatusCodeProvider + filter agent.OperationsFilter +} + +// StatusCodeProvider methods + func GetStatusCodeStatsProvider() *StatusCodeProvider { StatusCodeProviderOnce.Do(func() { provider := &StatusCodeProvider{ - statsByOperation: make(map[string]*[5]int), - statusCodeChan: make(chan statusCodeEntry), + StatsByOperation: make(map[string]*[5]int), + statusCodeChan: make(chan statusCodeEntry, 1000), stopChan: make(chan struct{}), } @@ -57,11 +63,8 @@ func GetStatusCodeStatsProvider() *StatusCodeProvider { return statusCodeProviderSingleton } -// startProcessing begins processing status codes from the channel. func (sp *StatusCodeProvider) startProcessing() { - sp.wg.Add(1) go func() { - defer sp.wg.Done() for { select { case entry := <-sp.statusCodeChan: @@ -73,25 +76,27 @@ func (sp *StatusCodeProvider) startProcessing() { }() } -// EnqueueStatusCode adds a status code entry to the channel. func (sp *StatusCodeProvider) EnqueueStatusCode(operation string, statusCode int) { - sp.statusCodeChan <- statusCodeEntry{operation: operation, statusCode: statusCode} + select { + case sp.statusCodeChan <- statusCodeEntry{operation: operation, statusCode: statusCode}: + log.Printf("Successfully enqueued status code %d for operation %s", statusCode, operation) + default: + log.Printf("Warning: StatusCode channel full, dropping status code %d for operation %s", statusCode, operation) + } } -// processStatusCode updates the stats map for the given status code entry. func (sp *StatusCodeProvider) processStatusCode(entry statusCodeEntry) { - sp.mu.Lock() - defer sp.mu.Unlock() + sp.Mu.Lock() + defer sp.Mu.Unlock() - stats, exists := sp.statsByOperation[entry.operation] + stats, exists := sp.StatsByOperation[entry.operation] if !exists { stats = &[5]int{} - sp.statsByOperation[entry.operation] = stats + sp.StatsByOperation[entry.operation] = stats } sp.updateStatusCodeCount(stats, entry.statusCode) } -// updateStatusCodeCount updates the count for the specific status code. func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { switch statusCode { case 200: @@ -104,23 +109,43 @@ func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode in stats[3]++ case 429: stats[4]++ - default: - return } } -// startResetTimer initializes a reset timer to clear stats periodically. func (sp *StatusCodeProvider) startResetTimer() { - sp.resetTimer = time.AfterFunc(statusResetInterval, func() { - sp.shouldResetStats = true - sp.startResetTimer() + sp.ResetTimer = time.AfterFunc(statusResetInterval, func() { + sp.Mu.Lock() + sp.ShouldResetStats = true + sp.Mu.Unlock() }) } -// StatusCodeHandler is the handler that uses the StatusCodeProvider for processing. -type StatusCodeHandler struct { - StatusCodeProvider *StatusCodeProvider - filter agent.OperationsFilter +func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { + sp.Mu.Lock() + defer sp.Mu.Unlock() + + statusCodeMap := make(map[string][5]int) + if sp.ShouldResetStats { + for op, stats := range sp.StatsByOperation { + statusCodeMap[op] = *stats + } + sp.StatsByOperation = make(map[string]*[5]int) + sp.ShouldResetStats = false + } else { + for op, stats := range sp.StatsByOperation { + statusCodeMap[op] = *stats + } + } + + return agent.Stats{ + StatusCodes: statusCodeMap, + } +} + +// StatusCodeHandler methods + +func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsFilter) *StatusCodeHandler { + return &StatusCodeHandler{StatusCodeProvider: provider, filter: filter} } func (h *StatusCodeHandler) ID() string { @@ -131,12 +156,6 @@ func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { return awsmiddleware.After } -// NewStatusCodeHandler creates a new handler with the given StatusCodeProvider. -func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsFilter) *StatusCodeHandler { - return &StatusCodeHandler{StatusCodeProvider: provider, filter: filter} -} - -// HandleResponse enqueues the status code into the StatusCodeProvider's channel. func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { operation := awsmiddleware.GetOperationName(ctx) if !h.filter.IsAllowed(operation) { @@ -149,25 +168,4 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response } h.StatusCodeProvider.EnqueueStatusCode(operation, r.StatusCode) -} - -// Stats returns the aggregated stats for operations. -func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { - sp.mu.Lock() - defer sp.mu.Unlock() - statusCodeMap := make(map[string][5]int) - if sp.shouldResetStats { - for op, stats := range sp.statsByOperation { - statusCodeMap[op] = *stats - } - //Reset Stats - for key := range sp.statsByOperation { - delete(sp.statsByOperation, key) - } - sp.shouldResetStats = false - } - - return agent.Stats{ - StatusCodes: statusCodeMap, - } -} +} \ No newline at end of file diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 32b5c44535..c034029daa 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -4,14 +4,13 @@ package provider_test import ( - "testing" - - "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" + "github.com/stretchr/testify/assert" + "go.uber.org/zap" + "sync" + "testing" ) func TestNewHandlers(t *testing.T) { @@ -73,3 +72,35 @@ func TestSingleton(t *testing.T) { t.Errorf("Expected the state to be the same across instances, but it differs") } } + +func TestStatsResetRace(t *testing.T) { + sp := provider.GetStatusCodeStatsProvider() + + // Initialize the map in a thread-safe manner + sp.Mu.Lock() + sp.StatsByOperation = map[string]*[5]int{ + "op1": {1, 2, 3, 4, 5}, + "op2": {6, 7, 8, 9, 10}, + } + sp.Mu.Unlock() + + var wg sync.WaitGroup + wg.Add(2) + + // Goroutine 1: Continuously call the Stats method + go func() { + defer wg.Done() + for i := 0; i < 1000; i++ { + _ = sp.Stats("") + } + }() + + go func() { + defer wg.Done() + for i := 0; i < 1000; i++ { + sp.EnqueueStatusCode("op3", 200) + } + }() + + wg.Wait() +} diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..83e1ed950c 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtcXSqWmtWEB -LiHPhSU0HN5JWsfQZ2VkB8rFStQ8CwFG0DW9i6GSVsN1zmmzLQdVPAyP4Uzy8844 -/ceZsmlkIe6uk3BiRRNThUcJKlFJJroCBJ8y7AJA8s3teLWskRLik+0xintked6z -fMaQRgzOSPDc062QTODHB2IkShVZAeLh7OcCAwEAAaNnMGUwDgYDVR0PAQH/BAQD +MIIEGDCCAgCgAwIBAgIQXDZUGBvLX0EmQcNd6hSZVDANBgkqhkiG9w0BAQsFADAS +MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIxMDE3MDUzNFoXDTI0MTIxMDE4MDUz +NFowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANqgSmpVA1DLXWpWpDQXLwMLo56KZ/9By8CxNv19zMxo/tV6GSxX +ZVbgwCnSo+CfdGN2aoMBmVJysyJFMOiNLVn0i1MqRa319B1lHh7lH7wfa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A5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= +FoAU7WT3SFnwhWSzaR4ngkXIRmIMxGQwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG +9w0BAQsFAAOCAgEATMdDMq/VrEbnOFpkGUJwkJE9xslbLKuZbA+bi2xceW0s9QVk +89VyTwRO3SGxukz7SLd6d2ON62t4GBtJG2UjFc5pjlCmBHcazad28gAbaXmrFNVm +36xqEIRy3kI6fOrQvpRKIx3CBGZ59A59cJ4AL6crm05Zq6f7eV1An2qxB8EnJbqd +wdrdqQMhfT7DsZUd/Q4w0PGwqgrz4uKgKXDGIodgcCiBMyW6EJV15UZM/qJUrdcK +A2EMIi/HNze3vsN1Ak3ET5sMAGH7aaNrgLjHRw7llGGJqYtUdlNLonHe3bh24TZo +RukwK6kzUllXDJ2Cllf4GKJThzoCZCTEOUvYDITHu+IY5M8n8v6GTiL5+h7emINz +XgBSu0HfR8y4uLe6CwJvuuHOca8MOHn6t1UZiceTo6OVR/qj0p5PQy4IuCYrt0eg +gDe3k+iZPKFisdkYQMQGaGJSsPFC9CFiHWStTEz6aEf8tvcSi7Fan0Q9N8VchIT1 +mDSqEw7YNP6PBuOfEMzBYfxfhs3ME6XOoqily2kd/6HqamhoBW6BmrnNdMb+OscM +0mjsbmriOIVqEZXA572ms8+OUGdBe2nwd2BgzGuxUlk4CpAfgdQjNeGquQuK1rhm +S/+iXUUQpe24W0ex36AYCsPHeCIkTiLyq2LT2/ryyXbm8Dg0T2ck1Qi3iF0= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..80c08b9714 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CN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OcJdXDpOMzXsWvnxSuQVYrdpc8IVK84tN1AMYDOmiMXiT8wA5Z +yhRTJCd23lahuOA0iSWpekh4Bn7LOZ5bRh/ed/uZZlIMZ6MjJVFlt5CKhzRyr7Kj +mTgTcjcXwNvXoY8M/wy2/HRxCq8l/AOslpnk3d+76QKBgQDimRgE2WDQZ7pagCwd +jC/x2mA5oCtmjKmgWVTNdmT3d+ro+eHwsSelnfrfcXt8ugdRdWof72aWmLLYf2iu +p3aDgBYzXQ22FibwYlasaz5yObV1CY3C+Am63HiQMmaHV01gVBev+v2cr2lg5JUT +9VfWVT2dmw5a6DbR7vW7/BPYDwKBgQD2/mUKqm7Qw8fNBR+ezC0H4qn4N9tt+nrl +jRGG7T9VH4jraO99MklofbP4HZ3EMVS4hwy6cc2ZubNKLxYhVOBj7XO6KTCqUj3e +RN+xF9LRZDrTvocA+CCn46GPYUrM6Uj7HixUWxerbPRvL7DWhXxDil6/MC1g2Wqn +b7otY49WRwKBgHve2OR9uJD0w0iJ3JPieKsrh4K47kDHEEtZyiPvXs5xPXdScpLT +JStCK0xOiwTp5OpA11zR0DDvFIWJUL55SS4lrP0zFzW88lhiSaNDlQV4SpvKNzan +xRnjP/0DsEy4CtJn5fMLr+whb+fJzTz116iRPHeVtck4PA+TI7451Nc9AoGALjdl +4rwHZkrsDQHja8xatLoGAes5xPd0nZVq7SthiWUQMrR885lAQSwcS9YG2lo8txaW +HCEFTrl/webTpkMChdA9slzYvVYMO5X5oWKK0SGHHG3vRxAm1CN07KZQ38zbGhoI +Q3SUFkCZ8GAlH870dJLkrbOvGgs0uMXgOXQCsysCgYEAqiUaH/GV4XeVCASoCnQW +C7him0RqQXvgHJHLj3J6eLoGpB95oGQqmzvkMgCjrWYc126czT/2Q2nKOiZgW+PX +jZSaz+ATz8r4pVIu6eS6vq6OcLbs/QIfg+MlZhpYvaByueWDsnIhQK5x/eIJc6qc +su6G0sC0qbbq63eZEota92I= -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..d180b53087 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rMPbRsnGvIebh -FZsA60QnhuNiL6MowdJn17/Stl6Rs7cNV5zq3/WmaiipOoTcrKIMgA5ci23A69Pz -0WRfomoFsstRWHhimGrKrT5ewznEitvnWWxfiblmy21LTTJf6nrf7cD1B7Xlrfq+ -BORuHwSxyTapXw0HKSYPwjiSiijywWInS3QR3b5uvpyFy8rGfXI2PSTpnAsK/nws -38jUO7qPsj3AnwHpgLZe0XpGFqmemSmlPif0VT3Pn6CwsCpnEf7vFNYu+rmVjrqT -sBXv7qJMryXL4MDQcTsrX0+XDVWGlKrhVemPI94go86IuqASx7BldMounk9Pra70 -oRUZXsEbzBMGOyF/U3ZmCyJSryV4S+tkUckb/VInpmex1pkx15Q3EGmpRwTQ4/M/ -hGz0foplN1HGRQsVxuPt58Wj7/EW6BDrAgMBAAGjVzBVMA4GA1UdDwEB/wQEAwIC +IENBMB4XDTI0MTIxMDE3MDU0MloXDTM0MTIxMDE3MDU0MlowE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2LNcSgWL31ftnBywmqvVG7sh2RoCWvQoZnZ +QzH6EE1Dyq2fjLwCxKGyhGYT2qSalFYPNg3/0haqy1VP5noa5LZLa46Iv+dCxEY2 +Kgiy9Vbc/aZcX802KeEg5hyRnfYpDC+0Gz0q/ySI4je8Ulxl4NpUSJIA3fLbKrGU +8TMrTs0/mA+YXvQJKTl0Cs0gMuIcPzanihU= -----END CERTIFICATE----- From 504eabea717a0de8901fab8c66160b98076b7edb Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 10 Dec 2024 12:09:47 -0500 Subject: [PATCH 76/91] fixng tlx --- internal/tls/testdata/server.crt | 42 +++++++++++++------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 83e1ed950c..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQXDZUGBvLX0EmQcNd6hSZVDANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIxMDE3MDUzNFoXDTI0MTIxMDE4MDUz -NFowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANqgSmpVA1DLXWpWpDQXLwMLo56KZ/9By8CxNv19zMxo/tV6GSxX -ZVbgwCnSo+CfdGN2aoMBmVJysyJFMOiNLVn0i1MqRa319B1lHh7lH7wfa74e86nD -f51Lg/hqsjOktgIAO4P/5H6MUUp/UfjdHKbN+Y5JgDWEUW0d/WeQvQFZaXdOLaqa -rPaziL4LhsyCcWdAgv90LVjTXLfOYlKRnp/QA/inA/WuoUj4IOyQwx8qYoEeA5Yi -vfpWG4kKuAki78JNi9Xb15MKLfndo5h4956bi/KM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emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 80c08b9714..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDaoEpqVQNQy11q -VqQ0Fy8DC6Oeimf/QcvAsTb9fczMaP7VehksV2VW4MAp0qPgn3RjdmqDAZlScrMi -RTDojS1Z9ItTKkWt9fQdZR4e5R+8H2u+HvOpw3+dS4P4arIzpLYCADuD/+R+jFFK -f1H43RymzfmOSYA1hFFtHf1nkL0BWWl3Ti2qmqz2s4i+C4bMgnFnQIL/dC1Y01y3 -zmJSkZ6f0AP4pwP1rqFI+CDskMMfKmKBHgOWIr36VhuJCrgJIu/CTYvV29eTCi35 -3aOYePeem4vyjFUXjEXqor5aGE2l3qg3Fn87JkMXbEdvInPQcX2HF1k7/YKyMahJ -qhgRdvYpAgMBAAECggEAVhmedPX6Ek2lAoYQsPsYZqikzYFQp7Rv2/lu4LI0f6Qy -CDzHwTDCFk75Hv93zrS9j5ZJKELu8Qt/BNYfBtbir3ShkiUpv/MHKrRyAlTWBK6T -LhLef1Mg5P+if6j1eWU60NrqlXenszbrpN0zmUDrUb34tFK6DVmI/+I5tBnKdcbY -QJsIttpsUJ+n3EOcJdXDpOMzXsWvnxSuQVYrdpc8IVK84tN1AMYDOmiMXiT8wA5Z -yhRTJCd23lahuOA0iSWpekh4Bn7LOZ5bRh/ed/uZZlIMZ6MjJVFlt5CKhzRyr7Kj -mTgTcjcXwNvXoY8M/wy2/HRxCq8l/AOslpnk3d+76QKBgQDimRgE2W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aHK1RGo+iwKBgEST +hRx7fi/dK/xsl9oDyN4SPdPLlcmjPZ6/cb23RgUMZaAGiThmfu1hLU6pphMpkdKX +yzx6W9Wu2NTYPpT/WK8Ks4olYDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index d180b53087..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTIxMDE3MDU0MloXDTM0MTIxMDE3MDU0MlowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANdTPze5UJOI -axSh5fhK4eCSMmAzfAweuDBw0rUjpW2VFcZAkDztH1ksObo8JDT/zYsEedGbwFEW -beJeRZpqullPJSNqvmebVNa/IGVmZm0xAri3f79fNYVQujSPkBgo20XGsm2gE7K8 -2joWzG78RUotLf/YodAMb6qm3mnibMP8LP3UPtBnwqZM7Jdp75s4nLmtxkB4xaT+ -FAk+9VFPQgtSmHEKg2+Boyf2z8Bpupvsd05mYzR5tnlVO+kWCOSvVmmzrvUj9SZP -ze0cjAV6O92vp53iN7eSI8vY4A1LNUxWF85BjYgdI1SCphFnPpthj8snarJITSZ3 -/ckajJDDrML50idCOZMIyGlucq+dsWYp3nPH9Ysgonv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KPLtL2o0ilfnz3bJndL2MUjgVqK7GzkOGIhhXreG6/4WZ+oNReMzjw +uZ6zWKhUrTKfvt5J70Nzk+aPrwEzOOcb078QfrFvxElrkoyBz5LGF6HVdIVYUO94 +1DW1egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From a9006401f0f155a5f998edf0583ad0439b0220bb Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 10 Dec 2024 12:19:03 -0500 Subject: [PATCH 77/91] removing unnecessary logs --- extension/agenthealth/handler/stats/provider/statuscode.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 41a4c0f86b..2633a41ce5 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -5,7 +5,6 @@ package provider import ( "context" - "log" "net/http" "sync" "time" @@ -79,9 +78,8 @@ func (sp *StatusCodeProvider) startProcessing() { func (sp *StatusCodeProvider) EnqueueStatusCode(operation string, statusCode int) { select { case sp.statusCodeChan <- statusCodeEntry{operation: operation, statusCode: statusCode}: - log.Printf("Successfully enqueued status code %d for operation %s", statusCode, operation) default: - log.Printf("Warning: StatusCode channel full, dropping status code %d for operation %s", statusCode, operation) + return } } @@ -168,4 +166,4 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response } h.StatusCodeProvider.EnqueueStatusCode(operation, r.StatusCode) -} \ No newline at end of file +} From 91920eaba8d411f246b96b35098b68c24f60f834 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 10 Dec 2024 12:52:49 -0500 Subject: [PATCH 78/91] fixing lint --- extension/agenthealth/extension_test.go | 3 ++- .../agenthealth/handler/stats/provider/statuscode.go | 1 + .../handler/stats/provider/statuscode_test.go | 12 +++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 69fbf43a55..7a28c01a72 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -5,12 +5,13 @@ package agenthealth import ( "context" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "testing" "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) { diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 2633a41ce5..b17d571112 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -10,6 +10,7 @@ import ( "time" "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index c034029daa..9cdefd123d 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -4,13 +4,15 @@ package provider_test import ( + "sync" + "testing" + + "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" - "github.com/stretchr/testify/assert" - "go.uber.org/zap" - "sync" - "testing" ) func TestNewHandlers(t *testing.T) { @@ -73,7 +75,7 @@ func TestSingleton(t *testing.T) { } } -func TestStatsResetRace(t *testing.T) { +func TestStatsResetRace(_ *testing.T) { sp := provider.GetStatusCodeStatsProvider() // Initialize the map in a thread-safe manner From 5cacf23b85eb772697acbe459e4335cea08339ff Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 14:39:22 -0500 Subject: [PATCH 79/91] shouldn't add to stats map if ShouldResetStats is false --- .../agenthealth/handler/stats/provider/statuscode.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index b17d571112..bfa6052fc1 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -5,6 +5,7 @@ package provider import ( "context" + "log" "net/http" "sync" "time" @@ -97,6 +98,7 @@ func (sp *StatusCodeProvider) processStatusCode(entry statusCodeEntry) { } func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { + log.Printf("Updating status code count: statusCode=%d\n", statusCode) switch statusCode { case 200: stats[0]++ @@ -108,7 +110,13 @@ func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode in stats[3]++ case 429: stats[4]++ + default: + log.Printf("Unknown status code encountered: %d\n", statusCode) } + log.Printf( + "Updated stats for operation --: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", + stats[0], stats[1], stats[2], stats[3], stats[4], + ) } func (sp *StatusCodeProvider) startResetTimer() { @@ -130,10 +138,6 @@ func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { } sp.StatsByOperation = make(map[string]*[5]int) sp.ShouldResetStats = false - } else { - for op, stats := range sp.StatsByOperation { - statusCodeMap[op] = *stats - } } return agent.Stats{ From 97e82e1dbace6f6b18ab823bb05c04fb46031d7b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 14:48:15 -0500 Subject: [PATCH 80/91] moving around functions --- .../handler/stats/provider/statuscode.go | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index bfa6052fc1..279f238b0b 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -111,12 +111,8 @@ func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode in case 429: stats[4]++ default: - log.Printf("Unknown status code encountered: %d\n", statusCode) + return } - log.Printf( - "Updated stats for operation --: 200=%d, 400=%d, 408=%d, 413=%d, 429=%d", - stats[0], stats[1], stats[2], stats[3], stats[4], - ) } func (sp *StatusCodeProvider) startResetTimer() { @@ -151,14 +147,6 @@ func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsF return &StatusCodeHandler{StatusCodeProvider: provider, filter: filter} } -func (h *StatusCodeHandler) ID() string { - return statusHandlerID -} - -func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { - return awsmiddleware.After -} - func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { operation := awsmiddleware.GetOperationName(ctx) if !h.filter.IsAllowed(operation) { @@ -172,3 +160,11 @@ func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response h.StatusCodeProvider.EnqueueStatusCode(operation, r.StatusCode) } + +func (h *StatusCodeHandler) ID() string { + return statusHandlerID +} + +func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { + return awsmiddleware.After +} From c061e3dea074dc1ed6388a9eb1b0f5d35b0f0ce7 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 14:48:31 -0500 Subject: [PATCH 81/91] moving around functions --- extension/agenthealth/handler/stats/provider/statuscode.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 279f238b0b..dd8845591d 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -5,7 +5,6 @@ package provider import ( "context" - "log" "net/http" "sync" "time" @@ -98,7 +97,6 @@ func (sp *StatusCodeProvider) processStatusCode(entry statusCodeEntry) { } func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { - log.Printf("Updating status code count: statusCode=%d\n", statusCode) switch statusCode { case 200: stats[0]++ From 9023e49c3c05a44b5631636ea508aadce9818266 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 15:07:21 -0500 Subject: [PATCH 82/91] resolving comments --- extension/agenthealth/extension.go | 10 +++++++++- extension/agenthealth/extension_test.go | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 4d4b9d3336..371268b918 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -5,6 +5,7 @@ package agenthealth import ( "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "go.opentelemetry.io/collector/component" "go.uber.org/zap" @@ -34,11 +35,18 @@ func (ah *agentHealth) Handlers() ([]awsmiddleware.RequestHandler, []awsmiddlewa var statsResponseHandlers []awsmiddleware.ResponseHandler var statsRequestHandlers []awsmiddleware.RequestHandler + var statsConfig agent.StatsConfig + var agentStatsEnabled bool if ah.cfg.Stats != nil { - statsRequestHandlers, statsResponseHandlers = stats.NewHandlers(ah.logger, *ah.cfg.Stats, statusCodeEnabled, true) + 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...) diff --git a/extension/agenthealth/extension_test.go b/extension/agenthealth/extension_test.go index 7a28c01a72..d29be58aac 100644 --- a/extension/agenthealth/extension_test.go +++ b/extension/agenthealth/extension_test.go @@ -32,3 +32,22 @@ func TestExtension(t *testing.T) { 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() + // user agent + assert.Len(t, requestHandlers, 1) + assert.Len(t, responseHandlers, 0) + assert.NoError(t, extension.Shutdown(ctx)) +} From 94a4bd0fff7a7d59ab9871221133500405a094fb Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 15:24:25 -0500 Subject: [PATCH 83/91] pushing changes --- internal/tls/testdata/server.crt | 44 +++++++++++++-------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..a0001a315c 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtcXSqWmtWEB -LiHPhSU0HN5JWsfQZ2VkB8rFStQ8CwFG0DW9i6GSVsN1zmmzLQdVPAyP4Uzy8844 -/ceZsmlkIe6uk3BiRRNThUcJKlFJJroCBJ8y7AJA8s3teLWskRLik+0xintked6z -fMaQRgzOSPDc062QTODHB2IkShVZAeLh7OcCAwEAAaNnMGUwDgYDVR0PAQH/BAQD -AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgw -FoAUhscCtqKglSlRCx9YNN1D/Xz5MpMwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG -9w0BAQsFAAOCAgEAcxCGmWNtuM9V2yi0SOSLfxlSK7F1OS5qQuLWkZSDB1f+XG82 -PNDwSrV4J42qZcFfKrEt1HtS/Ws6VRlLrSnYArNSyQvNTeNf0q/rX9yO8wRcCM5K -sb8uv27xdawjN6F3z59rpJOf9ldX4ASrRZHzX/ttvvNcUdbCZsF5+h2EhcwNVVUa -Q6vlAW8u4Ik9HXxJ+W2HEdlSYWcCdTK4hDCtJhwqEBua1VdK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NVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB8GA1UdIwQY +MBaAFKqwh31G5E2HqvzJH0mZHMsphg0+MA8GA1UdEQQIMAaHBH8AAAEwDQYJKoZI +hvcNAQELBQADggIBAFc508Po9T6JqDRCMMM4Bx8EjGPVRmgxJbzpw5jYwajSFdEJ +UMEJ4+xNIHnzWls+wKOlVmqjRoxlwWfzEmlL+P+KwzU50RbTn8q5/7LQJiMct+Ay +NtAJoeBCJZTcpnrT4m8/ywusddaonV5Pfx/aEDKi+BPc5sgzTHhkrmXnucEas175 +ZTh6b53KCbXIcT2KPIEv68KIBpJePLjIKbTFi3Pp2tmqLAuWu27wApJLdP6e5fB2 +dCMCnf30FxFqFDzZqtu6h9qvfww77v3lW4X+9n1iDrtMUVZoBs4qf6GPYdBBtAOE +yJz579Phyma6/xcG7V3FAxvcvzd8LX44Gw2HnBZXlQcc38LqAIDYm2yn9ELXikjZ +9EMji53p2cRJg+xk2OG1qw4tfH6NYTUmdeMx+wLbbImzNw0o3QTM/Y0z+qcaFS7Q +gUQ7QWFGJWVJglqrvN3kwCK5OJDU8iigBgwY8+jUssNsM/sE40FBqgJP0wDJcE3Q +5c04TSUCS5yuvwHuqDWpgL22yoN8Mup/0c+vbNuF9Gn+mcvnJAPSjhsJAGR3qe/U +fzNQ7XBcAxInR/JtiBRc9Wqyd5AUXmEUJoVPLhtqisZkcQR1E1zIfwbC5TdQ9gRz +WoA7qpk2UN+eqOCkPomjmc45iNKuXSACThmhWsoXfrGVjoy/NeI6rOrM++13 -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..c15685e2f9 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSw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PxPx4HFPFt0c= -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..5eba737756 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsfH -vaH5kY8uTpKNIbmerYBCIt7X0QXcLOxk2CdnapKuIjaTML8og1/rMPbRsnGvIebh -FZsA60QnhuNiL6MowdJn17/Stl6Rs7cNV5zq3/WmaiipOoTcrKIMgA5ci23A69Pz -0WRfomoFsstRWHhimGrKrT5ewznEitvnWWxfiblmy21LTTJf6nrf7cD1B7Xlrfq+ -BORuHwSxyTapXw0HKSYPwjiSiijywWInS3QR3b5uvpyFy8rGfXI2PSTpnAsK/nws -38jUO7qPsj3AnwHpgLZe0XpGFqmemSmlPif0VT3Pn6CwsCpnEf7vFNYu+rmVjrqT -sBXv7qJMryXL4MDQcTsrX0+XDVWGlKrhVemPI94go86IuqASx7BldMounk9Pra70 -oRUZXsEbzBMGOyF/U3ZmCyJSryV4S+tkUckb/VInpmex1pkx15Q3EGmpRwTQ4/M/ -hGz0foplN1HGRQsVxuPt58Wj7/EW6BDrAgMBAAGjVzBVMA4GA1UdDwEB/wQEAwIC +I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cWiUsWEPwXPzgYWvdsF5+3AxIcpa +QSfMexmSYWc5tq8OW1oSHfWr8LrpF73VIcYVWVIr08zo29BvxJNysJ6hhPJHChYE ++Cq7vmg6mM7jB3wEwasFGjrzi07v77s88jimJfNrEnUj24GVjHyi1WNWLhv+QB/n +7hQYWCe9WKr3LS1JJJvrKOGfqWoRXNjN2TClsf0xr09veYoFYiJ3YM9nQ8wgCRcV +ZH3TeBYsftRIpaZ/UDm0AG5/721ehfIIMy4= -----END CERTIFICATE----- From acfde6b83fe37aabf4f118317eed72bda656592d Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 15:25:13 -0500 Subject: [PATCH 84/91] removing unecessar tls files --- internal/tls/testdata/server.crt | 44 +++++++++++++-------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index a0001a315c..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGTCCAgGgAwIBAgIRAOIAMVG7hbofWWWQ/48udfgwDQYJKoZIhvcNAQELBQAw -EjEQMA4GA1UEChMHUm9vdCBDQTAeFw0yNDEyMTEyMDIzMjVaFw0yNDEyMTEyMTIz -MjVaMBUxEzARBgNVBAoTCkt1YmVybmV0ZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQCtnNst3MnjTJaiGOSv6YjrvNCfIO94Tk6KhjSsHm8a6J46tn4Q -9eYYNj5k6RYJdvs6Ek0oXu77BcfpwVbv1DGehKjurwr8jur2mQzNoRM/gjiZhVcb -2Ve2SSQdTH9LtrL19Yn7VCo6fK9VtndAmEAn3lyv0HLcJP5+2NzUeirc55L8ql47 -HC6WlqUF7yuOKdDvkR/lVSvoW2w2UAMD+8rM7wZTM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WqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index c15685e2f9..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCtnNst3MnjTJai -GOSv6YjrvNCfIO94Tk6KhjSsHm8a6J46tn4Q9eYYNj5k6RYJdvs6Ek0oXu77Bcfp -wVbv1DGehKjurwr8jur2mQzNoRM/gjiZhVcb2Ve2SSQdTH9LtrL19Yn7VCo6fK9V -tndAmEAn3lyv0HLcJP5+2NzUeirc55L8ql47HC6WlqUF7yuOKdDvkR/lVSvoW2w2 -UAMD+8rM7wZTM7kx3pG9yco+W7u2zfWTNzy6kDmKdsntfvW+4AEraLm/jbdDzL+b -vRSpve6lK+r/wLwVn84AwqcMFDx3PYjMGWvfTUwrcTDaAOWgT18H3rvnHSYIfpAp -f+Dr0K4HAgMBAAECggEAcdrTNnF8CM96XdWba+3oeEi8PA9aXHhmM5wtwM64qFnz -Iqf5ZuAMRMaWBpGBfTWFLiFAboBLk13IK/k6LU/oNn/jVZx/xP9pAc1/Qv8mY1jg -C3YRmVbgmc+/mmNHe/zVwk2DbspUY0TPq5NdA4SVVlASUs6N9Odh6wgHUmTH5VP4 -FUikKJqvrZoNTNz/6js1RTFc3s/YtJkOAD6mtHmM6kWDE1n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gQCFa1i9luwJJ0m1VOyk5kML7gMhqcbneL8XYzzx2S7IMuyKpSNt +H++ZGWdXga2Vbq3bDmNQrSvDJLcWgEP6e9ZwwZH6WYgo9KA3036iTiF6fUx1doh5 +WB3M0M6SUTBFZzqzAq3vYYEWhns7A7Se/2w8N1+0HrRQnXu5aHK1RGo+iwKBgEST +hRx7fi/dK/xsl9oDyN4SPdPLlcmjPZ6/cb23RgUMZaAGiThmfu1hLU6pphMpkdKX +yzx6W9Wu2NTYPpT/WK8Ks4olYDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 5eba737756..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTIxMTIwMjMyOVoXDTM0MTIxMTIwMjMyOVowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALZ7bulhEhvT -3jRP1hIhmgdw+C3ou7QIaESHR8GJ+51G9vzVUCRN9MU/AYFq2pVAdw62zY0Ywq8r -1PxJsnEZq8nq3aRwj38jDtOq8nuHjQIJhacSD6BoyJTglenQ4mZEAJIgQ+qeeGHH -RZ/5no7rJJDaskZCDsd1DaxmlaOl9vdjBKy4XHrTWqbUaZs9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H3TeBYsftRIpaZ/UDm0AG5/721ehfIIMy4= +BBSWf0MJGMR6k7iAcZMQBOIFr+DoGjANBgkqhkiG9w0BAQsFAAOCAgEAHQib14b2 +y1b9Xa+lvvpyho887AF5LJMvcAaFA2qrZTgsct9YAUyP4jwHSMa82F34GF5zWm96 +wKGa2V7rykKPLtL2o0ilfnz3bJndL2MUjgVqK7GzkOGIhhXreG6/4WZ+oNReMzjw +uZ6zWKhUrTKfvt5J70Nzk+aPrwEzOOcb078QfrFvxElrkoyBz5LGF6HVdIVYUO94 +1DW1egaduIZCcmavO/CJ5QvzXMyiHkpuT0SoltvVFskoP9aS0OxnaQIrmNx+vajT +9zd/WMroxBh+z4Y6sQmy6zZF+rAPItgZNHncMt8AJBGUlAhjgtiP37v/+w5zKpOD +nXPKVf9mOPNdIDUBpzWxRXwkE1GI8kFjQsuiBD0RGNj1Db/m9lnxOX2B1vKOHRtg +Q3LQURMd3oNj2L4dnJG4SbfXi6CdxRPPtvAb2TJh8qIsL7WxDRey1uhmQWknYXso +kiQ1VgEBVwOXR3NGqlDboWYma/wDOtbaMSd0dl2m2PP7FXJNakUmrATNdwrWjuto +onSHblkkDI5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From d32172312883eb3e31bca309737def89196315e4 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 15:49:18 -0500 Subject: [PATCH 85/91] fixing lint --- extension/agenthealth/extension.go | 2 +- translator/tocwconfig/sampleConfig/prometheus_config_linux.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extension/agenthealth/extension.go b/extension/agenthealth/extension.go index 371268b918..213d252e91 100644 --- a/extension/agenthealth/extension.go +++ b/extension/agenthealth/extension.go @@ -5,11 +5,11 @@ package agenthealth import ( "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" "go.opentelemetry.io/collector/component" "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" ) diff --git a/translator/tocwconfig/sampleConfig/prometheus_config_linux.json b/translator/tocwconfig/sampleConfig/prometheus_config_linux.json index 3a87a824ce..7e7fe0f452 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_config_linux.json +++ b/translator/tocwconfig/sampleConfig/prometheus_config_linux.json @@ -4,6 +4,8 @@ }, "logs": { "metrics_collected": { + "emf": { + }, "prometheus": { "cluster_name": "TestCluster", "log_group_name": "/aws/ecs/containerinsights/TestCluster/prometheus", From b3ca2b915a80340a52a3d03d395cd9d029940e06 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 15:52:04 -0500 Subject: [PATCH 86/91] reverting a json --- translator/tocwconfig/sampleConfig/prometheus_config_linux.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/translator/tocwconfig/sampleConfig/prometheus_config_linux.json b/translator/tocwconfig/sampleConfig/prometheus_config_linux.json index 7e7fe0f452..3a87a824ce 100644 --- a/translator/tocwconfig/sampleConfig/prometheus_config_linux.json +++ b/translator/tocwconfig/sampleConfig/prometheus_config_linux.json @@ -4,8 +4,6 @@ }, "logs": { "metrics_collected": { - "emf": { - }, "prometheus": { "cluster_name": "TestCluster", "log_group_name": "/aws/ecs/containerinsights/TestCluster/prometheus", From 381bd530ef7a33f6719f056cf0feae33d97bc12f Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 18:45:45 -0500 Subject: [PATCH 87/91] Improved performance --- .../handler/stats/provider/statuscode.go | 129 ++++++++++-------- .../handler/stats/provider/statuscode_test.go | 37 +++-- 2 files changed, 93 insertions(+), 73 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index dd8845591d..6b228e0e6c 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,6 +1,3 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: MIT - package provider import ( @@ -10,7 +7,6 @@ import ( "time" "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" - "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) @@ -26,37 +22,28 @@ var ( // StatusCodeProvider handles processing of status codes and maintains stats. type StatusCodeProvider struct { - StatsByOperation map[string]*[5]int - ResetTimer *time.Timer - statusCodeChan chan statusCodeEntry - stopChan chan struct{} - ShouldResetStats bool - Mu sync.RWMutex + currentStats map[string]*[5]int + mu sync.RWMutex + statusCodeChan chan statusCodeEntry + stopChan chan struct{} + resetTicker *time.Ticker + completedStats chan map[string][5]int // unbuffered channel for completed stats } -// statusCodeEntry represents a status code and its associated operation. type statusCodeEntry struct { operation string statusCode int } -// StatusCodeHandler is the handler that uses the StatusCodeProvider for processing. -type StatusCodeHandler struct { - StatusCodeProvider *StatusCodeProvider - filter agent.OperationsFilter -} - -// StatusCodeProvider methods - func GetStatusCodeStatsProvider() *StatusCodeProvider { StatusCodeProviderOnce.Do(func() { provider := &StatusCodeProvider{ - StatsByOperation: make(map[string]*[5]int), - statusCodeChan: make(chan statusCodeEntry, 1000), - stopChan: make(chan struct{}), + currentStats: make(map[string]*[5]int), + statusCodeChan: make(chan statusCodeEntry, 1000), + stopChan: make(chan struct{}), + resetTicker: time.NewTicker(statusResetInterval), + completedStats: make(chan map[string][5]int), } - - provider.startResetTimer() provider.startProcessing() statusCodeProviderSingleton = provider }) @@ -69,7 +56,10 @@ func (sp *StatusCodeProvider) startProcessing() { select { case entry := <-sp.statusCodeChan: sp.processStatusCode(entry) + case <-sp.resetTicker.C: + sp.RotateStats() case <-sp.stopChan: + sp.resetTicker.Stop() return } } @@ -77,27 +67,20 @@ func (sp *StatusCodeProvider) startProcessing() { } func (sp *StatusCodeProvider) EnqueueStatusCode(operation string, statusCode int) { - select { - case sp.statusCodeChan <- statusCodeEntry{operation: operation, statusCode: statusCode}: - default: - return - } + sp.statusCodeChan <- statusCodeEntry{operation: operation, statusCode: statusCode} } func (sp *StatusCodeProvider) processStatusCode(entry statusCodeEntry) { - sp.Mu.Lock() - defer sp.Mu.Unlock() + sp.mu.Lock() + defer sp.mu.Unlock() - stats, exists := sp.StatsByOperation[entry.operation] + stats, exists := sp.currentStats[entry.operation] if !exists { stats = &[5]int{} - sp.StatsByOperation[entry.operation] = stats + sp.currentStats[entry.operation] = stats } - sp.updateStatusCodeCount(stats, entry.statusCode) -} -func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode int) { - switch statusCode { + switch entry.statusCode { case 200: stats[0]++ case 400: @@ -108,41 +91,67 @@ func (sp *StatusCodeProvider) updateStatusCodeCount(stats *[5]int, statusCode in stats[3]++ case 429: stats[4]++ - default: - return } } -func (sp *StatusCodeProvider) startResetTimer() { - sp.ResetTimer = time.AfterFunc(statusResetInterval, func() { - sp.Mu.Lock() - sp.ShouldResetStats = true - sp.Mu.Unlock() - }) -} - -func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { - sp.Mu.Lock() - defer sp.Mu.Unlock() +func (sp *StatusCodeProvider) RotateStats() { + sp.mu.Lock() + newStats := make(map[string][5]int, len(sp.currentStats)) + for op, stats := range sp.currentStats { + newStats[op] = *stats + } + sp.currentStats = make(map[string]*[5]int) + sp.mu.Unlock() - statusCodeMap := make(map[string][5]int) - if sp.ShouldResetStats { - for op, stats := range sp.StatsByOperation { - statusCodeMap[op] = *stats + // Try to merge with existing stats with a timeout + select { + case existingStats := <-sp.completedStats: + // Merge existing stats with new stats + for op, stats := range existingStats { + if currentStats, exists := newStats[op]; !exists { + newStats[op] = stats + } else { + var mergedStats [5]int + for i := range stats { + mergedStats[i] = currentStats[i] + stats[i] + } + newStats[op] = mergedStats + } } - sp.StatsByOperation = make(map[string]*[5]int) - sp.ShouldResetStats = false + case <-time.After(100 * time.Millisecond): + // Timeout if can't read from channel } - return agent.Stats{ - StatusCodes: statusCodeMap, + // Try to write with timeout + select { + case sp.completedStats <- newStats: + case <-time.After(100 * time.Millisecond): + // If we can't write, log error or handle appropriately + } +} + +func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { + select { + case stats := <-sp.completedStats: + return agent.Stats{ + StatusCodes: stats, + } + default: + return agent.Stats{} } } -// StatusCodeHandler methods +// StatusCodeHandler implementation remains the same +type StatusCodeHandler struct { + StatusCodeProvider *StatusCodeProvider + filter agent.OperationsFilter +} func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsFilter) *StatusCodeHandler { - return &StatusCodeHandler{StatusCodeProvider: provider, filter: filter} + return &StatusCodeHandler{ + StatusCodeProvider: provider, + filter: filter, + } } func (h *StatusCodeHandler) HandleResponse(ctx context.Context, r *http.Response) { diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 9cdefd123d..51c3781525 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -6,6 +6,7 @@ package provider_test import ( "sync" "testing" + "time" "github.com/stretchr/testify/assert" "go.uber.org/zap" @@ -75,34 +76,44 @@ func TestSingleton(t *testing.T) { } } -func TestStatsResetRace(_ *testing.T) { +func TestStatsResetRace(t *testing.T) { sp := provider.GetStatusCodeStatsProvider() - // Initialize the map in a thread-safe manner - sp.Mu.Lock() - sp.StatsByOperation = map[string]*[5]int{ - "op1": {1, 2, 3, 4, 5}, - "op2": {6, 7, 8, 9, 10}, - } - sp.Mu.Unlock() + // Pre-populate some initial stats and rotate + sp.EnqueueStatusCode("op1", 200) + sp.EnqueueStatusCode("op2", 400) + sp.RotateStats() var wg sync.WaitGroup - wg.Add(2) + wg.Add(3) - // Goroutine 1: Continuously call the Stats method + // Goroutine 1: Call Stats method go func() { defer wg.Done() - for i := 0; i < 1000; i++ { - _ = sp.Stats("") + for i := 0; i < 100; i++ { + stats := sp.Stats("") + if stats.StatusCodes != nil { + assert.Greater(t, len(stats.StatusCodes), 0) + } } }() + // Goroutine 2: Add new status codes go func() { defer wg.Done() - for i := 0; i < 1000; i++ { + 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() } From 402743b70c56bf1b4b9a731221c8a24e0eeef0c1 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 19:22:29 -0500 Subject: [PATCH 88/91] Improving performance --- .../handler/stats/provider/statuscode.go | 47 ++++++----------- .../handler/stats/provider/statuscode_test.go | 17 ++++-- internal/tls/testdata/server.crt | 42 +++++++-------- internal/tls/testdata/server.key | 52 +++++++++---------- internal/tls/testdata/tls-ca.crt | 50 +++++++++--------- 5 files changed, 102 insertions(+), 106 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index 6b228e0e6c..f0102642b3 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -27,7 +27,7 @@ type StatusCodeProvider struct { statusCodeChan chan statusCodeEntry stopChan chan struct{} resetTicker *time.Ticker - completedStats chan map[string][5]int // unbuffered channel for completed stats + completedStats chan agent.Stats // Changed to agent.Stats } type statusCodeEntry struct { @@ -40,9 +40,9 @@ func GetStatusCodeStatsProvider() *StatusCodeProvider { provider := &StatusCodeProvider{ currentStats: make(map[string]*[5]int), statusCodeChan: make(chan statusCodeEntry, 1000), - stopChan: make(chan struct{}), - resetTicker: time.NewTicker(statusResetInterval), - completedStats: make(chan map[string][5]int), + stopChan: make(chan struct{}), + resetTicker: time.NewTicker(statusResetInterval), + completedStats: make(chan agent.Stats, 1), // buffered channel } provider.startProcessing() statusCodeProviderSingleton = provider @@ -96,61 +96,46 @@ func (sp *StatusCodeProvider) processStatusCode(entry statusCodeEntry) { func (sp *StatusCodeProvider) RotateStats() { sp.mu.Lock() - newStats := make(map[string][5]int, len(sp.currentStats)) + newStats := agent.Stats{ + StatusCodes: make(map[string][5]int, len(sp.currentStats)), + } for op, stats := range sp.currentStats { - newStats[op] = *stats + newStats.StatusCodes[op] = *stats } sp.currentStats = make(map[string]*[5]int) sp.mu.Unlock() - // Try to merge with existing stats with a timeout + // Try to merge with existing stats select { case existingStats := <-sp.completedStats: - // Merge existing stats with new stats - for op, stats := range existingStats { - if currentStats, exists := newStats[op]; !exists { - newStats[op] = stats - } else { - var mergedStats [5]int - for i := range stats { - mergedStats[i] = currentStats[i] + stats[i] - } - newStats[op] = mergedStats - } - } - case <-time.After(100 * time.Millisecond): - // Timeout if can't read from channel + existingStats.Merge(newStats) + newStats = existingStats + default: } - // Try to write with timeout select { case sp.completedStats <- newStats: - case <-time.After(100 * time.Millisecond): - // If we can't write, log error or handle appropriately } } func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { select { case stats := <-sp.completedStats: - return agent.Stats{ - StatusCodes: stats, - } + return stats default: return agent.Stats{} } } -// StatusCodeHandler implementation remains the same type StatusCodeHandler struct { StatusCodeProvider *StatusCodeProvider - filter agent.OperationsFilter + filter agent.OperationsFilter } func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsFilter) *StatusCodeHandler { return &StatusCodeHandler{ StatusCodeProvider: provider, - filter: filter, + filter: filter, } } @@ -174,4 +159,4 @@ func (h *StatusCodeHandler) ID() string { func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { return awsmiddleware.After -} +} \ No newline at end of file diff --git a/extension/agenthealth/handler/stats/provider/statuscode_test.go b/extension/agenthealth/handler/stats/provider/statuscode_test.go index 51c3781525..247fecda15 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode_test.go +++ b/extension/agenthealth/handler/stats/provider/statuscode_test.go @@ -79,21 +79,32 @@ func TestSingleton(t *testing.T) { func TestStatsResetRace(t *testing.T) { sp := provider.GetStatusCodeStatsProvider() - // Pre-populate some initial stats and rotate + // 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: Call Stats method + // 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 { - assert.Greater(t, len(stats.StatusCodes), 0) + total := 0 + for _, counts := range stats.StatusCodes { + for _, count := range counts { + total += count + } + } + assert.Greater(t, total, 0, "Should have some status codes counted") } } }() diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 12424f7b27..1323d4fc78 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz -NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr -6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC -+fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39p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aXJ6WrdAMdH6Y1RDqVoVBW/fq7e3DDf +SIriv71v8bDDO64zLxyy/6LKmiplUlTNuI92Is8srywXNQ6c68A4dkXVOCPrJeVe +o5wRF3ed5lI5/n7VU0n+tCZq8ZGuzZLFcdDGckCbHXo1qncUZAmx/JB9LEzSu49C +HerKaB6WpTNa9XwMB3iOibHIY+95h+7sXGYN7Dv7qF4rTpxFHCqkxq71UB1GtJPc +JgPrKlQ+HV1QJ9lIUF/bAH1BC8CqoPp9vh+LsskQZJ+z7aU8ur/ct4oDxio= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0efcb40bb3..0da0298913 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD9zHhy7+7K2oJM -w/Ijo++WAibzqMrOCMvhFcGYSwHbcfivPSDia+hCpJ6CNPxWaMIOcbs+LBN7CvLk -FQI7TdLuDLuqEJveLkgeUcRr5AVer5/tycVHQvn4/iok4NMfqRKA8VV0qy94Bdmb -b3zXQtOfhQpN/aXRD3ubW54fiD7XF0qlprVhAS4hz4UlNBzeSVrH0GdlZAfKxUrU -PAsBRtA1vYuhklbDdc5psy0HVTwMj+FM8vPOOP3HmbJpZCHurpNwYkUTU4VHCSpR -SSa6AgSfMuwCQPLN7Xi1rJES4pPtMYp7ZHnes3zGkEYMzkjw3NOtkEzgxwdiJEoV -WQHi4eznAgMBAAECggEAGv7z1O32jXc+ouG40NewNVmXQRW0NMQ0w4Vn6UYZNXlj -BWjQJaVquCQAhEMUkDBma9jnHM7dZ5obie0+Joa5p/6Mu6M2oSR1IVx7Myq284Jk -1Ys/w7u5ESYf33pWmqiGQlbpSxamXvLoWaM7OT5veilRlkgjqiAmerj9EceRP5mR -aheVE5ctY5oZmdnvA9OcN6B8Oxk59EWEOECs8qAF/ChYfC8pWKOp4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upFObxz+R3imhY/3nU1Qyfl4TFoXPDqoaED03K3OG +U4/VinzMYL8bGzPQ9zXp0VP7DUZXUo+b3SCQf9bZC1wBQhVvMKf9FKm8QvqvbDX1 +D2spwXaCfAEPisiOKkYYILeLEA+ZYl0/GQEzSVg0U8PM50q1LujS3fOLtwKBgGBH +2yC9Psi/wZaFSucMh1ut31eMbwqGxRI/1fDox6ShUinlV9KRiwQ6jGaWDFYvKJwf +aNX7nAKOw6/THKf0di32ndv1TPOypS5mCOnp6jqzdc1cFDvIz0WMIlCAN4Rbq49r +Q9I5j4+QcHEeLGJ4ESi1vWza1vZUZZSPbmW3ay1pAoGAenUqqK8aIHc2VorHn/fo +Y6GEphoxSxZIoGtepqY8K+RaiYm1kWV+eP9L0ax0ClRe3UePhya8lkJkFkoy9Xic +82MEEzJMuqgQ1fikibdjgbU4ADrGWpLyqmeyODE6gZ95fUx9he2c9YEwtwqpD/Eg +1w+7G6X4eJbB64xQBNRYtyA= -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index 4b861f4f40..cfab48ef7f 100644 --- a/internal/tls/testdata/tls-ca.crt +++ b/internal/tls/testdata/tls-ca.crt @@ -1,29 +1,29 @@ -----BEGIN CERTIFICATE----- MIIE9jCCAt6gAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQKEwdSb290 -IENBMB4XDTI0MTAyMjIyMzYzOFoXDTM0MTAyMjIyMzYzOFowEjEQMA4GA1UEChMH -Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJrhBEDtGS+b -WAVvkFJuQAkDbCCToy39eJ+51ZS/wA1yuVde8JvtX95dZC0STNm7GnxfIwH8tOut -gc82vz2Bim2K1N9uzBDu6flGWXpzXZSSuMAj1q8MRhEs1OpfbLuqxMs/TAbGYGqa -6FPlUWCwMZvpiRpV+hGxRIp9OsAYn/oVUvuACXnADEwBUYnGL3c9FYPn+kkjpsf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ywv1JckNAec7Jg0FA2w= +BBQ0UD8B/N87xWejAkYwoIPdDKV4pzANBgkqhkiG9w0BAQsFAAOCAgEAUA+uXWYy +UkT+Fegv6YY0i3i6RJggi4RnVKUHsEYm4ZSax19AzG3dtx3p0bsiddvxRMDhWKJu +7XqSZk4N72OXKObM91Zbm8Cvwn/WmYnixS2i8CbSoNMnMfO4UHhMn/APlPPxsrNm +QVdwvYFEu8rRYzqlGw7uFKhnegcGwwKaa29X0uc5ShPpA//efnFrMohds6H7ddaA +nTe0cq6mv/F9rSKkvmXgQHf7EYvGp69U8uv+C0J15xf9DTSX8Cn1BkewyFQ1s44g +Sw0SKZyRDXXg73tmFQg422ggWAXL9V59TjfDwJLxqw5pqOc4Hf0cqlsq0eKnsbkQ +/znKGXZCnd7by4QLu0YB7C3Q/yCZymcuf+yZPd2HaBE9bOyyX7WbEi+UVZs8TCe7 +Aq/e8doJLI4eW+ApgjVrE9OUjH0b97X8JNwwRcTl3EdXnQ7rIvrVVW/pFeSGZwbK +SXvJK3CPAiqUnMY+5TIQlKoZnlf+/0oKHGdtfQcdF+z/vVfnKtvB3GYCPZ7BJjEO +lzNvAhByXZO8L3fyfKyVTMYn+CkQZEVIdJxhD1yueOcYl0b6HFWVD2aNY/DTho+O +/7A4yOacvIzl5JLo1z2Vv0mWIaULa+IMpcGwWRK+elMm/9jss7KvVhFKOwNSBkIy +StWhYIaoj8bh1bOazaQR7Rjl7Jwm+qGE4Xc= -----END CERTIFICATE----- From 6dc1193ffd089e2f0a23136a28910ff252e9b12f Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 19:23:59 -0500 Subject: [PATCH 89/91] Adding race --- internal/tls/testdata/server.crt | 42 +++++++++++++------------- internal/tls/testdata/server.key | 52 ++++++++++++++++---------------- internal/tls/testdata/tls-ca.crt | 50 +++++++++++++++--------------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/internal/tls/testdata/server.crt b/internal/tls/testdata/server.crt index 1323d4fc78..12424f7b27 100644 --- a/internal/tls/testdata/server.crt +++ b/internal/tls/testdata/server.crt @@ -1,24 +1,24 @@ -----BEGIN CERTIFICATE----- -MIIEGDCCAgCgAwIBAgIQVhMrHmE0jyAbPGIhIC6NpjANBgkqhkiG9w0BAQsFADAS -MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTIxMTIzNDcxNVoXDTI0MTIxMjAwNDcx -NVowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANYa4U4+GOEHa6ufpyNF8E22hZfTLSGbkTGzOy6S8ScKwF1bg77m -Xj0sVdMnnjY1VcQ/W8Ik0AzsG2KfIc0r8/8yvctS6NdVI6D9KhYT4AlkuYnRRV0A -2YxcHoZpbBQb6InrZ+0I895DorR0KGEGB1U2zFSYYnzo9Q62VRp1m/GPrhpUo0d7 -D1ud3goIOVe3iY5emXbKk2SyBUkXd6rR/11wyukOsYu1LS9/Nfpxx7w5PNekzRbE -XH5A4pqVnV7ecHNp6hr9fhDHUDzUbYCDE54Q/pR+i/lkyITiu9SafLAfcMEmlTN9 -PMowGeBq1C9CxFISI6FIfzb6Wp4CMpT4Q7cCAwEAAaNnMGUwDgYDVR0PAQH/BAQD +MIIEGDCCAgCgAwIBAgIQDfInHXLoKYcZoMZe0q/N9TANBgkqhkiG9w0BAQsFADAS +MRAwDgYDVQQKEwdSb290IENBMB4XDTI0MTAyMjIyMzYzNloXDTI0MTAyMjIzMzYz +NlowFTETMBEGA1UEChMKS3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAP3MeHLv7sragkzD8iOj75YCJvOoys4Iy+EVwZhLAdtx+K89IOJr +6EKknoI0/FZowg5xuz4sE3sK8uQVAjtN0u4Mu6oQm94uSB5RxGvkBV6vn+3JxUdC ++fj+KiTg0x+pEoDxVXSrL3gF2ZtvfNdC05+FCk39pdEPe5tbnh+IPtcXSqWmtWEB +LiHPhSU0HN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EfwAAATANBgkqhkiG +9w0BAQsFAAOCAgEAcxCGmWNtuM9V2yi0SOSLfxlSK7F1OS5qQuLWkZSDB1f+XG82 +PNDwSrV4J42qZcFfKrEt1HtS/Ws6VRlLrSnYArNSyQvNTeNf0q/rX9yO8wRcCM5K +sb8uv27xdawjN6F3z59rpJOf9ldX4ASrRZHzX/ttvvNcUdbCZsF5+h2EhcwNVVUa +Q6vlAW8u4Ik9HXxJ+W2HEdlSYWcCdTK4hDCtJhwqEBua1VdKwSdrlDZJPswAdCzv +CR3Fj4NsmPRDw8uCPIL4hwk5fbffcn3rZrsOXSMTKxvdyP+XBPKWEoIs6cxvdE3o +sG65EZeGpj0vLN+rLEbumkvgCAHACgVxvyDeJnajoA6lPNxfzby+9CmhLZfgaVbE +nVQTj8hkUW1gtvnAP3v1Zbe3QMhlqWqwfwD5MgtdQZQ1IwAojaHwt105amQLxESe +vxAQdabKNkW/HUOjKmxz0XtadCLAwPBhP9/j6rQrDVH62zjHmEOjU/WsJQflgLfh +VJ/oIhLTDdGHhamJabpBr6RroxJVXo+vjfUf5LUc5vw54emx7PWOW4opuL3cE6J/ +URmA9CJX4wBeYyEHHoHFlPD9vV5GxOFQ57UimQK/bNl5jh1zxPPAY0j5OwReJRGH +1mrzt6pfGQeYFHMXbkFA5HU5P7Q5VF0cDCef9s1bxglSiMsEDaLOOyKvJ/w= -----END CERTIFICATE----- diff --git a/internal/tls/testdata/server.key b/internal/tls/testdata/server.key index 0da0298913..0efcb40bb3 100644 --- a/internal/tls/testdata/server.key +++ b/internal/tls/testdata/server.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDWGuFOPhjhB2ur -n6cjRfBNtoWX0y0hm5ExszsukvEnCsBdW4O+5l49LFXTJ542NVXEP1vCJNAM7Bti -nyHNK/P/Mr3LUujXVSOg/SoWE+AJZLmJ0UVdANmMXB6GaWwUG+iJ62ftCPPeQ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rx85/g/RTKs38KTPy7W4g3bv8KBRhc +bjLzoYTl6esRAi8nMG5Fc/85t07hkVv+j5a1NccxgQKBgQD/y/tdH90C8CrAn9y5 +mgr+1QcqJeJWaBpNf+yBqtLbybl6uLY2OzbZtzllU+TDUVlKZB36t2GnG6EIRUcd +WTHUVq8zEIRtDBa12SZlJ08FrNFyKfBByehEOvMazTxb7rdGbiv5+XztCrcPUn1f +cu30v5nBRjqDxtiAbKccFcZPpwKBgQD+ABUQ0h3aX5qDqzhvSLNuqy+hOZPLsqva +VxsDsIlzzzGwmdf+m2Dn9JR/xJNMPf717LJs8IYIqW4KX/HW0pC3Y8fu/6h4fFM9 +ZpJkM2hjRu0uLxDWLc+AombMavFtkZ1tffKxv6mG7Ud163ulBIt24b701XfhR5UX +RWvWI50gwQKBgQCFa1i9luwJJ0m1VOyk5kML7gMhqcbneL8XYzzx2S7IMuyKpSNt +H++ZGWdXga2Vbq3bDmNQrSvDJLcWgEP6e9ZwwZH6WYgo9KA3036iTiF6fUx1doh5 +WB3M0M6SUTBFZzqzAq3vYYEWhns7A7Se/2w8N1+0HrRQnXu5aHK1RGo+iwKBgEST +hRx7fi/dK/xsl9oDyN4SPdPLlcmjPZ6/cb23RgUMZaAGiThmfu1hLU6pphMpkdKX +yzx6W9Wu2NTYPpT/WK8Ks4olYDjXaCnlrZR8BKz5E0Qq1OLej21ta0+5d+FbNSPA +o2u2EXEqUubVYxaUeYrpPAMiNzGNgAU+avTvvJaBAoGBAKely84irwZicpex79T/ +KYV3VOMYs6wETNSLdKkR9G2WEI4OsEw0qGm9pZXzS6lKOSXxW6fOzwI0/vhnmT4O +hBxeR+PriPFqD80ASXeVeVOEjMXQEjZ8Po+FfUvVu8zMNIPDwJ+hy94FE5kkDBte +vy6FnjMquTvekIsRwo/OOdz3 -----END PRIVATE KEY----- diff --git a/internal/tls/testdata/tls-ca.crt b/internal/tls/testdata/tls-ca.crt index cfab48ef7f..4b861f4f40 100644 --- a/internal/tls/testdata/tls-ca.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I5NvA+xUPXm4n7os3DHl6upvToVRTIDaWDBJLGyWEVw87y8+VPR0l5g +XpYDatVLlgC/Nz3Ggn3vepGPV25d7COORXI1EXfjn2PUx7lEK0MbaPfkqPC43Q1g +qubuxdWE+FRLgfs3Ywv1JckNAec7Jg0FA2w= -----END CERTIFICATE----- From bb73b8f573a2a862b9a8fab29173ea52e4ef1004 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 19:28:01 -0500 Subject: [PATCH 90/91] fixing ling --- .../handler/stats/provider/statuscode.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index f0102642b3..de3460e860 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider import ( @@ -7,6 +10,7 @@ import ( "time" "github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware" + "github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent" ) @@ -27,7 +31,7 @@ type StatusCodeProvider struct { statusCodeChan chan statusCodeEntry stopChan chan struct{} resetTicker *time.Ticker - completedStats chan agent.Stats // Changed to agent.Stats + completedStats chan agent.Stats } type statusCodeEntry struct { @@ -40,8 +44,8 @@ func GetStatusCodeStatsProvider() *StatusCodeProvider { provider := &StatusCodeProvider{ currentStats: make(map[string]*[5]int), statusCodeChan: make(chan statusCodeEntry, 1000), - stopChan: make(chan struct{}), - resetTicker: time.NewTicker(statusResetInterval), + stopChan: make(chan struct{}), + resetTicker: time.NewTicker(statusResetInterval), completedStats: make(chan agent.Stats, 1), // buffered channel } provider.startProcessing() @@ -129,13 +133,13 @@ func (sp *StatusCodeProvider) Stats(_ string) agent.Stats { type StatusCodeHandler struct { StatusCodeProvider *StatusCodeProvider - filter agent.OperationsFilter + filter agent.OperationsFilter } func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsFilter) *StatusCodeHandler { return &StatusCodeHandler{ StatusCodeProvider: provider, - filter: filter, + filter: filter, } } @@ -159,4 +163,4 @@ func (h *StatusCodeHandler) ID() string { func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { return awsmiddleware.After -} \ No newline at end of file +} From 1eae32a84eea79e41efdeee40137f3cbbe38d435 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 20:31:51 -0500 Subject: [PATCH 91/91] fixing lint --- extension/agenthealth/handler/stats/provider/statuscode.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index de3460e860..17daaee6b0 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -109,7 +109,6 @@ func (sp *StatusCodeProvider) RotateStats() { sp.currentStats = make(map[string]*[5]int) sp.mu.Unlock() - // Try to merge with existing stats select { case existingStats := <-sp.completedStats: existingStats.Merge(newStats) @@ -117,9 +116,7 @@ func (sp *StatusCodeProvider) RotateStats() { default: } - select { - case sp.completedStats <- newStats: - } + sp.completedStats <- newStats } func (sp *StatusCodeProvider) Stats(_ string) agent.Stats {