-
Notifications
You must be signed in to change notification settings - Fork 861
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
Rewritable Tracer #309
Comments
@safris I've just checked the integration points of this project. It seems that RewritableTracer could be a standalone project:
Both options would work as far as I can see. |
I added this to the Java SIG agenda. Please tell me if you want to discuss this also in the auto-inst SIG. |
@zeitlinger, I believe the |
@safris following up on the suggestion to include this functionality in the collector, I've created open-telemetry/opentelemetry-collector#928 and open-telemetry/opentelemetry-collector#929 - which should cover all use cases that were covered by rewritable tracer. Hence I think this issue can be closed. |
Thanks for following up on this @zeitlinger. We'll continue the development in the collector issues you provided. |
Abstract
The Rewritable Tracer allows one to rewrite data in the spans created by Integrations without having to modify the source code. A JSON config file defines a set of rules that modify trace information in the layer between the integration, and the exporter.
Introduction
The Rewritable Tracer is an idea inspired by the OpenTracing Rewrite module that was originally suggested by @zeitlinger for the SpecialAgent project.
Specification
The specification below applies to the OT API, and needs to be adapted to the OTel API.
Context
The Rewritable Tracer will sit in the Span Processor layer, to be able to modify trace data generated by integrations in real time.
Inputs and Outputs
Rules contain
input
(required) andoutput
(optional) properties.Input (required)
The
input
property is required, as it defines the rule by which span data is matched. Theinput
object contains 3 properties:type
: The type of data to match (tag
,log
, oroperationName
).key
: The key of the data (a string).value
: The value of the data (a boolean, number, or string -- if a string, then the value is interpreted as a regular expression).The
input
property can contain a value with a singleinput
object, or an array with multipleinput
objects. If multipleinput
objects are provided, they will be considered with OR relationship.Output (optional)
If
output
is omitted, then the matched data will be dropped.If
output
is provided, then the matched data will be rewritten.Like the
input
object, theoutput
object follows the same schema:type
: The type of data to which the matched data is to be rewritten (tag, log, or operationName).key
: The key of the data to which the matched data is to be rewritten (a string).If
key
is omitted, then the key of the matched data will not be changed.value
: The value of the data (a boolean, number, or string -- if a string, then the value is interpreted as a regular expression).If
value
is omitted, then the value of the matched data will not be changed.The
value
string may contain back references (i.e.$1
,$2
, etc) if the value in theinput
defines a regular expression with matching groups.The
output
property can contain a value with a singleoutput
object, or an array with multipleoutput
objects. If multipleoutput
objects are provided, they will be considered with AND relationship.This is a draft proposal, intended to spur discussion so we can come to a proposal for its v1 implementation.
Other similar prior art:
The text was updated successfully, but these errors were encountered: