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

OTLP Exporter with http/json is not working #1763

Open
cijothomas opened this issue May 14, 2024 · 4 comments · May be fixed by #1835
Open

OTLP Exporter with http/json is not working #1763

cijothomas opened this issue May 14, 2024 · 4 comments · May be fixed by #1835
Assignees

Comments

@cijothomas
Copy link
Member

See :
#1752 (comment)

@cijothomas
Copy link
Member Author

@ramgdev Would you be able to look at this?

@ramgdev
Copy link
Contributor

ramgdev commented May 25, 2024

Tried reproducing this with the code form main. I am getting an error

OpenTelemetry metrics error occurred. Metrics error: metrics provider already shut down

@TommyCpp does the example at opentelemetry-otlp/examples/basic-otlp-http require any other setup besides an otlp receiver & exporter?

@ramgdev
Copy link
Contributor

ramgdev commented May 25, 2024

If I enable http-json in opentelemetry-otlp/examples/basic-otlp-http/Cargo.toml, it then shows an additional error. I'll focus on this error first.

OpenTelemetry metrics error occurred. Metrics error: metrics provider already shut down
OpenTelemetry trace error occurred. HTTP status client error (400 Bad Request) for url (http://localhost:4318/v1/traces)

@ramgdev
Copy link
Contributor

ramgdev commented May 27, 2024

Payload:

{
  "resourceSpans": [
    {
      "resource": {
        "attributes": [
          {
            "key": "service.name",
            "value": {
              "stringValue": "basic-otlp-example"
            }
          }
        ],
        "droppedAttributesCount": 0
      },
      "scopeSpans": [
        {
          "scope": {
            "name": "basic",
            "version": "",
            "attributes": [
              {
                "key": "scope-key",
                "value": {
                  "stringValue": "scope-value"
                }
              }
            ],
            "droppedAttributesCount": 0
          },
          "spans": [
            {
              "traceId": "4de8342687b6356073ec26a181b0126c",
              "spanId": "6cdde1503ab13747",
              "traceState": "",
              "parentSpanId": "7d7d136175a259eb",
              "flags": 1,
              "name": "Sub operation...",
              "kind": 1,
              "startTimeUnixNano": "1716776846360076000",
              "endTimeUnixNano": "1716776846360082000",
              "attributes": [
                {
                  "key": "another.key",
                  "value": {
                    "stringValue": "yes"
                  }
                }
              ],
              "droppedAttributesCount": 0,
              "events": [
                {
                  "timeUnixNano": "1716776846360080000",
                  "name": "Sub span event",
                  "attributes": [],
                  "droppedAttributesCount": 0
                }
              ],
              "droppedEventsCount": 0,
              "links": [],
              "droppedLinksCount": 0,
              "status": {
                "message": "",
                "code": 0
              }
            }
          ],
          "schemaUrl": ""
        }
      ],
      "schemaUrl": ""
    },
    {
      "resource": {
        "attributes": [
          {
            "key": "service.name",
            "value": {
              "stringValue": "basic-otlp-example"
            }
          }
        ],
        "droppedAttributesCount": 0
      },
      "scopeSpans": [
        {
          "scope": {
            "name": "basic",
            "version": "",
            "attributes": [
              {
                "key": "scope-key",
                "value": {
                  "stringValue": "scope-value"
                }
              }
            ],
            "droppedAttributesCount": 0
          },
          "spans": [
            {
              "traceId": "4de8342687b6356073ec26a181b0126c",
              "spanId": "7d7d136175a259eb",
              "traceState": "",
              "parentSpanId": "",
              "flags": 1,
              "name": "Main operation",
              "kind": 1,
              "startTimeUnixNano": "1716776846359907000",
              "endTimeUnixNano": "1716776846360086000",
              "attributes": [
                {
                  "key": "another.key",
                  "value": {
                    "stringValue": "yes"
                  }
                }
              ],
              "droppedAttributesCount": 0,
              "events": [
                {
                  "timeUnixNano": "1716776846359911000",
                  "name": "Nice operation!",
                  "attributes": [
                    {
                      "key": "bogons",
                      "value": "100"
                    }
                  ],
                  "droppedAttributesCount": 0
                }
              ],
              "droppedEventsCount": 0,
              "links": [],
              "droppedLinksCount": 0,
              "status": {
                "message": "",
                "code": 0
              }
            }
          ],
          "schemaUrl": ""
        }
      ],
      "schemaUrl": ""
    }
  ]
}

Response indicates an encoding error.

{"code":3,"message":"ReadObjectCB: expect { or n, but found \", error found in #10 byte of ...|\"value\": \"100\"\n     |..., bigger context ...| \"key\": \"bogons\",\n                      \"value\": \"100\"\n                    }\n                  ],\n  |..."}

@ramgdev ramgdev linked a pull request May 27, 2024 that will close this issue
4 tasks
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

Successfully merging a pull request may close this issue.

2 participants