Skip to content

Headers for OtelExporter can't be set on runtime #12309

@daneatmastra

Description

@daneatmastra

This issue was created from Discord post 1465315385724375204:

Open in Discord

We are hosting on google cloud and use the OtelExporter:

new OtelExporter({
            provider: {
              custom: {
                endpoint: 'https://telemetry.googleapis.com',
                headers: await getAuthHeaders(),
                protocol: 'http/protobuf',
              },
            },
            resourceAttributes: {
              'gcp.project_id': process.env.GOOGLE_CLOUD_PROJECT,
              'service.name': 'ai',
            },
          }),

this works fine but the auth headers will expire after a certain time and it's now impossible to set new headers.

headers are now set like

const auth = new GoogleAuth({
  projectId: process.env.GOOGLE_CLOUD_PROJECT,
  scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
headers = await auth.getRequestHeaders();

it would be great if we can add code like in the mcpServer that has a "fetch" method to update headers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions