Skip to content

zipkin makes tags object disabled (enable = false) when creating indices in ES #46

@shiyishuoshuo

Description

@shiyishuoshuo

Describe the Bug

I set up a zipkin server to write spans to ES (our own firm setup) for both QA and PROD, it is very odd that the index mapping created for both QA and Prod is different, and for Prod the tags object field enabled is false which prevents that field being indexed when creating index pattern on ES Kibana Dashboard, but I double checked the config and zipkin server jar and they are exactly the same only the environment is different, would you mind advising where might went wrong

Attached mapping definition for both qa and prod:
Qa:

{
  "zipkin:span-2020-12-10": {
    "mappings": {
      "span": {
        "properties": {
          "_q": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "annotations": {
            "type": "object"
          },
          "duration": {
            "type": "long"
          },
          "id": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "kind": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "localEndpoint": {
            "properties": {
              "serviceName": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "name": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "remoteEndpoint": {
            "properties": {
              "ipv4": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "port": {
                "type": "long"
              }
            }
          },
          "tags": {
            "properties": {
              "env": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "error": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "http": {
                "properties": {
                  "status_code": {
                    "type": "text",
                    "fields": {
                      "keyword": {
                        "type": "keyword",
                        "ignore_above": 256
                      }
                    }
                  }
                }
              },
              "mvc": {
                "properties": {
                  "controller": {
                    "properties": {
                      "class": {
                        "type": "text",
                        "fields": {
                          "keyword": {
                            "type": "keyword",
                            "ignore_above": 256
                          }
                        }
                      },
                      "method": {
                        "type": "text",
                        "fields": {
                          "keyword": {
                            "type": "keyword",
                            "ignore_above": 256
                          }
                        }
                      }
                    }
                  }
                }
              },
              "userName": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "timestamp": {
            "type": "long"
          },
          "timestamp_millis": {
            "type": "long"
          },
          "traceId": {
            "type": "keyword"
          }
        }
      }
    }
  }
}

Prod:

 {
  "zipkin:span-2020-12-10": {
    "mappings": {
      "span": {
        "_source": {
          "excludes": [
            "_q"
          ]
        },
        "dynamic_templates": [
          {
            "strings": {
              "match": "*",
              "match_mapping_type": "string",
              "mapping": {
                "ignore_above": 256,
                "norms": false,
                "type": "keyword"
              }
            }
          }
        ],
        "properties": {
          "_q": {
            "type": "keyword"
          },
          "annotations": {
            "type": "object",
            "enabled": false
          },
          "duration": {
            "type": "long"
          },
          "id": {
            "type": "keyword",
            "ignore_above": 256
          },
          "kind": {
            "type": "keyword",
            "ignore_above": 256
          },
          "localEndpoint": {
            "dynamic": "false",
            "properties": {
              "serviceName": {
                "type": "keyword"
              }
            }
          },
          "name": {
            "type": "keyword"
          },
          "remoteEndpoint": {
            "dynamic": "false",
            "properties": {
              "serviceName": {
                "type": "keyword"
              }
            }
          },
          **"tags": {
            "type": "object",
            "enabled": false
          },**
          "timestamp": {
            "type": "long"
          },
          "timestamp_millis": {
            "type": "date",
            "format": "epoch_millis"
          },
          "traceId": {
            "type": "keyword"
          }
        }
      }
    }
  }
}

Also Attach the PROD version (failed version) of template definition:

{
    "zipkin:span_template": {
        "order": 0,
        "index_patterns": ["zipkin:span-*"],
        "settings": {
            "index": {
                "mapper": {
                    "dynamic": "false"
                },
                "requests": {
                    "cache": {
                        "enable": "true"
                    }
                },
                "number_of_shards": "5",
                "number_of_replicas": "1"
            }
        },
        "mappings": {
            "span": {
                "_source": {
                    "excludes": ["_q"]
                },
                "dynamic_templates": [{
                    "strings": {
                        "mapping": {
                            "type": "keyword",
                            "norms": false,
                            "ignore_above": 256
                        },
                        "match_mapping_type": "string",
                        "match": "*"
                    }
                }],
                "properties": {
                    "traceId": {
                        "type": "keyword",
                        "norms": false
                    },
                    "name": {
                        "type": "keyword",
                        "norms": false
                    },
                    "localEndpoint": {
                        "type": "object",
                        "dynamic": false,
                        "properties": {
                            "serviceName": {
                                "type": "keyword",
                                "norms": false
                            }
                        }
                    },
                    "remoteEndpoint": {
                        "type": "object",
                        "dynamic": false,
                        "properties": {
                            "serviceName": {
                                "type": "keyword",
                                "norms": false
                            }
                        }
                    },
                    "timestamp_millis": {
                        "type": "date",
                        "format": "epoch_millis"
                    },
                    "duration": {
                        "type": "long"
                    },
                    "annotations": {
                        "enabled": false
                    },
                    "tags": {
                        "enabled": false
                    },
                    "_q": {
                        "type": "keyword",
                        "norms": false
                    }
                }
            }
        },
        "aliases": {}
    }
}

QA version

{
zipkin:span_template: {
order: 0,
index_patterns: [
"zipkin:span-*"
],
settings: {
index: {
mapper: {
dynamic: "false"
},
requests: {
cache: {
enable: "true"
}
},
number_of_shards: "5",
number_of_replicas: "1"
}
},
mappings: {
span: {
properties: {
traceId: {
type: "keyword",
norms: false
},
annotations: {
enabled: true
},
tags: {
enabled: true
}
}
}
},
aliases: { }
}
}

QA and PROD are using different ES instance, but both are using ES 6.3 version, just want to understand how to make contents under tag object be indexed, we had some customized fields defined under tag eg who hit endpoint and which env, etc and we would like to leverage those fields for filter condition when we created Kibana Dashboard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions