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

Transient error StatusCode.UNAVAILABLE encountered while exporting metrics #7242

Open
charliebarber opened this issue Feb 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@charliebarber
Copy link

I have Collector and an example app to send metrics from configured in a docker-compose.yaml file as below. I can't get the app to send metrics to the collector and keep getting the error: Transient error StatusCode.UNAVAILABLE encountered while exporting metrics.

Here is my docker-compose.yaml

version: "0.1.0"

services:
  # Collector
  collector:
    image: otel/opentelemetry-collector-contrib:latest
    container_name: collector
    command: ["--config=/conf/collector-config.yaml"]
    volumes:
      - ./collector/collector-config.yaml:/conf/collector-config.yaml
      - ./collector/metrics.json:/metrics.json
    ports:
      - "9464:9464" #prometheus
      - "4317:4317" #OLTP gRPC
      - "4318:4318" # OTLP HTTP
    environment:
      - PROMUSERNAME
      - PROMPASSWORD
      - PROMENDPOINT

  
  # Example Apps
  # Python
  flask_server:
    container_name: flask_server
    build:
      context: ./python
      dockerfile: ./examples/http_server/Dockerfile
    depends_on:
      collector:
        condition: service_started

And here is my collector config

extensions:
  basicauth/metrics:
    client_auth:
      username: ${env:PROMUSERNAME}
      password: ${env:PROMPASSWORD}

receivers:
  otlp:
    protocols:
      grpc:
      http:
        endpoint: "localhost:4318"
        cors:
          allowed_origins:
            - "http://*"
            - "https://*"

exporters:
  file:
    path: ./metrics.json
  prometheusremotewrite:
    auth:
      authenticator: basicauth/metrics
    endpoint: ${env:PROMENDPOINT}

service:
  extensions: [basicauth/metrics]
  pipelines:
    metrics:
      receivers: [otlp]
      exporters: [file, prometheusremotewrite]

I have tried without the endpoint, and endpoint set to 0.0.0.0:4318 with no luck.

Inspecting on docker confirms that the two containers are in fact on the same network. Any help is much appreciated. I would be willing to try and contribute to fix this if it is in fact a bug and if anyone has any pointers. Thank you.

@charliebarber charliebarber added the bug Something isn't working label Feb 26, 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
Projects
None yet
Development

No branches or pull requests

1 participant