US9703675B2ActiveUtilityPatentIndex 79
Structured logging and instrumentation framework
Est. expiryAug 11, 2034(~8.1 yrs left)· nominal 20-yr term from priority
G06F 11/3636A63F 13/77A63F 13/60A63F 2300/5533
79
PatentIndex Score
12
Cited by
33
References
20
Claims
Abstract
A structured logging and instrumentation framework may include a structured logging service that interacts with one or more instrumentation points of an application at runtime. The structured logging service may expose a structured logging application programming interface that may be called by an instrumentation point for passing structured trace event information. The structured logging service may be implemented as a source of structured trace event information for one or more consumers and may output structured trace event information as a serialized string or as one or more strongly-typed key-value pairs.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1. A computer-implemented method comprising:
implementing, by a computing device, a structured logging service;
exposing, by the structured logging service, a structured logging application programming interface (API) that implements trace event parameters;
receiving a call to the structured logging API from an instrumentation point that is implemented within an application, the call supplying trace event arguments for the trace event parameters, wherein:
the structured logging API does not support receiving a print-formatted string for the trace event arguments, and
the trace event arguments include a label argument for passing in a text-only message string and a structured payload containing one or more strongly-typed key-value pairs;
capturing structured trace event information based on the trace event arguments supplied in the call;
outputting, to a rules engine, a portion of the structured trace event information that corresponds to the structured payload as the one or more strongly-typed key-value pairs, wherein the rules engine is configured to apply consumption rules to the one or more strongly-typed key-value pairs for targeting certain items of the structured trace information; and
outputting, to a disk sink, the portion of the structured trace event information that corresponds to the structured payload as the text-only message string corresponding to the label argument followed by a serialized string of the one or more strongly-typed key-value pairs, wherein the disk log sink is configured to write the text-only message and the serialized string to a message data field of a trace log.
2. The computer-implemented method of claim 1 , wherein the trace event parameters implemented by the structured logging API include: a trace tag parameter that accepts a trace tag ID for a trace event, a trace category parameter that accepts a category name or category ID for the trace event, and a trace severity parameter that accepts a severity level for the trace event.
3. The computer-implemented method of claim 1 , wherein the call to the structured logging API explicitly declares a structured data type that is supported by the rules engine for each of the one or more strongly-typed key-value pairs.
4. The computer-implemented method of claim 3 , wherein:
the structured data type declared for the one or more strongly-typed key-value pairs is a StructuredString, a StructuredBool, or a StructuredInt; and
the serialized string is output to the disk log sink is in a JavaScript Object Notation (JSON) format that is both human-readable and machine-readable.
5. The computer-implemented method of claim 1 , wherein the serialized string is in JavaScript Object Notation (JSON) format.
6. The computer-implemented method of claim 5 , wherein:
the text-only message is a developer-defined static description of a trace event to be reviewed in the trace log.
7. The computer-implemented method of claim 1 , further comprising:
outputting the one or more strongly-typed key-value pairs to the rules engine to provide dynamic telemetry collection for the application.
8. The computer-implemented of claim 7 , wherein:
the rules engine is configured to receive the consumption rules from a rules service over a network.
9. The computer-implemented method of claim 8 , wherein:
the the consumption rules specify a calculation to be performed by the rules engine on the one or more strongly-typed key-value pairs.
10. The computer-implemented method of claim 8 , wherein:
the rules engine is configured to generate rule results by applying the consumption rules to strongly-typed key-value pairs supplied by multiple instrumentation points, and
the rules engine is configured to send the rule results to the rules service as telemetry data.
11. A computing device comprising:
a processor for executing computer-executable instructions; and
memory storing computer-executable instructions configured to:
expose a structured logging application programming interface (API) that implements trace event parameters;
receive a call to the structured logging API from an instrumentation point implemented by an application, the call supplying trace event arguments for the trace event parameters, wherein:
the structured logging API does not support receiving a print-formatted string for the trace event arguments, and
the trace event arguments include a label argument for passing in a text-only message string and a structured payload including one or more strongly-typed key-value pairs;
capture structured trace information based on the trace event arguments supplied in the call;
output, to a rules engine, a portion of the structured trace event information that corresponds to the structured payload as the one or more strongly-typed key-value pairs, wherein the rules engine is configured to apply consumption rules to the one or more strongly-typed key-value pairs for targeting certain items of the structured trace information; and
output, to a disk sink, the portion of the structured trace event information that corresponds to the structured payload as the text-only message string corresponding to the label argument followed by a serialized string of the one or more strongly-typed key-value pairs, wherein the disk sink is configured to write the text-only message and the serialized string to a message data field of a trace log.
12. The computing device of claim 11 , wherein the trace event parameters implemented by the structured logging API include: a trace tag parameter that accepts a trace tag ID for a trace event, a trace category parameter that accepts a category name or category ID for the trace event, and a trace severity parameter that accepts a severity level for the trace event.
13. The computing device of claim 11 , wherein the structured logging API requires an explicitly declared structured data type that is supported by the rules engine for each of the one or more strongly-typed key-value pairs.
14. The computing device of claim 11 , wherein:
the structured data type declared for the one or more strongly-typed key-value pairs is a StructuredString, a StructuredBool, or a StructuredInt; and
the serialized string is output to the disk log sink is in a JavaScript Object Notation (JSON) format that is both human-readable and machine-readable.
15. The computing device of claim 11 , wherein the memory further stores computer-executable for:
outputting the one or more strongly-typed key-value pairs to the rules engine to target telemetry data in the strongly-typed key-value pairs and perform a calculation on the telemetry data for generating a rule result.
16. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor of a computing device, cause the computing device to perform a method comprising:
exposing, by a structured logging service, a structured logging application programming interface (API) that implements trace event parameters, the structured logging API including a function for sending structured trace event information;
receiving a call to the function from an instrumentation point that is implemented within source code of an application, the call supplying trace event arguments for the trace event parameters, wherein:
the structured logging API does not support receiving a print-formatted string as a trace event argument, and
the trace event arguments include a label argument for passing in a text-only message string and a structured payload containing a series of strongly-typed key-value pairs;
capturing structured trace information based on the trace event arguments supplied in the call;
outputting, to a rules engine, a portion of the structured trace event information that corresponds to the structured payload as the series of strongly-typed key-value pairs, wherein the rules engine is configured to apply consumption rules to the strongly-typed key-value pairs for targeting certain items of the structured trace information; and
outputting, to a disk sink, the portion of the structured trace event information that corresponds to the structured payload as the text-only message string corresponding to the label argument followed by a serialized string of the strongly-typed key-value pairs, wherein the disk log sink is configured to write the text-only message and the serialized string to a message data field of a trace log.
17. The computer-readable storage medium of claim 16 , further storing computer-executable instructions for:
implementing the rules engine to extract targeted items of telemetry data from the strongly-typed key-value pairs and perform a calculation on the telemetry data for generating a rule result.
18. The computer-readable storage medium of claim 17 , wherein the structured logging API declares structured data types that are supported by the rules engine for the strongly-typed key-value pairs.
19. The computer-readable storage medium of claim 18 , wherein:
the structured data types declared for the strongly-typed key-value pairs include StructuredString, a StructuredBool, or a StructuredInt; and
the serialized string is output to the disk log sink is in a JavaScript Object Notation (JSON) format that is both human-readable and machine-readable.
20. The computer-readable storage medium of claim 17 , wherein the structured logging API is overloaded to support a range of numbers of strongly-typed key-value pairs.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.