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

[BUG]OTEL traces / logs / metrics - fix dynamic attributes mapping #118

Closed
YANG-DB opened this issue Feb 1, 2024 · 0 comments
Closed

[BUG]OTEL traces / logs / metrics - fix dynamic attributes mapping #118

YANG-DB opened this issue Feb 1, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@YANG-DB
Copy link
Member

YANG-DB commented Feb 1, 2024

What is the bug?
See Here

What is the bug?
OpenSearch generates an exception when I try to index a trace from opentelemetry-collector.

How can one reproduce the bug?

Send the following document to OpenSearch node that does not have ss4o_traces-t-a index

 {
          "attributes": {
            "data_stream": {
              "dataset": "default",
              "namespace": "namespace",
              "type": "span"
            },
            "http.flavor": "1.1",
            "http.method": "GET",
            "http.response_content_length": 11,
            "http.status_code": 200,
            "http.url": "http://demo-server:7080/hello",
            "net.peer.name": "demo-server",
            "net.peer.port": 7080
          },
          "droppedAttributesCount": 0,
          "droppedEventsCount": 0,
          "droppedLinksCount": 0,
          "endTime": "2023-07-31T16:45:20.599043855Z",
          "instrumentationScope": {
            "droppedAttributesCount": 0,
            "name": "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",
            "schemaUrl": "",
            "version": "0.42.0"
          },
          "kind": "Client",
          "name": "HTTP GET",
          "parentSpanId": "c9820c4fcb181475",
          "resource": {
            "host.name": "d4d3cf05c754",
            "process.command_args": [
              "/app/main"
            ],
            "process.executable.name": "main",
            "process.executable.path": "/app/main",
            "process.owner": "root",
            "process.pid": 1,
            "process.runtime.description": "go version go1.20.6 linux/amd64",
            "process.runtime.name": "go",
            "process.runtime.version": "go1.20.6",
            "service.name": "demo-client",
            "telemetry.sdk.language": "go",
            "telemetry.sdk.name": "opentelemetry",
            "telemetry.sdk.version": "1.16.0"
          },
          "spanId": "ae9dde3a42273a8b",
          "startTime": "2023-07-31T16:45:19.863862547Z",
          "status": {
            "code": "Unset",
            "message": ""
          },
          "@timestamp": "2023-07-31T16:45:19.863862547Z",
          "traceId": "2566150bc56619c53fc89b052eaba4f5",
          "traceState": ""
        }

e.g. echo '<bad_json>' | curl -X POST -H 'Content-Type:application/json' -d @- http://localhost:9200/ss4o_traces-t-a/_doc

results in the following error from OpenSearch:

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse",
    "caused_by": {
      "type": "class_cast_exception",
      "reason": "class org.opensearch.index.mapper.KeywordFieldMapper cannot be cast to class org.opensearch.index.mapper.ObjectMapper (org.opensearch.index.mapper.KeywordFieldMapper and org.opensearch.index.mapper.ObjectMapper are in unnamed module of loader 'app')"
    }
  },
  "status": 400
}

The document is indexed successfully when it's sent to an index that does not match SS4O index template.

What is the expected behavior?
Document index correctly - fix the traces / logs / metrics - mapping part for dynamic attributes mapping

What is your host/environment?
OpenSearch 2.8 and 2.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant