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

Enable Universal Profiling as Enterprise feature #100333

Conversation

danielmitterdorfer
Copy link
Member

With this commit we ensure that Universal Profiling can only be used with an Enterprise license.

With this commit we ensure that Universal Profiling can only be used
with an Enterprise license.
@danielmitterdorfer danielmitterdorfer added >enhancement :UniversalProfiling/Application Elastic Universal Profiling REST APIs and infrastructure v8.12.0 labels Oct 5, 2023
@danielmitterdorfer danielmitterdorfer self-assigned this Oct 5, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/profiling (Team:Universal Profiling)

@elasticsearchmachine
Copy link
Collaborator

Hi @danielmitterdorfer, I've created a changelog YAML for you.

@danielmitterdorfer
Copy link
Member Author

Test instructions:

  1. Spin up a cluster as per the command line below. Set $LICENSE to trial or basic:
./gradlew :run -Drun.license_type=$LICENSE -Dtests.heap.size=4G -Dtests.es.xpack.profiling.templates.enabled=true --https
  1. Run the stacktraces API and observe that the call will fail for basic (HTTP 403) but succeed for trial (HTTP 200):
curl -k -X POST -u elastic-admin:elastic-password https://localhost:9200/_profiling/stacktraces\?pretty -H 'Content-Type: application/json' -d ' 
{
  "sample_size": 20000,
  "query": {                                           
    "bool": {
      "filter": [
        {
          "range": {
            "@timestamp": {
              "gte": "2023-01-01",
              "lt": "2023-10-05",
              "format": "yyyy-MM-dd"
            }
          }
        }
      ]
    }
  }
}
'

}
return Collections.singletonList(createLicenseChecker());
Copy link
Member Author

Choose a reason for hiding this comment

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

See #97546 (comment) for context on why we are returning the license checker in all cases (but no other components).

@danielmitterdorfer
Copy link
Member Author

elasticsearch-ci/part-1 failed because of #100251

@elasticsearchmachine run elasticsearch-ci/part-1

@danielmitterdorfer
Copy link
Member Author

BWC tests were flaky.

@elasticsearchmachine run elasticsearch-ci/bwc

@danielmitterdorfer
Copy link
Member Author

@elasticsearchmachine run elasticsearch-ci/part-2

@rockdaboot
Copy link
Contributor

The curl command works as expected together with your ES startup (fresh data).

But when starting ES with -Drun.license_type=trial --preserve-data, then restart ES with -Drun.license_type=basic --preserve-data, the new license is not recognized (curl gives 200 OK).

Also the other way round, first using basic and then trial, leaves me with a 403 response.

I guess this behavior has nothing to do with this PR, but want to make sure that this is expected.

@danielmitterdorfer
Copy link
Member Author

But when starting ES with -Drun.license_type=trial --preserve-data, then restart ES with -Drun.license_type=basic --preserve-data, the new license is not recognized (curl gives 200 OK).

Ah, good catch but that's expected. The license is preserved in the cluster state and it's not that you can change the license at will with a dev cluster using the run.license_type system property. Instead you'd need to use the licensing APIs for this.

@danielmitterdorfer
Copy link
Member Author

Also, I'm gonna look into these failing CI checks. Unfortunately most of the times it's just caused by unrelated flaky tests but I'll investigate these.

Copy link
Contributor

@rockdaboot rockdaboot left a comment

Choose a reason for hiding this comment

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

LGTM, testing the PR works as expected.

@danielmitterdorfer
Copy link
Member Author

@elasticsearchmachine run elasticsearch-ci/part-3

@danielmitterdorfer
Copy link
Member Author

@elasticsearchmachine run elasticsearch-ci/bwc

@danielmitterdorfer
Copy link
Member Author

@elasticsearchmachine run elasticsearch-ci/part-2

@danielmitterdorfer
Copy link
Member Author

danielmitterdorfer commented Oct 6, 2023

Merging main after I've muted several failing (flaky) tests in #100384 and #100385.

@danielmitterdorfer
Copy link
Member Author

@elasticmachine merge upstream

@danielmitterdorfer
Copy link
Member Author

build timed out (CI infrastructure issue)

@elasticsearchmachine run elasticsearch-ci/part-1

@danielmitterdorfer danielmitterdorfer merged commit dfaec0d into elastic:main Oct 9, 2023
13 checks passed
@danielmitterdorfer danielmitterdorfer deleted the profiling-enterprise-license branch October 9, 2023 05:58
danielmitterdorfer added a commit to danielmitterdorfer/elasticsearch that referenced this pull request Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement test-update-serverless :UniversalProfiling/Application Elastic Universal Profiling REST APIs and infrastructure v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants