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

unable to send traces with authentication #199

Open
Samyu09 opened this issue Apr 3, 2024 · 1 comment
Open

unable to send traces with authentication #199

Samyu09 opened this issue Apr 3, 2024 · 1 comment

Comments

@Samyu09
Copy link

Samyu09 commented Apr 3, 2024

i have configured auth server at openteleemtry end this way

config:
  extensions:
    basicauth/server:
      htpasswd:
        file: .htpasswd
        inline: |
          admin:admin
    basicauth/client:
      client_auth:
        username: admin
        password: admin
    health_check:
      endpoint: 0.0.0.0:13133
      check_collector_pipeline:
        enabled: true
        interval: "5m"
        exporter_failure_threshold: 5
    zpages:
      endpoint: 0.0.0.0:55679
  receivers:
    otlp:
      protocols:
        http:
          endpoint: 0.0.0.0:4318
          auth:
            authenticator: basicauth/server
        grpc:
          auth:
            authenticator: basicauth/server
          endpoint: 0.0.0.0:4317

and the github action to send traces is as follows

      - name: Export Trace
        uses: inception-health/otel-export-trace-action@latest
        with:
          otlpEndpoint: ${{ secrets.OTEL_ENDPOINT }}

          otlpHeaders: '{"Content-Type": "application/json", "authorization": "Basic ${{ secrets.BASIC_AUTH_TOKEN }}"}'

          githubToken: ${{ secrets.OTEL_TOK }}
          runId: ${{ github.event.workflow_run.id }}

any help ?? on customizing the otlpHeaders here so as to make it work???

@joschi
Copy link

joschi commented Nov 4, 2024

The otlpHeaders configuration setting is using comma-separated key=value pairs, see also https://github.com/inception-health/otel-export-trace-action?tab=readme-ov-file#action-inputs.

Your example should work like this:

      - name: Export Trace
        uses: inception-health/otel-export-trace-action@latest
        with:
          otlpEndpoint: ${{ secrets.OTEL_ENDPOINT }}
          otlpHeaders: Content-Type=application/json, authorization=Basic ${{ secrets.BASIC_AUTH_TOKEN }}
          githubToken: ${{ secrets.OTEL_TOK }}
          runId: ${{ github.event.workflow_run.id }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants