Skip to content

awsemf not handling httpstatus.check from httpcheckreceiver correctly #40928

Open
@DFE-mdv

Description

@DFE-mdv

Component(s)

exporter/awsemf

What happened?

Description

I'm trying to get synthetic healthchecks as metrics in CloudWatch with the configuration in my attachment. The issue is that awsemf doesn't seem to take the correct datapoint value:

When http.status_class is 2xx and the http.status_code is 200, the datapoint value should be 1, which is correct when I output it with the debug exporter:

Debug output looks like this:

Data point attributes:
     -> http.url: Str(http://www.github.com)
     -> http.status_code: Int(200)
     -> http.method: Str(GET)
     -> http.status_class: Str(2xx)
StartTimestamp: 2025-06-25 12:27:53.257405985 +0000 UTC
Timestamp: 2025-06-25 12:27:54.260995723 +0000 UTC
Value: 1

Now if I look at the stdout of the awsemf, I see that the same datapoint is declared as 0 even though http.status_class is 2xx and http.status_code is 200:

OTelLib=github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver Version=1 _aws={"CloudWatchMetrics":[{"Namespace":"app_httpcheck","Dimensions":[["http.method","http.status_class","OTelLib","http.url","http.status_code"]],"Metrics":[{"Name":"httpcheck.status","Unit":"","StorageResolution":60}]}],"Timestamp":1750854998791} http.method=GET http.status_class=2xx http.status_code=200 http.url=http://www.github.com httpcheck.status=0

Steps to Reproduce

I've added a working config as attachment.

Expected Result

  • awsemf interprets the datapoint according to the input of the httpcheck receiver

Collector version

v.0.128.0

Environment information

Environment

OS: AWS Linux 2023
Otel: v0.128.0
Container: otel/opentelemetry-collector-contrib:sha256-1ab0baba0ee3695d823c46653d8a6e8894896e668ce8bd7ebe002e948d827bc7.sig

OpenTelemetry Collector configuration

extensions: {}

receivers:
  httpcheck:
    collection_interval: 10s
    targets:
      - endpoint: http://www.github.com
        method: GET

processors:
  batch:
    timeout: 10s

exporters:
  awsemf:
    region: "ap-southeast-2"
    output_destination: stdout
    namespace: "app_httpcheck"
    dimension_rollup_option: "no_dimension_rollup"
    resource_to_telemetry_conversion:
      enabled: true

  debug:
    verbosity: detailed

service:
  extensions: []
  pipelines:
    metrics:
      receivers: [httpcheck]
      processors: [batch]
      exporters: [debug, awsemf]

Log output

# debug output uf debug exporter:
Descriptor:

     -> Name: httpcheck.status

     -> Description: 1 if the check resulted in status_code matching the status_class, otherwise 0.

     -> Unit: 1

     -> DataType: Sum

     -> IsMonotonic: false

     -> AggregationTemporality: Cumulative

NumberDataPoints #0

Data point attributes:

     -> http.url: Str(http://www.github.com)

     -> http.status_code: Int(200)

     -> http.method: Str(GET)

     -> http.status_class: Str(1xx)

StartTimestamp: 2025-06-25 12:27:53.257405985 +0000 UTC

Timestamp: 2025-06-25 12:27:54.260995723 +0000 UTC

Value: 0

NumberDataPoints #1

Data point attributes:

     -> http.url: Str(http://www.github.com)

     -> http.status_code: Int(200)

     -> http.method: Str(GET)

     -> http.status_class: Str(2xx)

StartTimestamp: 2025-06-25 12:27:53.257405985 +0000 UTC

Timestamp: 2025-06-25 12:27:54.260995723 +0000 UTC

Value: 1

NumberDataPoints #2

Data point attributes:

     -> http.url: Str(http://www.github.com)

     -> http.status_code: Int(200)

     -> http.method: Str(GET)

     -> http.status_class: Str(3xx)

StartTimestamp: 2025-06-25 12:27:53.257405985 +0000 UTC

Timestamp: 2025-06-25 12:27:54.260995723 +0000 UTC

Value: 0

NumberDataPoints #3

Data point attributes:

     -> http.url: Str(http://www.github.com)

     -> http.status_code: Int(200)

     -> http.method: Str(GET)

     -> http.status_class: Str(4xx)

StartTimestamp: 2025-06-25 12:27:53.257405985 +0000 UTC

Timestamp: 2025-06-25 12:27:54.260995723 +0000 UTC

Value: 0

NumberDataPoints #4

Data point attributes:

     -> http.url: Str(http://www.github.com)

     -> http.status_code: Int(200)

     -> http.method: Str(GET)

     -> http.status_class: Str(5xx)

StartTimestamp: 2025-06-25 12:27:53.257405985 +0000 UTC

Timestamp: 2025-06-25 12:27:54.260995723 +0000 UTC

Value: 0

	{"resource": {"service.instance.id": "fef094f1-10cd-4d73-8d4a-8810ea107867", "service.name": "otelcol-contrib", "service.version": "0.128.0"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "metrics"}


# stdout of awsemf exporter:

Value: 0

	{"resource": {"service.instance.id": "f6920aa2-aa69-4e0d-85a4-53c5f6bbfac6", "service.name": "otelcol-contrib", "service.version": "0.128.0"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "metrics"}

2025-06-25T12:36:47.792Z	info	Metrics	{"resource": {"service.instance.id": "f6920aa2-aa69-4e0d-85a4-53c5f6bbfac6", "service.name": "otelcol-contrib", "service.version": "0.128.0"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "metrics", "resource metrics": 1, "metrics": 2, "data points": 6}

OTelLib=github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver Version=1 _aws={"CloudWatchMetrics":[{"Namespace":"app_httpcheck","Dimensions":[["http.url","OTelLib"]],"Metrics":[{"Name":"httpcheck.duration","Unit":"Milliseconds","StorageResolution":60}]}],"Timestamp":1750854998791} http.url=http://www.github.com httpcheck.duration=8

2025-06-25T12:36:47.792Z	info	ResourceMetrics #0

OTelLib=github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver Version=1 _aws={"CloudWatchMetrics":[{"Namespace":"app_httpcheck","Dimensions":[["http.url","http.status_code","http.method","http.status_class","OTelLib"]],"Metrics":[{"Name":"httpcheck.status","Unit":"","StorageResolution":60}]}],"Timestamp":1750854998791} http.method=GET http.status_class=1xx http.status_code=200 http.url=http://www.github.com httpcheck.status=0

Resource SchemaURL: 

ScopeMetrics #0

OTelLib=github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver Version=1 _aws={"CloudWatchMetrics":[{"Namespace":"app_httpcheck","Dimensions":[["http.method","http.status_class","OTelLib","http.url","http.status_code"]],"Metrics":[{"Name":"httpcheck.status","Unit":"","StorageResolution":60}]}],"Timestamp":1750854998791} http.method=GET http.status_class=2xx http.status_code=200 http.url=http://www.github.com httpcheck.status=0

ScopeMetrics SchemaURL: 

OTelLib=github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver Version=1 _aws={"CloudWatchMetrics":[{"Namespace":"app_httpcheck","Dimensions":[["http.status_code","http.method","http.status_class","OTelLib","http.url"]],"Metrics":[{"Name":"httpcheck.status","Unit":"","StorageResolution":60}]}],"Timestamp":1750854998791} http.method=GET http.status_class=3xx http.status_code=200 http.url=http://www.github.com httpcheck.status=0

InstrumentationScope github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver 0.128.0

�

0

OTelLib=github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver Version=1 _aws={"CloudWatchMetrics":[{"Namespace":"app_httpcheck","Dimensions":[["OTelLib","http.url","http.status_code","http.method","http.status_class"]],"Metrics":[{"Name":"httpcheck.status","Unit":"","StorageResolution":60}]}],"Timestamp":1750854998791} http.method=GET http.status_class=4xx http.status_code=200 http.url=http://www.github.com httpcheck.status=0

OTelLib=github.com/open-telemetry/opentelemetry-collector-contrib/receiver/httpcheckreceiver Version=1 _aws={"CloudWatchMetrics":[{"Namespace":"app_httpcheck","Dimensions":[["http.status_class","OTelLib","http.url","http.status_code","http.method"]],"Metrics":[{"Name":"httpcheck.status","Unit":"","StorageResolution":60}]}],"Timestamp":1750854998791} http.method=GET http.status_class=5xx http.status_code=200 http.url=http://www.github.com httpcheck.status=0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions