-
Notifications
You must be signed in to change notification settings - Fork 846
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
JaegerExporter caches sender, which locks process service.name for all Spans #2606
Comments
@bennbollay the exporter is operating under the assumption that resource is immutable. It assumes the |
Resource is immutable according to the specification. |
@aabmass I'm calling the exporter.export directly, yes. As a developer, my expectation was that parameters specified on the span are expected to be ephemeral; parameters that are constant would have been supplied during construction, rather than intuited on first span and then persisted forever more. This seems like a micro-optimization and caused several days worth of hunting around before I was able to understand the system deeply enough to determine what and where the parameters I was explicitly setting on each span were getting ignored. |
it's not meant to be a performance optimization for the exporter. It's meant to ensure identity doesn't change between spans in order to not confuse backends. That said, the immutability should be per-span-processor not per-exporter so it should be fine to remove the caching from the exporter itself. Would you like to make a PR for that or should I mark this up for grabs? |
Removing the bug label since this is working as designed, it's just a design we don't want :) |
Are there backends that expect all of the spans in a batched request to have the same identity? Is that part of the protocol specification? Seems like it would break aggregators or forwarders, if that was the case... I'm absolutely not informed enough about this space to have a strong opinion, but this sounds like it might be a "good idea to be defensive" that ended up being a "unnecessarily opinionated" library decision. I'm happy to throw together a PR for this, but will need some hand-holding (here or on Slack is fine) so that I'm making the right change in the right place. |
Some exporters (like otlp) treat the resource as a separate object from the span and spans are attached to the resource. Backends can then determine that two spans came from the same tracer if they have the same resource. If the resource is ever mutated, then that backend would not know the spans are from the same tracer. As far as all of the spans in a batch having the same resource I don't think that's a requirement. The change that should be made is just that the exporter shouldn't cache the resource, but should instead use whatever resource is attached to the span. The immutability is already enforced elsewhere in the SDK. |
Correct me if I'm wrong, but the sender looks like a "client" resource which keeps open a thrift connection. You would only want to create one for a given exporter, and not close the client every time, right? It isn't clear to me if you can update the service name after creating a client, and creating a new client for every request could be expensive. Based on our discussion of your use case, you may run into more surprises. Keep in mind these exporters are meant for use in the OTel SDK and can make certain assumptions based on this. For example they are not safe for concurrent use. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
I think this is still an issue |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
The call to getSender caches the results of the sender generation, but the sender itself caches the
service.name
:This produces much surprise when multiple spans with different SERVICE_NAME tags specified on them are supplied to the same exporter instance.
This can be worked around by sending spans through instances that match the service.name via caching, or generating a new entry on execution.
The text was updated successfully, but these errors were encountered: