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

Update otel metrics index mappings #147

Open
ps48 opened this issue Jun 17, 2024 · 1 comment
Open

Update otel metrics index mappings #147

ps48 opened this issue Jun 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ps48
Copy link
Member

ps48 commented Jun 17, 2024

Bug Report

Which version of the demo you are using? (please provide either a specific
commit hash

Symptom

The bug is present in the OTEL metrics schema present in the data-prepper pipeline. This schema is different from the one released in the opensearch catalog metrics schema

current mapping in the OS after running the demo is as below:

{
  "ss4o_metrics-otel-errors-2024.06.14": {
    "mappings": {
      "_meta": {
        "component": "metrics",
        "type": "metrics",
        "version": "1.0.0",
        "correlations": [
          {
            "field": "spanId",
            "foreign-field": "spanId",
            "foreign-schema": "traces"
          },
          {
            "field": "traceId",
            "foreign-field": "traceId",
            "foreign-schema": "traces"
          }
        ],
        "catalog": "observability"
      },
      "dynamic_templates": [
        {
          "exemplar_attributes_map": {
            "path_match": "exemplar.attributes.*",
            "mapping": {
              "type": "keyword"
            }
          }
        },
        {
          "instrumentation_scope_attributes_map": {
            "path_match": "instrumentationScope.attributes.*",
            "mapping": {
              "type": "keyword"
            }
          }
        }
      ],
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "aggregationTemporality": {
          "type": "keyword",
          "ignore_above": 128
        },
        "attributes": {
          "properties": {
            "data_stream": {
              "properties": {
                "dataset": {
                  "type": "keyword",
                  "ignore_above": 128
                },
                "namespace": {
                  "type": "keyword",
                  "ignore_above": 128
                },
                "type": {
                  "type": "keyword",
                  "ignore_above": 56
                }
              }
            },
            "serviceName": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "traceId": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        },
        "bucketCount": {
          "type": "long"
        },
        "bucketCountsList": {
          "type": "long"
        },
        "buckets": {
          "type": "nested",
          "properties": {
            "count": {
              "type": "long"
            },
            "max": {
              "type": "float"
            },
            "min": {
              "type": "float"
            },
            "sum": {
              "type": "double"
            }
          }
        },
        "count": {
          "type": "long"
        },
        "description": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "exemplar": {
          "properties": {
            "spanId": {
              "type": "keyword",
              "ignore_above": 256
            },
            "time": {
              "type": "date"
            },
            "traceId": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "exemplars": {
          "properties": {
            "attributes": {
              "properties": {
                "attributes": {
                  "properties": {
                    "instrumentationScope": {
                      "properties": {
                        "name": {
                          "type": "text",
                          "fields": {
                            "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                            }
                          }
                        },
                        "version": {
                          "type": "text",
                          "fields": {
                            "keyword": {
                              "type": "keyword",
                              "ignore_above": 256
                            }
                          }
                        }
                      }
                    },
                    "resource": {
                      "properties": {
                        "attributes": {
                          "properties": {
                            "docker@cli@cobra@command_path": {
                              "type": "text",
                              "fields": {
                                "keyword": {
                                  "type": "keyword",
                                  "ignore_above": 256
                                }
                              }
                            },
                            "service@name": {
                              "type": "text",
                              "fields": {
                                "keyword": {
                                  "type": "keyword",
                                  "ignore_above": 256
                                }
                              }
                            },
                            "telemetry@sdk@language": {
                              "type": "text",
                              "fields": {
                                "keyword": {
                                  "type": "keyword",
                                  "ignore_above": 256
                                }
                              }
                            },
                            "telemetry@sdk@name": {
                              "type": "text",
                              "fields": {
                                "keyword": {
                                  "type": "keyword",
                                  "ignore_above": 256
                                }
                              }
                            },
                            "telemetry@sdk@version": {
                              "type": "text",
                              "fields": {
                                "keyword": {
                                  "type": "keyword",
                                  "ignore_above": 256
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "span": {
                      "properties": {
                        "attributes": {
                          "properties": {
                            "http@method": {
                              "type": "text",
                              "fields": {
                                "keyword": {
                                  "type": "keyword",
                                  "ignore_above": 256
                                }
                              }
                            },
                            "http@status_code": {
                              "type": "long"
                            },
                            "http@url": {
                              "type": "text",
                              "fields": {
                                "keyword": {
                                  "type": "keyword",
                                  "ignore_above": 256
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "status": {
                      "properties": {
                        "code": {
                          "type": "long"
                        }
                      }
                    }
                  }
                },
                "droppedAttributesCount": {
                  "type": "long"
                },
                "droppedEventsCount": {
                  "type": "long"
                },
                "droppedLinksCount": {
                  "type": "long"
                },
                "durationInNanos": {
                  "type": "long"
                },
                "endTime": {
                  "type": "date"
                },
                "kind": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "name": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "parentSpanId": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "serviceName": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "spanId": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "startTime": {
                  "type": "date"
                },
                "traceGroup": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "traceGroupFields": {
                  "properties": {
                    "durationInNanos": {
                      "type": "long"
                    },
                    "endTime": {
                      "type": "date"
                    },
                    "statusCode": {
                      "type": "long"
                    }
                  }
                },
                "traceId": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "traceState": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                }
              }
            },
            "spanId": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "time": {
              "type": "date"
            },
            "traceId": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "value": {
              "type": "float"
            }
          }
        },
        "explicitBoundsCount": {
          "type": "float"
        },
        "explicitBoundsList": {
          "type": "float"
        },
        "instrumentationScope": {
          "properties": {
            "droppedAttributesCount": {
              "type": "integer"
            },
            "name": {
              "type": "keyword",
              "ignore_above": 256
            },
            "schemaUrl": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "version": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "isMonotonic": {
          "type": "boolean"
        },
        "kind": {
          "type": "keyword",
          "ignore_above": 128
        },
        "max": {
          "type": "float"
        },
        "min": {
          "type": "float"
        },
        "monotonic": {
          "type": "boolean"
        },
        "name": {
          "type": "keyword",
          "ignore_above": 256
        },
        "negativeBuckets": {
          "type": "nested",
          "properties": {
            "count": {
              "type": "long"
            },
            "max": {
              "type": "float"
            },
            "min": {
              "type": "float"
            }
          }
        },
        "negativeOffset": {
          "type": "integer"
        },
        "observedTimestamp": {
          "type": "date_nanos"
        },
        "positiveBuckets": {
          "type": "nested",
          "properties": {
            "count": {
              "type": "long"
            },
            "max": {
              "type": "float"
            },
            "min": {
              "type": "float"
            }
          }
        },
        "positiveOffset": {
          "type": "integer"
        },
        "quantileValuesCount": {
          "type": "long"
        },
        "quantiles": {
          "properties": {
            "quantile": {
              "type": "double"
            },
            "value": {
              "type": "double"
            }
          }
        },
        "scale": {
          "type": "long"
        },
        "schemaUrl": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "startTime": {
          "type": "date"
        },
        "sum": {
          "type": "float"
        },
        "time": {
          "type": "date"
        },
        "unit": {
          "type": "keyword",
          "ignore_above": 128
        },
        "value": {
          "type": "float"
        },
        "value@double": {
          "type": "double"
        },
        "value@int": {
          "type": "integer"
        },
        "zeroCount": {
          "type": "long"
        }
      }
    }
  }
}

What is the expected behavior?
The main attributes of the metrics like serviceName, traceId and spanId should be keyword and not text datatype with the separate keyword mapping.

What is the actual behavior?
As mentioned above the current schema has serviceName, traceId and spanId with text mappings

Reproduce

Provide the minimum required steps to result in the issue you're observing.

Run the OTEL demo as is and see the mappings of the ss4o_metrics index.

Additional Context

Add any other context about the problem here.

@dblock
Copy link
Member

dblock commented Jul 8, 2024

Can this be closed? Did #148 or #162 fix this?

[Catch All Triage, attendees 1, 2, 3, 4, 5, 6, 7]

@dblock dblock removed the untriaged label Jul 8, 2024
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
None yet
Development

No branches or pull requests

2 participants