-
Notifications
You must be signed in to change notification settings - Fork 0
[PD1-296] Initial version: SDK for spans and metrics #1
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
Conversation
|
|
||
| # None indicates that the end time is not known; the span extends beyond | ||
| # the query period. | ||
| raw_end_at = None |
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.
Does this not mean the first Span object's raw_end_time is always None? The function signature specified that if end_at is given that will be the raw_end_time of the newest Span
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.
I changed the documentation to match the implemented behavior in ecb633d
richardzyx
left a comment
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.
Really significant effort, appreciate the hard work on this! Concept make sense to me, code interface seems fine.
One comment/question is on build & release pipeline: I assume we'd want to package this into a .whl wheel file with .pyc compiled py bytecode? Optionally we can also obfuscate the source code with pyminifier or something similar?
There's also the option of distributing to private registry like AWS Codeartifact, but controlling access seems to be painful with the right security measures.
PD1-296 Publish CVector SDK for Ammobia
Initial ReleaseData ModelThis SDK integrates directly with CVector's database. Each tenant has a schema and a database user, both named for the tenant. The API Key is the password of the user. The database user is restricted to only have access to the tenant's schema. Here are the available database tables: CVec ClassThe SDK provides an API client class named
Future FeaturesOut of scope for this issue.
|
The pyc files are specific to particular versions of Python. PEP 3147 was implement and adds the possibility of distributing a library using only pyc files (by compiling for every version of Python), but I can't find any distribution tool that creates this kind of archive. The wisdom of the internet: "If you don't want to distribute source, then you shouldn't use Python." I'll add pyminifier with the obfuscate option, remove the schema documentation, and won't make this repo public. |
I tried pyminifier, but it makes the package unusable. I'll see if I can move the implementation to the back-end, so that this library doesn't expose our database structure. |
Summary
This repo is meant to be made public and published on PyPI as "cvec". The public package should make it easy for clients to import it.
Span
A span is a period of interest, such as an experiment, a baseline recording session, or an alarm. The initial state of a Span is implicitly defined by a period where a given metric has a constant value.
The newest span for a metric does not have an end time, since it has not ended yet (or has not ended by the finish of the queried period).
In a future version, spans are mutable. An API will allow the client to annotate metrics, and edit the start/end times.
Metric
A metric is a named set of time-series data points pertaining to a particular resource (for example, the value reported by a sensor). A metric has a lifecycle of being activated or added to the system (birth_at) and later removed from the system (death_at). Metrics can have numeric or string values. Boolean values are mapped to 0 and 1.
Testing