Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
insights-analytics-collector
Advanced tools
This package helps with collecting data by user-defined collector methods. It packs collected data to one or more tarballs and sends them to user-defined URL.
Some data and classes has to be implemented. By function:
By Classes:
@register
decorator, one with config=True, format='json'
Entrypoint with "gather()" method.
Collector is an Abstract class, implement abstract methods.
_package_class
: Returns class of your implementation of Package_is_valid_license
: Check for valid license specific to your service_is_shipping_configured
: Check if shipping to cloud is configured_last_gathering
: returns datetime. Loading last successful run from some persistent storage_save_last_gather
: Persisting last successful run_load_last_gathered_entries
: Has to fill dictionary self.last_gathered_entries
. Load from persistent storage
Dict contains keys equal to collector's registered functions' keys (with @register decorator)_save_last_gathered_entries
: Persisting self.last_gathered_entries
An example can be found in Test collector
One package represents one .tar.gz
file which will be uploaded to Analytics.
Registered collectors are placed to collections as JSON/CSV files this way:
@register(fnc_slicing=...)
CsvFileSplitter
in the collector function.How are files included into packages:
@register()
decorator@register()
decoratorNumber of packages (tarballs) is bigger of:
See the test_gathering.py for details
Package is also abstract class. You have to implement basically info for POST request to cloud.
PAYLOAD_CONTENT_TYPE
: contains registered content type for cloud's ingress serviceMAX_DATA_SIZE
: maximum size in bytes of uncompressed data for one tarball. Ingress limits uploads to 100MB. Defaults to
200MB.get_ingress_url
: Cloud's ingress service URL_get_rh_user
: User for POST request_get_rh_password
: Password for POST request_get_x_rh_identity
: X-RH Identity Used for local testing instead of user and password_get_http_request_headers
: Dict with any custom headers for POST requestAn example can be found in Test package
Module with gathering functions is the main part you need to implement.
It should contain functions returning data either in dict
format or list of CSV files.
Function is registered by @register
decorator:
from insights_analytics_collector import register
@register('json_data', '1.0', format='json', description="Data description")
def json_data(**kwargs):
return {'my_data': 'True'}
Decorator @register
has following attributes:
config=True, format=json
from <your-namespace> import Collector # your implementation
collector = Collector
collector.gather()
FAQs
Collector Package for Insights for AAP
We found that insights-analytics-collector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.