Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

feat(exporter) export enterprise license info #110

Merged
merged 5 commits into from
Feb 25, 2021
Merged

Conversation

fffonion
Copy link
Contributor

@fffonion fffonion commented Feb 8, 2021

# HELP kong_enterprise_license_expiration Unix epoch time when the license expires, the timestamp is substracted by 24 hours to avoid difference in timezone
# TYPE kong_enterprise_license_expiration gauge
kong_enterprise_license_expiration 1836691200
# HELP kong_enterprise_license_features License features features
# TYPE kong_enterprise_license_features gauge
kong_enterprise_license_features{feature="ee_plugins"} 1
kong_enterprise_license_features{feature="write_admin_api"} 1
# HELP kong_enterprise_license_signature Last 32 bytes of the license signautre in number
# TYPE kong_enterprise_license_signature gauge
kong_enterprise_license_signature 4.0089516347127e+40

@fffonion fffonion changed the title feat(exporter) export enterprise license expiration and signature feat(exporter) export enterprise license info Feb 8, 2021
Copy link

@mikefero mikefero left a comment

Choose a reason for hiding this comment

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

Looks good, just one small nit.

I did notice that dataplanes, admin_seats, product_subscription, and support_plan are not being parsed and added to the metrics collection which could add some value; don't think customer, license_key, and license_creation_date would add value though.

kong/plugins/prometheus/enterprise/exporter.lua Outdated Show resolved Hide resolved
@hbagdi
Copy link
Member

hbagdi commented Feb 9, 2021

This is Enterprise-specific code. I'm not sure why this is included here in an Open-source repository. I'd advise against including this here. And if we do decide to do this, please make sure you include the why in your commit message.

@mikefero mikefero self-requested a review February 9, 2021 15:52
@mikefero
Copy link

mikefero commented Feb 9, 2021

Good call; didn't even notice that. This should be moved into Enterprise code base instead.

fffonion and others added 2 commits February 19, 2021 16:13
Co-authored-by: Guilherme Salazar <gsz@acm.org>
@fffonion
Copy link
Contributor Author

@hbagdi @mikefero although this PR invokes enterprise code but there's no new enterprise feature being implemented here. if we want to move this to EE codebase, it will become either a EE fork, which won't work with the status_api model, or a dynamically loaded lua module that introduces headaches.

@fffonion
Copy link
Contributor Author

i agree we can add dataplanes . as admin_seats, product_subscription, and support_plan basically descibes the license but not controls the funcionality of kong (correct me if i'm wrong), i don't think it make much sense to monitor them.

@hbagdi
Copy link
Member

hbagdi commented Feb 22, 2021

@hbagdi @mikefero although this PR invokes enterprise code but there's no new enterprise feature being implemented here. if we want to move this to EE codebase, it will become either a EE fork, which won't work with the status_api model, or a dynamically loaded lua module that introduces headaches.

I understand the pain here but that's really the right thing to do. You could add hooks tot he OSS code-base to ease with the pain.

@gszr
Copy link
Member

gszr commented Feb 22, 2021

IMO this is not necessarily the 'wrong' approach, as there is no sensitive code being added -- the code here simply calls an enterprise-specific API. Moving it over to the enterprise side might add unnecessary maintenance burden.

@fffonion fffonion merged commit cfa60bd into master Feb 25, 2021
@fffonion fffonion deleted the feat/ee-license branch February 25, 2021 16:26
@locao locao removed the do not merge label Mar 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants