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

Fix license ID field name #14592

Merged
merged 2 commits into from
Nov 20, 2019

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Nov 18, 2019

This PR fixes the license ID field name from id to uid. This makes Metricbeat-indexed stack monitoring documents have parity with internally-indexed ones.

Testing this PR

  1. Spin up an Elasticsearch node.
  2. Build Metricbeat with this PR.
    cd $GOPATH/src/github.com/elastic/beats
    mage build
    
  3. Enable the elasticsearch-xpack Metricbeat module.
    ./metricbeat modules enable elasticsearch-xpack
    
  4. Run Metricbeat.
    ./metricbeat -e
    
  5. Verify that the latest document in .monitoring-es-*-mb-* of type: cluster_stats has the license.uid field.
    http://localhost:9200/.monitoring-*-mb-*/_search?q=type:cluster_stats&sort=timestamp:desc&size=1&filter_path=hits.hits._source.license
    

@ycombinator ycombinator requested a review from a team as a code owner November 18, 2019 19:38
@elasticmachine
Copy link
Collaborator

Pinging @elastic/stack-monitoring (Stack monitoring)

Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog maybe?

@ycombinator
Copy link
Contributor Author

Thanks @kaiyan-sheng. I added a CHANGELOG entry in fe2585cb27d1c92bda0004e1b9df1f87b8b1c80b.

@ycombinator ycombinator force-pushed the bugfix-mb-es-license-id branch from fe2585c to 0c6ceb3 Compare November 19, 2019 03:29
@ycombinator
Copy link
Contributor Author

jenkins, test this

Copy link
Contributor

@cachedout cachedout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and verified that uid does appear in the output:

{
    "hits": {
        "hits": [
            {
                "_source": {
                    "license": {
                        "cluster_needs_tls": false,
                        "issue_date": "2019-11-19T13:22:30.234Z",
                        "issue_date_in_millis": 1574169750234,
                        "issued_to": "elasticsearch",
                        "issuer": "elasticsearch",
                        "max_nodes": 1000,
                        "start_date_in_millis": -1,
                        "status": "active",
                        "type": "basic",
                        "uid": "5d88b23d-96ad-4bc4-8f0d-9983354e42c8"
                    }
                }
            }
        ]
    }
}

Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

POST .monitoring-es-7-mb-2019.11.19/_search?filter_path=hits.hits._source.license
{
  "size": 1,
  "sort": [
    {
      "timestamp": {
        "order": "desc"
      }
    }
  ],
  "query": {
    "term": {
      "type": {
        "value": "cluster_stats"
      }
    }
  }
}

yields:

{
  "hits" : {
    "hits" : [
      {
        "_source" : {
          "license" : {
            "status" : "active",
            "expiry_date" : "2019-12-19T01:55:30.299Z",
            "type" : "trial",
            "issue_date_in_millis" : 1574128530299,
            "max_nodes" : 1000,
            "issuer" : "elasticsearch",
            "start_date_in_millis" : -1,
            "cluster_needs_tls" : true,
            "uid" : "2a18bf38-a9bb-4e39-81b5-fb5fae31b426",
            "issued_to" : "elasticsearch",
            "expiry_date_in_millis" : 1576720530299,
            "issue_date" : "2019-11-19T01:55:30.299Z"
          }
        }
      }
    ]
  }
}

@ycombinator ycombinator force-pushed the bugfix-mb-es-license-id branch from 0c6ceb3 to 7935701 Compare November 19, 2019 16:35
@ycombinator
Copy link
Contributor Author

jenkins, test this

@ycombinator
Copy link
Contributor Author

Travis CI is green and Jenkins CI failures are unrelated. Merging.

@ycombinator ycombinator merged commit 157ea8f into elastic:master Nov 20, 2019
@ycombinator ycombinator removed the needs_backport PR is waiting to be backported to other branches. label Nov 20, 2019
ycombinator added a commit that referenced this pull request Nov 20, 2019
* Fix license ID field name (#14592)

* Fix license ID field name

* Adding CHANGELOG entry

* Fixing up CHANGELOG
ycombinator added a commit that referenced this pull request Nov 20, 2019
* Fix license ID field name (#14592)

* Fix license ID field name

* Adding CHANGELOG entry

* Fixing up CHANGELOG
ycombinator added a commit that referenced this pull request Dec 6, 2019
* Fix license ID field name (#14592)

* Fix license ID field name

* Adding CHANGELOG entry

* Fixing CHANGELOG
@ycombinator ycombinator deleted the bugfix-mb-es-license-id branch December 25, 2019 11:08
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
* Fix license ID field name (elastic#14592)

* Fix license ID field name

* Adding CHANGELOG entry

* Fixing up CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants