-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Graph] Register graph usage #72041
[Graph] Register graph usage #72041
Conversation
💚 Build SucceededBuild metrics
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this so quickly @flash1293. The integration looks good to me. I'm not too familiar with the Graph code to comment on whether or not you're calling licenseState.notifyUsage('Graph')
in all situations, but the ones you have added LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, tested locally in Chrome, MacOS 10.14.6. notify function is triggered on API calls. Mission accomplished 👍
import { ILicense } from '../../../licensing/common/types'; | ||
import { checkLicense, GraphLicenseInformation } from '../../common/check_license'; | ||
|
||
export class LicenseState { | ||
private licenseInformation: GraphLicenseInformation = checkLicense(undefined); | ||
private subscription: Subscription | null = null; | ||
private observable: Observable<GraphLicenseInformation> | null = null; | ||
private _notifyUsage: LicensingPluginStart['featureUsage']['notifyUsage'] | null = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just an thought when viewing this, why not call it licenseNotifyUsage
to omit the _
@kobelb based on mailing-list discussion, there are two things I'm unsure about:
|
As long as we can always rely on Elasticsearch, we don't need to implement the I think we should be using the guiding question of "Is this a Kibana feature?" to make this decision. In some situations, the answer is clearly yes, for example APM Service Maps which is only available via Kibana. In situations where Kibana simply provides management screens for Elastisearch features, for example role's with document-level-security and field-level-security, the answer is no. And in other situations, there isn't a clear answer, like Graph... It's both a Kibana feature and an Elasticsearch feature, so I think it's best to represent it that way in the licensed feature usage APIs.
I think the way you've implemented this is fine. We'd like to know when a user substantially consumes one of our licensed features. If the user accidentally opens up the Graph application once to figure out what it was, I don't really consider this to be "actual usage". The fact that we're notifying usage based on the actual core functionality of the application is perfect. I could see us wanting usage to be notified when a user is rearranging existing nodes, but I don't think we absolutely have to. If my understanding is correct, if the user is actually using Graph, we'll be notified of their usage, which is the intent of this API.
When initially creating the licensed feature usage service, we decided to only implement it on the server. This was primarily out of laziness as we were unaware of any licensed Kibana features which we couldn't use a server-side method of determining when a feature is being actually used. I defended this decision with the reasoning that if we are only enforcing the licensing constraints in the browser, this is a rather weak enforcement that can generally be evaded by users, so we shouldn't be doing this in the first place. There's potential that there are errors in my thinking, and we should be exposing a client-side API, which would ideally be exposed by the licensing plugin. Do you feel that we're missing out on "substantial usage" by not being able to notify usage via the client-side? If so, I don't think we should block merging this PR, but we should be addressing the limitation in a subsequent PR. |
Thanks for the clarifications, @kobelb. I do not think we are missing out on "substantial usage" this way. Going to merge as is. |
* master: [Maps] 7.9 documenation updates (elastic#71893) docs: ✏️ add "Explore underlying data" user docs (elastic#70807) [Security Solution][Exceptions] - Remove initial add exception item button in builder (elastic#72215) Fix indentation level in code exploration doc (elastic#72274) register graph usage (elastic#72041) [Monitoring] Added a case for Alerting if security/ssl is disabled (elastic#71846)
* master: [Observability] Remove app logos (elastic#72259) Fix float percentiles line chart (elastic#71902) update chromedriver to 84 (elastic#72228) [esArchiver] actually re-delete the .kibana index if we lose recreate race (elastic#72354) [Maps] convert SavedGisMap to TS (elastic#72286) [DOCS] Removes occurrences of X-Pack Security and Reporting (elastic#72302) use WORKSPACE env var for stack_functional_integration tests, fix navigate path (elastic#71908) [Monitoring] Fix issue with ES node detail status (elastic#72298) [SIEM] Updates consumer in export_rule archive (elastic#72324) [kbn/dev-utils] add RunWithCommands utility (elastic#72311) [Security Solution][Endpoint][Exceptions] Only write manifest to policy when there are changes (elastic#72000) skip flaky suite (elastic#72339) [ML] Fix annotations pagination & change labels from letters to numbers (elastic#72204) [Lens] Fix switching with layers (elastic#71982) [Maps] 7.9 documenation updates (elastic#71893) docs: ✏️ add "Explore underlying data" user docs (elastic#70807) [Security Solution][Exceptions] - Remove initial add exception item button in builder (elastic#72215) Fix indentation level in code exploration doc (elastic#72274) register graph usage (elastic#72041) [Monitoring] Added a case for Alerting if security/ssl is disabled (elastic#71846)
This PR notifies the licensing plugin about usage of Graph apis.
@kobelb can you check whether it's used correctly?