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

fileexporter is not encoding traceId according to specification #36095

Open
ncabanis opened this issue Oct 30, 2024 · 3 comments
Open

fileexporter is not encoding traceId according to specification #36095

ncabanis opened this issue Oct 30, 2024 · 3 comments
Labels
bug Something isn't working exporter/file needs triage New item requiring triage

Comments

@ncabanis
Copy link

Component(s)

exporter/file

What happened?

Description

Traces written using the fileexporter have traceId, spanId or parentSpanId not base64 encoded.
This leads to errors, when reading the JSON files back in.

Steps to Reproduce

Expected Result

Use proto3 standard defined JSON Mapping for mapping between protobuf and json. trace_id and span_id is base64 encoded in OTLP/HTTP+JSON.
See: https://github.com/open-telemetry/oteps/blob/main/text/0122-otlp-http-json.md#json-mapping

Example:

        "traceId": "bHE84Qqb0uYWr9oebVYwsA==",
        "spanId": "ygGTpeX0WXc=",
        "parentSpanId": "wcxj0FhL6CU=",

Actual Result

Example:

              "traceId": "345b5f5b69e9d28a1fac695cb5e20543",
              "spanId": "02765e6140c37e6c",
              "parentSpanId": "b8271c949767b3ca",

Collector version

v106.1

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

exporters:
      file:
        path: /data/traces.json
        rotation:
          max_days: 3
          max_megabytes: 10
          max_backups: 15
        format: json

Log output

No response

Additional context

No response

@ncabanis ncabanis added bug Something isn't working needs triage New item requiring triage labels Oct 30, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme
Copy link
Contributor

atoulme commented Nov 2, 2024

This might be a problem with pdata - the fileexporter just calls pdata functions to marshal JSON.

@marcinsiennicki95
Copy link

Any updates on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/file needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

3 participants