Skip to content

Commit

Permalink
Add debug line and make error message more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
lisguo committed Dec 20, 2023
1 parent 0fd499d commit ddb823a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion exporter/awsemfexporter/emf_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"strings"
"sync"

"github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/google/uuid"
"go.opentelemetry.io/collector/component"
Expand All @@ -20,6 +19,8 @@ import (
"go.opentelemetry.io/collector/pdata/pmetric"
"go.uber.org/zap"

"github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs"
)
Expand Down Expand Up @@ -123,6 +124,7 @@ func (emf *emfExporter) pushMetricsData(_ context.Context, md pmetric.Metrics) e
putLogEvent, err := translateGroupedMetricToEmf(groupedMetric, emf.config, defaultLogStream)
if err != nil {
if errors.Is(err, errMissingMetricsForEnhancedContainerInsights) {
emf.config.logger.Debug("Dropping empty putLogEvents for enhanced container insights", zap.Error(err))
continue
}
return err
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/metric_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (
fieldPrometheusMetricType = "prom_metric_type"
)

var errMissingMetricsForEnhancedContainerInsights = errors.New("Dropping empty putLogEvents for EnhancedContainerInsights")
var errMissingMetricsForEnhancedContainerInsights = errors.New("nil event detected with EnhancedContainerInsights enabled")

var fieldPrometheusTypes = map[pmetric.MetricType]string{
pmetric.MetricTypeEmpty: "",
Expand Down

0 comments on commit ddb823a

Please sign in to comment.