-
Notifications
You must be signed in to change notification settings - Fork 147
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
Proposed Best Practice: Metrics #16
Comments
I'd rename For SaaS integrations, it may be helpful to specify both an Some endpoints provide no data, only metadata. In that case, would I'd ditch the |
Thanks for the feedback @karstendick . I agree with most of your suggestion.
yes
That's a good point. If we ditch the tags key, then I suppose we would have both "endpoint" and "table" keys, and Taps could decide whether to use one, both, or neither. Alternatively, should we use a more generic name for the source of the data? Maybe just "source". That could be a URL or a table name.
I suppose either 0 or just leave it null. That way we can count that we made a request, but not suggest that that request would impact the record count.
Yeah, I agree. Thanks. |
As a best practice, a Tap or Target should emit structured logging to a file, which can be used for monitoring or other analysis.
Both a Tap and a Target should accept an optional "metrics_path" key in its configuration file. If that key is present, the Tap or Target should write out a JSON map every time it makes an external request, for example to an API or database. If a Tap or Target that supports metrics is run without a "metrics_path" key, it should not fail, it should just not write metrics.
It is expected that whatever program runs the Tap or Target will provide the name of a file to write the metrics to, and that some program will consume the metrics from that location and store them somewhere. We could use either a named pipe or a regular file. If a named pipe is used, the wrapper program must ensure that something reads from the pipe continuously so as not to block the Tap. If a regular file is used, the wrapper program must ensure that it does not cause the disk to fill up.
The metric structure is designed to specifically capture information relevant to the types of external calls that a Tap or Target would typically make. All fields are optional. If some of these fields are hard for a particular Tap to track, we would rather have it report something than nothing.
success
- Whether the call succeededduration
- How long the request or call took, in millisecondsnum_bytes
- Size of request or call payload in bytesnum_records
- Size of request or call payload in terms of number of recordstags
- (optional) Mapping from string keys to string values providing additional description of the requestExamples
Successful API call from a Tap:
Successful SELECT statement from a Tap:
Questions
The text was updated successfully, but these errors were encountered: