# 502 when trying to export data to Grafana Cloud

**URL:** <https://community.grafana.com/t/502-when-trying-to-export-data-to-grafana-cloud/126853>\
**Category:** Grafana Cloud\
**Tags:** exporter, grafana-cloud, otel\
**Created:** [July 23, 2024, 6:30am UTC](https://community.grafana.com/t/502-when-trying-to-export-data-to-grafana-cloud/126853 "2024-07-23T06:30:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrishung](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@chrishung](https://community.grafana.com/u/chrishung)\
**Post date:** [July 23, 2024, 6:30am UTC](https://community.grafana.com/t/502-when-trying-to-export-data-to-grafana-cloud/126853/1 "2024-07-23T06:30:37Z")

</div>

Hi all,

I’m trying to build the monitoring infra for my web service.  
I’ve verified the following architecture works:

```auto
                                  loki
                            / \
backend ---> otel-collector ----- tempo ------> grafana
                            \ /
                                  mimir  

```

And now I want to evaluate the Grafana Cloud because I don’t want to maintain the 4 Grafana services (loki+tempo+mimir+grafana) by myself but I couldn’t quite figure it out.  
Below is my otel-collector config:

```auto
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

exporters:
  otlphttp/grafana_cloud:
    endpoint: https://otlp-gateway-prod-ap-northeast-0.grafana.net/otlp
    auth:
      authenticator: basicauth/grafana_cloud

extensions:
  basicauth/grafana_cloud:
    client_auth:
      username: <instnace_id>
      password: <token>
service:
  extensions: [basicauth/grafana_cloud]
  pipelines:
    logs:
      receivers: [otlp]
      #processors: []
      exporters: [otlphttp/grafana_cloud]
    traces:
      receivers: [otlp]
      #processors: []
      exporters: [otlphttp/grafana_cloud]
    metrics:
      receivers: [otlp]
      #processors: []
      exporters: [otlphttp/grafana_cloud]

```

I only set the env `OTEL_SERVICE_NAME: <name>` and pass the collector endpoint from config file.

And here’s the error when the collector trying to export data:

2024-07-23T06:15:43.661Z info exporterhelper/retry\_sender.go:118 Exporting failed. Will retry the request after interval. {“kind”: “exporter”, “data\_type”: “logs”, “name”: “otlphttp/grafana\_cloud”, “error”: “Throttle (0s), error: rpc error: code = Unavailable desc = error exporting items, request to [https://otlp-gateway-prod-ap-northeast-0.grafana.net/otlp/v1/logs](https://otlp-gateway-prod-ap-northeast-0.grafana.net/otlp/v1/logs) responded with HTTP Status Code 502”, “interval”: “34.082688279s”}

Not sure if I missed anything, but if anyone know how to fix it please let me know.  
Thanks for the help!

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [July 23, 2024, 7:17am UTC](https://community.grafana.com/t/502-when-trying-to-export-data-to-grafana-cloud/126853/2 "2024-07-23T07:17:26Z")

</div>

502 is server error (not your client error). So if you followed doc [Send data using OpenTelemetry Protocol (OTLP) | Grafana Cloud documentation](https://grafana.com/docs/grafana-cloud/send-data/otlp/send-data-otlp/) properly, then contact Grafana Cloud support (it seems to be their problem). Eventually, you can try to use dedicated endpoints for each signal and not more convenient single OTLP endpoint.

---

<div class="post-metadata">

**Author:** ![chrishung](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@chrishung](https://community.grafana.com/u/chrishung)\
**Post date:** [July 25, 2024, 3:47am UTC](https://community.grafana.com/t/502-when-trying-to-export-data-to-grafana-cloud/126853/3 "2024-07-25T03:47:24Z")

</div>

The issue was that the default access policy region is `us` (not sure if it’s configurable though) and my grafana stack was on japan.  
After deleting the stack and recreated a new one on us-west everything worked correctly.
