-1

I am running ADOT collector on local using the docker run command :

docker run --rm -p 4318:4318 -p 55680:55680 -p 8889:8888 \
  -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" \
  -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" \
  -e AWS_REGION=${AWS_REGION} \
  -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;

the config file is :

# extensions:
#   health_check:
#   pprof:
#     endpoint: 0.0.0.0:1777

receivers:
  otlp:
    protocols:
      http:
        endpoint: localhost:4318

processors:
  batch:

exporters:
  logging:
    loglevel: debug
  # awsxray:
  #   region: 'us-east-1'
  awsemf:
    region: 'us-east-1'
    output_destination: stdout

service:
  pipelines:
    # traces:
    #   receivers: [otlp]
    #   exporters: [awsxray]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging]

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

The collector logs :

2023/08/21 17:30:31 ADOT Collector version: v0.32.0
2023/08/21 17:30:31 found no extra config, skip it, err: open /opt/aws/aws-otel-collector/etc/extracfg.txt: no such file or directory
2023/08/21 17:30:31 attn: users of the statsd receiver please refer to https://github.com/aws-observability/aws-otel-collector/issues/2249 in regards to an ADOT Collector v0.33.0 breaking change
2023-08-21T17:30:31.245Z    info    service/telemetry.go:84 Setting up own telemetry...
2023-08-21T17:30:31.247Z    info    service/telemetry.go:201    Serving Prometheus metrics  {"address": ":8888", "level": "Basic"}
2023-08-21T17:30:31.247Z    info    exporter@v0.82.0/exporter.go:275    Development component. May change in the future.    {"kind": "exporter", "data_type": "metrics", "name": "logging"}
2023-08-21T17:30:31.249Z    warn    loggingexporter@v0.82.0/factory.go:98   'loglevel' option is deprecated in favor of 'verbosity'. Set 'verbosity' to equivalent value to preserve behavior.  {"kind": "exporter", "data_type": "metrics", "name": "logging", "loglevel": "debug", "equivalent verbosity level": "Detailed"}
2023-08-21T17:30:31.257Z    info    service/service.go:132  Starting aws-otel-collector...  {"Version": "v0.32.0", "NumCPU": 4}
2023-08-21T17:30:31.258Z    info    extensions/extensions.go:30 Starting extensions...
2023-08-21T17:30:31.259Z    info    otlpreceiver@v0.82.0/otlp.go:101    Starting HTTP server    {"kind": "receiver", "name": "otlp", "data_type": "metrics", "endpoint": "localhost:4318"}
2023-08-21T17:30:31.264Z    info    service/service.go:149  Everything is ready. Begin running and processing data.

The collector seems to start but when I ping http://localhost:4318, I get unknown host message

Could it be an issue with docker networking, although I have opened the port.

Could it be that the ADOT collector image doesn't expose port 4318

Rishabhg
  • 83
  • 6
  • 1
    Can share the collector log file? – Michael Hausenblas Aug 21 '23 at 20:37
  • Thanks for sharing the logs and they show that the collector doesn’t pick up your config, follow https://aws-otel.github.io/docs/setup/docker-images for details how to provide the config file. – Michael Hausenblas Aug 22 '23 at 07:27
  • Hey actually it was picking up the config, the issue seems to be was that the docker image doesn't expose 4318 port, it exposes 4317 which is the grpc port by default. So I changed my application code to use the grpc oltp metric exporter instead of http and changed http to grpc in config file and it worked. Thanks for the help – Rishabhg Aug 22 '23 at 08:42

0 Answers0