Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS adot collector (using otelp and emf exporter) not sending http.route #23331

Closed
Ryang20718 opened this issue Jun 12, 2023 · 0 comments
Closed
Labels
bug Something isn't working exporter/awsemf awsemf exporter needs triage New item requiring triage

Comments

@Ryang20718
Copy link

Ryang20718 commented Jun 12, 2023

Description

When using the otel adot collector with otelp, emf exporter enabled, the field http.route doesn't get ingested to cloudwatch

Steps to Reproduce

spin up an aws otel collector with aws emf being an exporter. instrument the sample app in something like

import(
	"go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin"
   "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
)


       // tracing setup here for otel
       
       // tracing middleware
       
	router := gin.New()
   router.Use(otelgin.Middleware(config.OtelServiceName))

	mux := http.NewServeMux()
	mux.Handle("/api/", router)

	otelHTTPHandler := otelhttp.NewHandler(mux, "")

       httpServer := &http.Server{
           ReadHeaderTimeout: 1 * time.Minute,
           Addr:              ":8080",
           Handler:           otelHTTPHandler,
       }
       return httpServer.ListenAndServe()

Expected Result

we should see http.route appear as a field in cloudwatch metrics

Actual Result

we don't see http.route appear as a field in cloudwatch metrics

Collector version

0.0.74

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
GO = 1.20.4

OpenTelemetry Collector configuration

extensions:
  health_check:
  pprof:
    endpoint: 0.0.0.0:1777

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317

processors:
  batch:

exporters:
  logging:
    loglevel: debug
  awsemf:
    region: 'us-west-2'

service:
  pipelines:
    metrics:
      receivers: [otlp]
      exporters: [awsemf]

  extensions: [pprof]
  telemetry:
    logs:
      level: debug

CMD:

    docker run --rm -p 4317:4317 -p 55680:55680 -p 8889:8888 \
      -e AWS_REGION=us-west-2 \
      -e AWS_PROFILE=default \
      -v ~/.aws:/root/.aws \
      -v "${PWD}/examples/docker/config-test.yaml":/otel-local-config.yaml \
      --name awscollector public.ecr.aws/aws-observability/aws-otel-collector:latest \
      --config otel-local-config.yaml;

Log output

{
    "OTelLib": "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",
    "Version": "1",
    "_aws": {
        "CloudWatchMetrics": [
            {
                "Namespace": "testing",
                "Dimensions": [
                    [
                        "OTelLib",
                        "http.scheme",
                        "http.status_code",
                        "net.sock.peer.port",
                        "net.host.name",
                        "net.host.port",
                        "net.sock.peer.addr",
                        "http.flavor",
                        "http.method",
                        "http.user_agent"
                    ],
                    [
                        "OTelLib"
                    ],
                    [
                        "OTelLib",
                        "http.status_code"
                    ],
                    [
                        "OTelLib",
                        "net.sock.peer.port"
                    ],
                    [
                        "OTelLib",
                        "http.scheme"
                    ],
                    [
                        "OTelLib",
                        "http.method"
                    ],
                    [
                        "OTelLib",
                        "http.user_agent"
                    ],
                    [
                        "OTelLib",
                        "net.host.name"
                    ],
                    [
                        "OTelLib",
                        "net.host.port"
                    ],
                    [
                        "OTelLib",
                        "net.sock.peer.addr"
                    ],
                    [
                        "OTelLib",
                        "http.flavor"
                    ]
                ],
                "Metrics": [
                    {
                        "Name": "http.server.duration"
                    }
                ]
            }
        ],
        "Timestamp": 1686603548366
    },
    "http.flavor": "1.1",
    "http.method": "GET",
    "http.scheme": "http",
    "http.server.duration": {
        "Max": 1.26,
        "Min": 0.14,
        "Count": 3,
        "Sum": 2.43
    },
    "http.status_code": "304",
    "http.user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
    "net.host.name": "localhost",
    "net.host.port": "8080",
    "net.sock.peer.addr": "172.19.0.1",
    "net.sock.peer.port": "55952"
}


### Additional context

It seems the EMF exporter is filtering out http.route even with default configurations? We're able to get http.route when using other exporters such as aws xray.
@Ryang20718 Ryang20718 added bug Something isn't working needs triage New item requiring triage labels Jun 12, 2023
@Ryang20718 Ryang20718 changed the title AWS adot collector (using otelp, xray, and emf exporter) not sending http.route AWS adot collector (using otelp and emf exporter) not sending http.route Jun 12, 2023
@codeboten codeboten added the exporter/awsemf awsemf exporter label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/awsemf awsemf exporter needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

2 participants