chore: add type definitions for exporter-jaeger#93
chore: add type definitions for exporter-jaeger#93kjin merged 4 commits intocensus-instrumentation:masterfrom
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
CLA has been signed! |
| }; | ||
|
|
||
| export type ThriftSpan = { | ||
| traceIdLow: any, // tslint:disable-line:no-any |
There was a problem hiding this comment.
Are the any fields actually any? I feel like they can be strings instead for the most part.
| parentSpanId: parentSpan, | ||
| operationName: span.name, | ||
| references: [], | ||
| references: [] as any, // tslint:disable-line:no-any |
There was a problem hiding this comment.
Should be casted to whatever the type of references is, currently any[] but hopefully a tighter type.
There was a problem hiding this comment.
Yeah, let me dig in and see if I can tighten up the types.
The JaegerTraceExporterOptions accepts `tags` as a Tag array, but was processing those tags for the process information as if they were an object / Record instead of a Tag array. This was leading to the process key-value inside Jaeger to be the array index as key and the value as the key-value object. We now use the proper key-value information from the input to place into the process tags. There were two approaches we could have taken here: 1. To leave the input as a Tag array and process the input properly in the code or 2. To change the input to a key-value record / object (Record<string, TagValue), which would be handled properly by the existing code. We have chosen approach census-instrumentation#1 because a Jaeger process tag CAN support multiple tags with the same key name, which would not be supported in approach census-instrumentation#2. There is a chance that (because we were not previously exporting typescript types) users were passing in a Record format instead of Array, and thus this might be seen as a breaking change. A test has been added to validate the process information to ensure proper format. Also included are sticter typing for all thrift types, removing all `any` references and replacing with valid types.
|
Added types for all the ThriftSpan properties. In doing more testing I found that the Here's what I added in the commit message. I wanted to make sure it was highlighted since it's potentially breaking api: |
kjin
left a comment
There was a problem hiding this comment.
LGTM w/ nit. I'll make sure to include your comments in the squashed commit message.
| return; | ||
| } | ||
| }); | ||
| assert.strictEqual( |
There was a problem hiding this comment.
You can just use assert.ok here.
|
Hi @justindsmith -- This is good to land but I couldn't find your name in the CLA database. Could you retry the CLA signing procedure please? |
|
@kjin I kicked off the process to submit on behalf of my employer (Omnition) and not individually. I thought we had done all the right steps (setup internal google group, add relevant users to that list, get it signed, etc). Is there a separate directory for employer signed contributors? (I mostly want to make sure that we setup that process correctly for other future contributors from our team.) |
|
I see. I don't see it in the list right now, but it seems like it might take some time (a few days -- so hopefully today). I will check back periodically... thanks for the clarification. |
|
Ok great. Thanks. We signed it this past Tuesday morning just for reference. If it doesn't show up we can follow up to see what might be going on. |
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) |
|
@justindsmith Found Omnition in the database, so we're good to go 👍 |
…on#93) The JaegerTraceExporterOptions accepts `tags` as a Tag array, but was processing those tags for the process information as if they were an object / Record instead of a Tag array. This was leading to the process key-value inside Jaeger to be the array index as key and the value as the key-value object. We now use the proper key-value information from the input to place into the process tags. There were two approaches we could have taken here: 1. To leave the input as a Tag array and process the input properly in the code or 2. To change the input to a key-value record / object (Record<string, TagValue), which would be handled properly by the existing code. We have chosen approach census-instrumentation#1 because a Jaeger process tag CAN support multiple tags with the same key name, which would not be supported in approach census-instrumentation#2. There is a chance that (because we were not previously exporting typescript types) users were passing in a Record format instead of Array, and thus this might be seen as a breaking change. A test has been added to validate the process information to ensure proper format. Also included are sticter typing for all thrift types, removing all `any` references and replacing with valid types.
…on#93) The JaegerTraceExporterOptions accepts `tags` as a Tag array, but was processing those tags for the process information as if they were an object / Record instead of a Tag array. This was leading to the process key-value inside Jaeger to be the array index as key and the value as the key-value object. We now use the proper key-value information from the input to place into the process tags. There were two approaches we could have taken here: 1. To leave the input as a Tag array and process the input properly in the code or 2. To change the input to a key-value record / object (Record<string, TagValue), which would be handled properly by the existing code. We have chosen approach census-instrumentation#1 because a Jaeger process tag CAN support multiple tags with the same key name, which would not be supported in approach census-instrumentation#2. There is a chance that (because we were not previously exporting typescript types) users were passing in a Record format instead of Array, and thus this might be seen as a breaking change. A test has been added to validate the process information to ensure proper format. Also included are sticter typing for all thrift types, removing all `any` references and replacing with valid types.
…on#93) The JaegerTraceExporterOptions accepts `tags` as a Tag array, but was processing those tags for the process information as if they were an object / Record instead of a Tag array. This was leading to the process key-value inside Jaeger to be the array index as key and the value as the key-value object. We now use the proper key-value information from the input to place into the process tags. There were two approaches we could have taken here: 1. To leave the input as a Tag array and process the input properly in the code or 2. To change the input to a key-value record / object (Record<string, TagValue), which would be handled properly by the existing code. We have chosen approach census-instrumentation#1 because a Jaeger process tag CAN support multiple tags with the same key name, which would not be supported in approach census-instrumentation#2. There is a chance that (because we were not previously exporting typescript types) users were passing in a Record format instead of Array, and thus this might be seen as a breaking change. A test has been added to validate the process information to ensure proper format. Also included are sticter typing for all thrift types, removing all `any` references and replacing with valid types.
The typescript definition files weren't being generated for the exporter-jaeger package because the tsconfig didn't extend from the gts base config.