Not able to send traces to Grafana Cloud Instance

Hello Everyone,

I am using following code to send traces to grafana cloud instance

import base64
import json
import os
import time
import traceback
from datetime import datetime

from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import \
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from pydantic import BaseModel
from structlog.contextvars import bound_contextvars

def create_span_exporter_for_tempo():
    resource = Resource(attributes={
        "": "Service"
    username = "<instance-id>"
    password = "<api key / cloud policy token>"
    headers = {"Authorization": f"Basic {base64.b64encode(f'{username}:{password}'.encode('ascii')).decode('ascii')}"}

    tempo_exporter = OTLPSpanExporter(
    tracer = trace.get_tracer(__name__)
    # Create a span processor and add the exporter to it
    span_processor = BatchSpanProcessor(tempo_exporter)

    with tracer.start_as_current_span("test") as span:
        span.set_attribute("check", "works")

print("Executing tracing ...")
print("Executed tracing ...")

I tried cloud policy token as well as API key but none of them worked.
P.S. Cloud token has right permissions for sending traces.

Is there anything changed recently ?
As I have created this account today only.

Hello, do you see any errors? Also, perhaps you will want to point your application at the agent, and use the agent to send the traces to Grafana Cloud.