-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Export marshalers option in kafkaexporter
to make it extensible
#29589
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
My use case is to do some data massaging before publishing the message, maybe add some diagnostic fields and such. Hope that makes sense. |
I'm pretty new to kafka, so please excuse my ignorance here: What's the value of sending each metric as a separate message? Would the config option For logic specific to exporting to Kafka we'd want it to be in the exporter, but if you're doing more general data transformation we'd want to use processors. If you share more information about what kind of data you'd want to publish with metrics I can point you towards some possible existing processors that would work. |
I'm sorry, let me clarify my use case. It's not that I want to send each message individually (although that's what I wrote earlier, my bad), I want to really unwrap the metrics and send my own custom proto / json on the bus. I understand this is out of scope for OpenTelemetry but if those methods were exported, that'd make building such custom logic really easy. Additionally, as I mentioned I could add other types of enhancements as well. |
From my understanding that's not a supported purpose of the of the marshaller. Marshallers are meant to handle data formatting conversions with official data schemas, like OTLP, Zipkin, Jaegar, etc. We do have existing processors that can do these kinds of transformations though, so it would be worth checking those out. The transform processor probably has the most functionality with changing metric formatting. Using the metric context or even the datapoint context gets you access to most metric fields. From there you can modify and move around the fields to try to make the format you're looking for. If processors don't work for your use-case, you're welcome to create your own collector repository and implement a marshaller that works for you. Let me know though if I've misunderstood your request here! |
That makes sense, I wrote a custom exporter to handle this. Thanks! |
Component(s)
exporter/kafka
Describe the issue you're reporting
I'm trying to extend the existing kafkaexporter by passing a
FactoryOption
to override the default marshalers but I don't know how to instantiate one because the param to that is not exported.This is what I wish to do:
But since
withMetricsMarshalers
is private inkafkaexporter
, I cannot do this.I cannot implement my own
withMetricsMarshalers()
either becauseFactoryOption
cannot be instantiated as the fields in that type are also private.Am I missing something? Are components not supposed to be extended? Or is it possible to export this fields?
The text was updated successfully, but these errors were encountered: