Conversation
|
should there be a parameter for which mode is expected? Could you have both an |
|
@ssoroka currently What do you suggest? |
…ight want to add it later if it's necessary.
|
!retry-failed |
jessingrass
left a comment
There was a problem hiding this comment.
I haven't looked at settings yet, but would appreciate feedback on the library choice when you have time!
| - modernc.org/libc [BSD 3-Clause "New" or "Revised" License](https://gitlab.com/cznic/libc/-/blob/master/LICENSE) | ||
| - modernc.org/memory [BSD 3-Clause "New" or "Revised" License](https://gitlab.com/cznic/memory/-/blob/master/LICENSE) | ||
| - modernc.org/sqlite [BSD 3-Clause "New" or "Revised" License](https://gitlab.com/cznic/sqlite/-/blob/master/LICENSE) | ||
| - nhooyr.io/websocket [MIT License](https://github.com/nhooyr/websocket/blob/master/LICENSE.txt) |
There was a problem hiding this comment.
Curious about the reason behind this websocket library choice vs gorilla? We already have gorilla in use, so would like to understand your reasoning.
There was a problem hiding this comment.
Hey @jessingrass, I've chosen this one as it seemed simpler for my use-case and didn't notice we already have gorilla. If you want me to change I can try...
|
Hi Sven, I just got a chance to look at this. I like it and have some questions. How do you intend to use this input? Are you going to write a custom websocket server or use an existing service? Many websocket servers require authentication and have a custom request protocol that might be too complex for the trigger_body mechanism. I also think it would be good to switch this to gorilla/websocket so telegraf uses only one websocket library. I don't see any other plugins that use gorilla/websocket currently but some of our module dependencies use it, and the recent websocket output uses it. |
|
@reimda I use it for an existing service that can be handled with the means provided. Another important use-case is to connect two telegrafs in restricted (NATed) networks. Using the new websocket output plugin, we can connect two instances where an "inner" telegraf has to establish connects to an "outer" telegraf. Kind of a proxy setups with connection restrictions in place... Currently, converting this to gorilla is of low priority here due to limited time. So if anybody (looks at @FZambia ;-)) wants to step up on it, any help is appreciated. :-) |
It would be useful to add some usage examples to the readme. Maybe these would be good examples to add if you get a chance. Thanks! |
|
Will close this as there seems to be no great interest in this PR. If anyone wants to continue here, please feel free to take the code and work on it. |
Required for all PRs:
This input plugin supports gathering data from a websocket endpoint. It has two operation modes, one event-based mode waiting for the server to push data and one actively gathering the data in regular intervals.