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

Elasticsearch: Make Elasticsearch job to ignore service(s) spans (#92) #93

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohammedalics
Copy link

@mohammedalics mohammedalics commented Jun 11, 2020

Signed-off-by: Mohammed Ammer mohammed.ali.cs@gmail.com

Resolves #92

Which problem is this PR solving?

Make Elasticsearch job to ignore service(s) spans

Short description of the changes

  • Introduce a new environment variable ES_SERVICES_IGNORE
  • Update the Elasticsearch job query to consider the names of the services in ES_SERVICES_IGNORE.

The current implemented query is like (considering 2h spans from now)

{
  "query": {
    "range": {
      "startTimeMillis": {
        "gte": "now-2h"
      }
    }
  }
}

By considering ignoring services (considering 2h spans from now and ignoring serviceX and serviceY), the query will be like

{
  "query": {
    "bool": {
      "must_not": [
        {
          "match_phrase": {
            "process.serviceName": {
              "query": "serviceX"
            }
          }
        },
        {
          "match_phrase": {
            "process.serviceName": {
              "query": "serviceY"
            }
          }
        }
      ],
      "must": [
        {
          "range": {
            "startTimeMillis": {
              "gte": "now-2h"
            }
          }
        }
      ]
    }
  }
}

…gertracing#92)

Signed-off-by: Mohammed Ammer <mohammed.ali.cs@gmail.com>
@pavolloffay
Copy link
Member

Excluding the services in the query has certainly some advantages.

I am wondering whether it would be better to filter the spans in the generic job so it works for all storages.

@mohammedalics
Copy link
Author

Good idea.

Would you prefer to consider it part of this PR or separate?

@pavolloffay
Copy link
Member

It can be done in this PR as it is implementing it.

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 this pull request may close these issues.

Elasticsearch: Make Elasticsearch job to ignore service(s) spans
2 participants